Skip to content

Commit 65eb0d8

Browse files
committed
Conversion fixes
1 parent 0a7487e commit 65eb0d8

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

ext/gd/libgd/gd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ gdImageDashedLine (gdImagePtr im, int x1, int y1, int x2, int y2, int color)
10921092
else
10931093
{
10941094
/* More-or-less vertical. use wid for horizontal stroke */
1095-
wid = thick * sin (atan2 (dy, dx));
1095+
wid = (int)(thick * sin (atan2 (dy, dx)));
10961096
vert = 0;
10971097

10981098
d = 2 * dx - dy;

ext/gd/libgd/gd_jpeg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ term_destination (j_compress_ptr cinfo)
812812
/* Write any data remaining in the buffer */
813813
if (datacount > 0)
814814
{
815-
if (gdPutBuf (dest->buffer, datacount, dest->outfile) != datacount)
815+
if ((size_t)gdPutBuf (dest->buffer, datacount, dest->outfile) != datacount)
816816
ERREXIT (cinfo, JERR_FILE_WRITE);
817817
}
818818
}

ext/gd/libgd/gdft.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ extern int access(const char *pathname, int mode);
2626
#endif
2727

2828
/* number of antialised colors for indexed bitmaps */
29+
/* overwrite Windows GDI define in case of windows build */
30+
#ifdef NUMCOLORS
31+
#undef NUMCOLORS
32+
#endif
2933
#define NUMCOLORS 8
3034

3135
char *
@@ -880,8 +884,8 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist,
880884
if (ch == '\r')
881885
{
882886
penf.x = 0;
883-
x1 = (penf.x * cos_a - penf.y * sin_a + 32) / 64;
884-
y1 = (penf.x * sin_a + penf.y * cos_a + 32) / 64;
887+
x1 = (int)(penf.x * cos_a - penf.y * sin_a + 32) / 64;
888+
y1 = (int)(penf.x * sin_a + penf.y * cos_a + 32) / 64;
885889
pen.x = pen.y = 0;
886890
previous = 0; /* clear kerning flag */
887891
next++;
@@ -890,10 +894,10 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist,
890894
/* newlines */
891895
if (ch == '\n')
892896
{
893-
penf.y -= face->size->metrics.height * linespace;
897+
penf.y -= (long)(face->size->metrics.height * linespace);
894898
penf.y = (penf.y - 32) & -64; /* round to next pixel row */
895-
x1 = (penf.x * cos_a - penf.y * sin_a + 32) / 64;
896-
y1 = (penf.x * sin_a + penf.y * cos_a + 32) / 64;
899+
x1 = (int)(penf.x * cos_a - penf.y * sin_a + 32) / 64;
900+
y1 = (int)(penf.x * sin_a + penf.y * cos_a + 32) / 64;
897901
pen.x = pen.y = 0;
898902
previous = 0; /* clear kerning flag */
899903
next++;

0 commit comments

Comments
 (0)