pajoye          Tue Dec 27 00:11:16 2005 EDT

  Modified files:              
    /php-src/ext/gd     gd.c 
  Log:
  - silent compile warning introduced by previous commit
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/gd/gd.c?r1=1.334&r2=1.335&diff_format=u
Index: php-src/ext/gd/gd.c
diff -u php-src/ext/gd/gd.c:1.334 php-src/ext/gd/gd.c:1.335
--- php-src/ext/gd/gd.c:1.334   Mon Dec 26 21:46:56 2005
+++ php-src/ext/gd/gd.c Tue Dec 27 00:11:16 2005
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: gd.c,v 1.334 2005/12/26 21:46:56 pajoye Exp $ */
+/* $Id: gd.c,v 1.335 2005/12/27 00:11:16 pajoye Exp $ */
 
 /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
    Cold Spring Harbor Labs. */
@@ -88,8 +88,6 @@
 int gdImageColorClosestHWB(gdImagePtr im, int r, int g, int b);
 #endif
 
-#define gdNewDynamicCtxEx(len, data, val) gdNewDynamicCtx(len, data)
-
 /* Section Filters Declarations */
 /* IMPORTANT NOTE FOR NEW FILTER
  * Do not forget to update:
@@ -159,7 +157,6 @@
        PHP_FE(imagecopymergegray,                                              
NULL)
        PHP_FE(imagecopyresized,                                                
NULL)
        PHP_FE(imagecreate,                                                     
        NULL)
-#if HAVE_LIBGD20
        PHP_FE(imagecreatetruecolor,                                    NULL)
        PHP_FE(imageistruecolor,                                                
NULL)
        PHP_FE(imagetruecolortopalette,                                 NULL)
@@ -173,7 +170,6 @@
        PHP_FE(imagecolorclosestalpha,                                  NULL)
        PHP_FE(imagecolorexactalpha,                                    NULL)
        PHP_FE(imagecopyresampled,                                              
NULL)
-#endif
 
 #ifdef HAVE_GD_BUNDLED
        PHP_FE(imagerotate,                                                     
NULL)
@@ -245,7 +241,7 @@
 #ifdef ENABLE_GD_TTF
        PHP_FE(imagettfbbox,                                                    
NULL)
        PHP_FE(imagettftext,                                                    
NULL)
-#if HAVE_LIBGD20 && HAVE_LIBFREETYPE && HAVE_GD_STRINGFTEX
+#if HAVE_LIBFREETYPE && HAVE_GD_STRINGFTEX
        PHP_FE(imageftbbox,                                                     
        NULL)
        PHP_FE(imagefttext,                                                     
        NULL)
 #endif
@@ -294,7 +290,7 @@
        PHP_MINIT(gd),
        PHP_MSHUTDOWN(gd),
        NULL,
-#if HAVE_LIBGD20 && HAVE_GD_STRINGFT && (HAVE_GD_FONTCACHESHUTDOWN || 
HAVE_GD_FREEFONTCACHE)
+#if HAVE_GD_STRINGFT && (HAVE_GD_FONTCACHESHUTDOWN || HAVE_GD_FREEFONTCACHE)
        PHP_RSHUTDOWN(gd),
 #else
        NULL,
@@ -370,14 +366,13 @@
        REGISTER_LONG_CONSTANT("IMG_COLOR_STYLEDBRUSHED", gdStyledBrushed, 
CONST_CS | CONST_PERSISTENT);
        REGISTER_LONG_CONSTANT("IMG_COLOR_TRANSPARENT", gdTransparent, CONST_CS 
| CONST_PERSISTENT);
 #endif
-#if HAVE_LIBGD20
        /* for imagefilledarc */
        REGISTER_LONG_CONSTANT("IMG_ARC_ROUNDED", gdArc, CONST_CS | 
CONST_PERSISTENT);
        REGISTER_LONG_CONSTANT("IMG_ARC_PIE", gdPie, CONST_CS | 
CONST_PERSISTENT);
        REGISTER_LONG_CONSTANT("IMG_ARC_CHORD", gdChord, CONST_CS | 
CONST_PERSISTENT);
        REGISTER_LONG_CONSTANT("IMG_ARC_NOFILL", gdNoFill, CONST_CS | 
CONST_PERSISTENT);
        REGISTER_LONG_CONSTANT("IMG_ARC_EDGED", gdEdged, CONST_CS | 
CONST_PERSISTENT);
-#endif
+
 /* GD2 image format types */
 #ifdef GD2_FMT_RAW
        REGISTER_LONG_CONSTANT("IMG_GD2_RAW", GD2_FMT_RAW, CONST_CS | 
CONST_PERSISTENT);
@@ -413,7 +408,7 @@
 
 /* {{{ PHP_RSHUTDOWN_FUNCTION
  */
-#if HAVE_LIBGD20 && HAVE_GD_STRINGFT && (HAVE_GD_FONTCACHESHUTDOWN || 
HAVE_GD_FREEFONTCACHE)
+#if HAVE_GD_STRINGFT && (HAVE_GD_FONTCACHESHUTDOWN || HAVE_GD_FREEFONTCACHE)
 PHP_RSHUTDOWN_FUNCTION(gd)
 {
 #if HAVE_GD_FONTCACHESHUTDOWN
@@ -707,7 +702,6 @@
 }
 /* }}} */
 
-#if HAVE_LIBGD20
 /* {{{ proto resource imagecreatetruecolor(int x_size, int y_size)
    Create a new true color image */
 PHP_FUNCTION(imagecreatetruecolor)
@@ -921,7 +915,6 @@
 }
 /* }}} */
 
