Re: cvs: php4 /ext/gd gd.c
| From: | (Marcus Börger) | Date: | Wed, 26 Jun 2002 06:41:29 +0000 |
| Subject: | Re: cvs: php4 /ext/gd gd.c | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-12521@lists.php.net to get a copy of this message | ||
At 01:12 26.06.2002, Jani Taskinen wrote:
On Wed, 26 Jun 2002, Marcus Börger wrote: The first part of the patch maps imageellipse to imagearc This is the more general way since we could have also mapped it to imagefilledarc with style gdNoFill (So Rasmus was correct on this). Since compiling it more than once i also fixed warnings with the calls to getmbi and skipheader. Both require additional header file wbmp.h that can be assumed being present if HAVE_GD_WBMP is defined. Additionally there is an inconsistency in gd files thatThat would leed to my first try: Adding a check for additional header in config.m4 and declaring the functions in gd.c if header is missing. I looked up my linux machine and found the header where it should be... So what about patch below? 1) It includes wbmp.h for bundled version 2) it checks for wbmp.h available and 3) it declares the missing functions. To Derick: This is needed if we want to be able to compile without warnings. marcus cvs -z3 -q diff ext\gd\config.m4 ext\gd\gd.c (in directory S:\php4\) Index: ext/gd/config.m4 =================================================================== RCS file: /repository/php4/ext/gd/config.m4,v retrieving revision 1.99 diff -u -r1.99 config.m4You know that saying about 'assume' ? :)wbmp.h is not installed with gd-1.8.4 or gd-2.0.1. Not if you don't copy it manually.--Jani
--- ext/gd/config.m4 25 Jun 2002 09:00:08 -0000 1.99 +++ ext/gd/config.m4 26 Jun 2002 01:01:49 -0000@@ -344,5 +344,7 @@ PHP_EXPAND_PATH($GD_INCLUDE, GD_INCLUDE) PHP_ADD_INCLUDE($GD_INCLUDE) + AC_CHECK_HEADERS(wbmp.h) + fi fi Index: ext/gd/gd.c =================================================================== RCS file: /repository/php4/ext/gd/gd.c,v retrieving revision 1.192 diff -u -r1.192 gd.c
--- ext/gd/gd.c 25 Jun 2002 22:23:41 -0000 1.192+++ ext/gd/gd.c 26 Jun 2002 01:01:50 -0000 @@ -61,7 +61,12 @@ #include <gdfontl.h> /* 4 Large font */ #include <gdfontg.h> /* 5 Giant font */ #ifdef HAVE_GD_WBMP +#if defined(HAVE_WBMP_H) | defined(HAVE_GD_BUNDLED) #include <wbmp.h> +#else
+int getmbi ( int (*getin)(void *in), void *in ); +int skipheader( int (*getin)(void *in), void *in );+#endif #endif #ifdef ENABLE_GD_TTF # include "gdttf.h"
requires typeconversion for the function pointer parameter of both getmbi and skipheader. marcus At 00:39 26.06.2002, Jani Taskinen wrote:--On Tue, 25 Jun 2002, Marcus Börger wrote:+/* $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> +#endifWhat's this?! Please check your commits with 'cvs diff' before actually committing..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 ) {Was this somehow related to this commit?--Jani-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php