@@ -163,7 +163,7 @@ static void pfont_write(struct pfont *ps)
163
163
pdfout (" /LastChar %d\n" , ps -> gend % 256 );
164
164
pdfout (" /Widths [" );
165
165
for (i = ps -> gbeg ; i <= ps -> gend ; i ++ )
166
- pdfout (" %d" , (long ) font_glget (fn , i )-> wid * 100 * 72 / dev_res );
166
+ pdfout (" %d" , (long long ) font_glget (fn , i )-> wid * 100 * 72 / dev_res );
167
167
pdfout (" ]\n" );
168
168
pdfout (" /FontDescriptor %d 0 R\n" , ps -> des );
169
169
pdfout (" /Encoding %d 0 R\n" , enc_obj );
@@ -205,7 +205,7 @@ static void pfont_writecid(struct pfont *ps)
205
205
gcnt ++ ;
206
206
pdfout (" /W [ %d [" , ps -> gbeg );
207
207
for (i = ps -> gbeg ; i <= ps -> gend ; i ++ )
208
- pdfout (" %d" , (long ) font_glget (fn , i )-> wid * 100 * 72 / dev_res );
208
+ pdfout (" %d" , (long long ) font_glget (fn , i )-> wid * 100 * 72 / dev_res );
209
209
pdfout (" ] ]\n" );
210
210
pdfout (">>\n" );
211
211
obj_end ();
@@ -358,8 +358,8 @@ static int o_loadfont(struct glyph *g)
358
358
static char * pdfpos00 (int uh , int uv )
359
359
{
360
360
static char buf [64 ];
361
- int h = (long ) uh * 72 / dev_res ;
362
- int v = (long ) pdf_height * 100 - (long ) uv * 72 / dev_res ;
361
+ int h = (long long ) uh * 72 / dev_res ;
362
+ int v = (long long ) pdf_height * 100 - (long long ) uv * 72 / dev_res ;
363
363
sprintf (buf , "%s%d.%02d %s%d.%02d" ,
364
364
h < 0 ? "-" : "" , abs (h ) / 100 , abs (h ) % 100 ,
365
365
v < 0 ? "-" : "" , abs (v ) / 100 , abs (v ) % 100 );
@@ -376,7 +376,7 @@ static char *pdfpos(int uh, int uv)
376
376
static char * pdfunit (int uh , int sz )
377
377
{
378
378
static char buf [64 ];
379
- int h = (long ) uh * 1000 * 72 / sz / dev_res ;
379
+ int h = (long long ) uh * 1000 * 72 / sz / dev_res ;
380
380
sprintf (buf , "%s%d" , h < 0 ? "-" : "" , abs (h ));
381
381
return buf ;
382
382
}
@@ -664,9 +664,9 @@ static int pdfext(char *pdf, int len, int hwid, int vwid)
664
664
bbox = pdf_dval_val (pdf , len , pages , "/MediaBox" );
665
665
if (bbox >= 0 && !pdfbbox100 (pdf , len , bbox , dim )) {
666
666
if (hwid > 0 )
667
- hzoom = (long ) hwid * (100 * 7200 / dev_res ) / (dim [2 ] - dim [0 ]);
667
+ hzoom = (long long ) hwid * (100 * 7200 / dev_res ) / (dim [2 ] - dim [0 ]);
668
668
if (vwid > 0 )
669
- vzoom = (long ) vwid * (100 * 7200 / dev_res ) / (dim [3 ] - dim [1 ]);
669
+ vzoom = (long long ) vwid * (100 * 7200 / dev_res ) / (dim [3 ] - dim [1 ]);
670
670
if (vwid <= 0 )
671
671
vzoom = hzoom ;
672
672
if (hwid <= 0 )
@@ -915,16 +915,16 @@ void drawl(int h, int v)
915
915
/* draw circle/ellipse quadrant */
916
916
static void drawquad (int ch , int cv )
917
917
{
918
- long b = 551915 ;
919
- long x0 = o_h * 1000 ;
920
- long y0 = o_v * 1000 ;
921
- long x3 = x0 + ch * 1000 / 2 ;
922
- long y3 = y0 + cv * 1000 / 2 ;
923
- long x1 = x0 ;
924
- long y1 = y0 + cv * b / 1000 / 2 ;
925
- long x2 = x3 - ch * b / 1000 / 2 ;
926
- long y2 = y3 ;
927
- if (ch * cv < 0 ) {
918
+ long long b = 551915 ;
919
+ long long x0 = o_h * 1000 ;
920
+ long long y0 = o_v * 1000 ;
921
+ long long x3 = x0 + ch * 1000 / 2 ;
922
+ long long y3 = y0 + cv * 1000 / 2 ;
923
+ long long x1 = x0 ;
924
+ long long y1 = y0 + cv * b / 1000 / 2 ;
925
+ long long x2 = x3 - ch * b / 1000 / 2 ;
926
+ long long y2 = y3 ;
927
+ if (( ch > 0 && cv < 0 ) || ( ch < 0 && cv > 0 ) ) {
928
928
x1 = x0 + ch * b / 1000 / 2 ;
929
929
y1 = y0 ;
930
930
x2 = x3 ;
0 commit comments