-#if HAVE_LIBGD20
 /* {{{ proto bool imagesavealpha(resource im, bool on)
    Include alpha channel to a saved image */
 PHP_FUNCTION(imagesavealpha)
@@ -940,7 +933,6 @@
 
        RETURN_TRUE;
 }
-#endif
 
 #if HAVE_GD_BUNDLED
 /* {{{ proto bool imagelayereffect(resource im, int effect)
@@ -1086,7 +1078,6 @@
        RETURN_TRUE;
 }
 /* }}} */
-#endif
 
 #ifdef HAVE_GD_BUNDLED
 /* {{{ proto resource imagerotate(resource src_im, float angle, int bgdcolor)
@@ -1594,14 +1585,12 @@
                                }
                                (*func_p)(im, i, fp);
                                break;
-#if HAVE_LIBGD20
                        case PHP_GDIMG_TYPE_GD:
                                if (im->trueColor){
                                        gdImageTrueColorToPalette(im,1,256);
                                }
                                (*func_p)(im, fp);
                                break;
-#endif
                        default:
                                if (q == -1) {
                                        q = 128;
@@ -1644,14 +1633,12 @@
                                }
                                (*func_p)(im, q, tmp);
                                break;
-#if HAVE_LIBGD20
                        case PHP_GDIMG_TYPE_GD:
                                if (im->trueColor) {
                                        gdImageTrueColorToPalette(im,1,256);
                                }
                                (*func_p)(im, tmp);
                                break;
-#endif
                        default:
                                (*func_p)(im, tmp);
                                break;
@@ -1814,7 +1801,6 @@
        convert_to_long_ex(x);
        convert_to_long_ex(y);
 
-#if HAVE_LIBGD20
        if (gdImageTrueColor(im)) {
                if (im->tpixels && gdImageBoundsSafe(im, Z_LVAL_PP(x), 
Z_LVAL_PP(y))) {
                        RETURN_LONG(gdImageTrueColorPixel(im, Z_LVAL_PP(x), 
Z_LVAL_PP(y)));
@@ -1823,16 +1809,13 @@
                        RETURN_FALSE;
                }
        } else {
-#endif
                if (im->pixels && gdImageBoundsSafe(im, Z_LVAL_PP(x), 
Z_LVAL_PP(y))) {
                        RETURN_LONG(im->pixels[Z_LVAL_PP(y)][Z_LVAL_PP(x)]);
                } else {
                        php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%ld,%ld is 
out of bounds", Z_LVAL_PP(x), Z_LVAL_PP(y));
                        RETURN_FALSE;
                }
-#if HAVE_LIBGD20
        }
-#endif
 }
 /* }}} */
 
@@ -1894,12 +1877,10 @@
 
        ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd);
 
-#if HAVE_LIBGD20
        /* We can return right away for a truecolor image as deallocating 
colours is meaningless here */
        if (gdImageTrueColor(im)) {
                RETURN_TRUE;
        }
-#endif
 
        convert_to_long_ex(index);
        col = Z_LVAL_PP(index);
@@ -2003,7 +1984,7 @@
 
        convert_to_long_ex(index);
        col = Z_LVAL_PP(index);
-#if HAVE_LIBGD20
+       
        if ((col >= 0 && gdImageTrueColor(im)) || (!gdImageTrueColor(im) && col 
>= 0 && col < gdImageColorsTotal(im))) {
                array_init(return_value);
 
@@ -2011,17 +1992,7 @@
                add_assoc_long(return_value,"green", gdImageGreen(im,col));
                add_assoc_long(return_value,"blue", gdImageBlue(im,col));
                add_assoc_long(return_value,"alpha", gdImageAlpha(im,col));
-       }
-#else
-       if (col >= 0 && col < gdImageColorsTotal(im)) {
-               array_init(return_value);
-
-               add_assoc_long(return_value,"red",  im->red[col]);
-               add_assoc_long(return_value,"green", im->green[col]);
-               add_assoc_long(return_value,"blue", im->blue[col]);
-       }
-#endif
-       else {
+       } else {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Color index %d out 
of range", col);
                RETURN_FALSE;
        }
@@ -2049,7 +2020,6 @@
 
        ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd);
 
-#if HAVE_LIBGD20
        if (gdImageTrueColor(im))       {
                int x, y, c;
 
@@ -2067,7 +2037,6 @@
                }
                RETURN_TRUE;
        }
-#endif
        for (i = 0; i < gdImageColorsTotal(im); i++) {
                im->red[i]   = (int)((pow((pow((im->red[i]   / 255.0), input)), 
1.0 / output) * 255) + .5);
                im->green[i] = (int)((pow((pow((im->green[i] / 255.0), input)), 
1.0 / output) * 255) + .5);
@@ -2873,7 +2842,7 @@
 
 #ifdef ENABLE_GD_TTF
 
-#if HAVE_LIBGD20 && HAVE_LIBFREETYPE && HAVE_GD_STRINGFTEX
+#if HAVE_LIBFREETYPE && HAVE_GD_STRINGFTEX
 /* {{{ proto array imageftbbox(float size, float angle, string font_file, 
string text [, array extrainfo])
    Give the bounding box of a text using fonts via freetype2 */
 PHP_FUNCTION(imageftbbox)
@@ -3241,9 +3210,7 @@
        int *f_ind;
        int h_lines, v_lines, c_ind;
        int rd, gr, bl, fg_rd, fg_gr, fg_bl, bg_rd, bg_gr, bg_bl;
-#if HAVE_LIBGD20
        int fg_al, bg_al, al;
-#endif
        int aa[16];
        int amount_kern, add_width;
        double angle = 0.0, extend;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to