]> granicus.if.org Git - php/commitdiff
Conversion fixes
authorMarcus Boerger <helly@php.net>
Fri, 29 Nov 2002 01:44:19 +0000 (01:44 +0000)
committerMarcus Boerger <helly@php.net>
Fri, 29 Nov 2002 01:44:19 +0000 (01:44 +0000)
ext/gd/libgd/gd.c
ext/gd/libgd/gd_jpeg.c
ext/gd/libgd/gdft.c

index 348092ccfc48a0b45b346fd42d02e05579e64b9e..56eb5c89fb0a42a286f52c08f8718edbc5d94231 100644 (file)
@@ -1092,7 +1092,7 @@ gdImageDashedLine (gdImagePtr im, int x1, int y1, int x2, int y2, int color)
   else
     {
       /* More-or-less vertical. use wid for horizontal stroke */
-      wid = thick * sin (atan2 (dy, dx));
+      wid = (int)(thick * sin (atan2 (dy, dx)));
       vert = 0;
 
       d = 2 * dx - dy;
index 17f40ca41aafd2b400e95d467bb2d4aea1920837..a1bd445d6a689158db82113db0be7fac734ecb61 100644 (file)
@@ -812,7 +812,7 @@ term_destination (j_compress_ptr cinfo)
   /* Write any data remaining in the buffer */
   if (datacount > 0)
     {
-      if (gdPutBuf (dest->buffer, datacount, dest->outfile) != datacount)
+      if ((size_t)gdPutBuf (dest->buffer, datacount, dest->outfile) != datacount)
        ERREXIT (cinfo, JERR_FILE_WRITE);
     }
 }
index 4e1aed436e032bc59a39e1c201fb3f0d479a6bb7..746613e438ccceda2c4a74df52328ca46f4863e0 100644 (file)
@@ -26,6 +26,10 @@ extern int access(const char *pathname, int mode);
 #endif
 
 /* number of antialised colors for indexed bitmaps */
+/* overwrite Windows GDI define in case of windows build */
+#ifdef NUMCOLORS
+#undef NUMCOLORS
+#endif
 #define NUMCOLORS 8
 
 char *
@@ -880,8 +884,8 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist,
       if (ch == '\r')
        {
          penf.x = 0;
-         x1 = (penf.x * cos_a - penf.y * sin_a + 32) / 64;
-         y1 = (penf.x * sin_a + penf.y * cos_a + 32) / 64;
+         x1 = (int)(penf.x * cos_a - penf.y * sin_a + 32) / 64;
+         y1 = (int)(penf.x * sin_a + penf.y * cos_a + 32) / 64;
          pen.x = pen.y = 0;
          previous = 0;         /* clear kerning flag */
          next++;
@@ -890,10 +894,10 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist,
       /* newlines */
       if (ch == '\n')
        {
-         penf.y -= face->size->metrics.height * linespace;
+         penf.y -= (long)(face->size->metrics.height * linespace);
          penf.y = (penf.y - 32) & -64;         /* round to next pixel row */
-         x1 = (penf.x * cos_a - penf.y * sin_a + 32) / 64;
-         y1 = (penf.x * sin_a + penf.y * cos_a + 32) / 64;
+         x1 = (int)(penf.x * cos_a - penf.y * sin_a + 32) / 64;
+         y1 = (int)(penf.x * sin_a + penf.y * cos_a + 32) / 64;
          pen.x = pen.y = 0;
          previous = 0;         /* clear kerning flag */
          next++;