cvs: php4 /ext/gd gd.c
| From: | Marcus B�rger | Date: | Tue, 25 Jun 2002 22:23:42 +0000 |
| Subject: | cvs: php4 /ext/gd gd.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-12516@lists.php.net to get a copy of this message | ||
helly Tue Jun 25 18:23:42 2002 EDT
Modified files:
/php4/ext/gd gd.c
Log:
map imageellipse to imagearc if missing
fix warnings
Index: php4/ext/gd/gd.c
diff -u php4/ext/gd/gd.c:1.191 php4/ext/gd/gd.c:1.192
--- php4/ext/gd/gd.c:1.191 Tue Jun 25 05:00:09 2002
+++ php4/ext/gd/gd.c Tue Jun 25 18:23:41 2002
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: gd.c,v 1.191 2002/06/25 09:00:09 helly Exp $ */
+/* $Id: gd.c,v 1.192 2002/06/25 22:23:41 helly Exp $ */
/* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -60,6 +60,9 @@
#include <gdfontmb.h> /* 3 Medium bold font */
#include <gdfontl.h> /* 4 Large font */
#include <gdfontg.h> /* 5 Giant font */
+#ifdef HAVE_GD_WBMP
+#include <wbmp.h>
+#endif
#ifdef ENABLE_GD_TTF
# include "gdttf.h"
#endif
@@ -104,6 +107,7 @@
*/
function_entry gd_functions[] = {
PHP_FE(imagearc, NULL)
+ PHP_FE(imageellipse, NULL)
PHP_FE(imagechar, NULL)
PHP_FE(imagecharup, NULL)
PHP_FE(imagecolorallocate, NULL)
@@ -142,10 +146,6 @@
PHP_FE(imagecopyresampled, NULL)
#endif
-#if HAVE_GD_IMAGEELLIPSE
- PHP_FE(imageellipse, NULL)
-#endif
-
#if HAVE_GD_IMAGESETTILE
PHP_FE(imagesettile, NULL)
#endif
@@ -648,7 +648,6 @@
}
/* }}} */
-#ifdef HAVE_GD_IMAGEELLIPSE /* this function is missing from GD 2.0.1 */
/* {{{ proto void imageellipse(resource im, int cx, int cy, int w, int h, int color)
Draw an ellipse */
PHP_FUNCTION(imageellipse)
@@ -668,12 +667,15 @@
convert_to_long_ex(h);
convert_to_long_ex(color);
+#ifdef HAVE_GD_IMAGEELLIPSE /* this function is missing from GD 2.0.1 */
gdImageEllipse(im, Z_LVAL_PP(cx), Z_LVAL_PP(cy), Z_LVAL_PP(w), Z_LVAL_PP(h), Z_LVAL_PP(color));
+#else
+ gdImageArc(im, Z_LVAL_PP(cx), Z_LVAL_PP(cy), Z_LVAL_PP(w), Z_LVAL_PP(h), 0, 360,
Z_LVAL_PP(color));
+#endif
RETURN_TRUE;
}
/* }}} */
-#endif
/* {{{ proto void imagefilledellipse(resource im, int cx, int cy, int w, int h, int color)
Draw an ellipse */
@@ -979,7 +981,7 @@
gdIOCtx *io_ctx;
io_ctx = gdNewDynamicCtx (8, data);
if (io_ctx) {
- if (getmbi(gdGetC, io_ctx) == 0 && skipheader(gdGetC, io_ctx) == 0 ) {
+ if (getmbi((int(*)(void*))gdGetC, io_ctx) == 0 && skipheader((int(*)(void*))gdGetC,
io_ctx) == 0 ) {
io_ctx->free(io_ctx);
return PHP_GDIMG_TYPE_WBM;
} else