[packages/php4] add bison, configure, missing includes and type fixes

atler atler at pld-linux.org
Tue Feb 4 15:36:22 CET 2025


commit 651d944459ba9ed5f561eabd92ca1957678874c2
Author: Jan Palus <atler at pld-linux.org>
Date:   Tue Feb 4 14:54:38 2025 +0100

    add bison, configure, missing includes and type fixes

 bison.patch     |  30 ++++
 configure.patch | 178 +++++++++++++++++++
 includes.patch  |  12 ++
 php4.spec       | 130 +++++++-------
 types.patch     | 531 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 820 insertions(+), 61 deletions(-)
---
diff --git a/php4.spec b/php4.spec
index 8537232..1a80ec3 100644
--- a/php4.spec
+++ b/php4.spec
@@ -154,6 +154,10 @@ Patch57:	%{name}-pcre.patch
 Patch58:	%{name}-apache24.patch
 Patch59:	php-bug-68486.patch
 Patch60:	%{name}-libx32.patch
+Patch61:	configure.patch
+Patch62:	bison.patch
+Patch63:	includes.patch
+Patch64:	types.patch
 URL:		http://www.php.net/
 %{?with_interbase:%{!?with_interbase_inst:BuildRequires:	Firebird-devel >= 1.0.2.908-2}}
 %{?with_pspell:BuildRequires:	aspell-devel >= 2:0.50.0}
@@ -1586,76 +1590,80 @@ Moduł PHP umożliwiający używanie kompresji zlib.
 
 %prep
 %setup -q -n php-%{version}
-#%patch43 -p1
-%patch40 -p1
-%patch0 -p1
-%patch1 -p1
-%patch2 -p1
-%patch3 -p1
-%patch4 -p1
-%patch5 -p1
-%patch6 -p1
-%patch7 -p1
-%patch8 -p1
+#%patch -P43 -p1
+%patch -P40 -p1
+%patch -P0 -p1
+%patch -P1 -p1
+%patch -P2 -p1
+%patch -P3 -p1
+%patch -P4 -p1
+%patch -P5 -p1
+%patch -P6 -p1
+%patch -P7 -p1
+%patch -P8 -p1
 # Not really needed?
-#%patch9 -p1
-%patch10 -p1
-%patch11 -p1
-%patch12 -p1
-%patch13 -p1
-%patch14 -p1
-%patch15 -p1
-%patch16 -p1
+#%patch -P9 -p1
+%patch -P10 -p1
+%patch -P11 -p1
+%patch -P12 -p1
+%patch -P13 -p1
+%patch -P14 -p1
+%patch -P15 -p1
+%patch -P16 -p1
 cp php.ini-dist php.ini
-%patch17 -p1
+%patch -P17 -p1
 # for ac2.53b/am1.6b - AC_LANG_CXX has AM_CONDITIONAL, so cannot be invoked
 # conditionally...
-%patch18 -p1
-%patch19 -p1
-%patch20 -p1
-%patch21 -p1
-%patch22 -p1
-
-%patch24 -p1
-%patch25 -p1
-%patch26 -p1
-%patch27 -p1
-%patch28 -p1
-%patch29 -p1
-%patch30 -p1
-%patch31 -p1
-%patch33 -p1
-%patch34 -p1
-%patch35 -p1
-%patch36 -p1
-%patch37 -p1
-%patch38 -p1
-%{?with_versioning:%patch39 -p1}
+%patch -P18 -p1
+%patch -P19 -p1
+%patch -P20 -p1
+%patch -P21 -p1
+%patch -P22 -p1
+
+%patch -P24 -p1
+%patch -P25 -p1
+%patch -P26 -p1
+%patch -P27 -p1
+%patch -P28 -p1
+%patch -P29 -p1
+%patch -P30 -p1
+%patch -P31 -p1
+%patch -P33 -p1
+%patch -P34 -p1
+%patch -P35 -p1
+%patch -P36 -p1
+%patch -P37 -p1
+%patch -P38 -p1
+%{?with_versioning:%patch -P39 -p1}
 # XXX: I believe this one is obsolete as of 4.4.3
-#%patch41 -p1
-%patch41 -p1
-%patch42 -p1
-%patch43 -p1
-%patch45 -p1
-%patch46 -p1
-%patch47 -p1
-%patch48 -p1
-%patch49 -p1
-%patch50 -p1
-%patch51 -p1
+#%patch -P41 -p1
+%patch -P41 -p1
+%patch -P42 -p1
+%patch -P43 -p1
+%patch -P45 -p1
+%patch -P46 -p1
+%patch -P47 -p1
+%patch -P48 -p1
+%patch -P49 -p1
+%patch -P50 -p1
+%patch -P51 -p1
 %if "%{_lib}" == "lib64"
-%patch52 -p1
+%patch -P52 -p1
 %endif
-%patch53 -p1
-%patch54 -p1
-%patch55 -p1
-%patch56 -p1
-%patch57 -p1
-%patch58 -p1
-%patch59 -p1
+%patch -P53 -p1
+%patch -P54 -p1
+%patch -P55 -p1
+%patch -P56 -p1
+%patch -P57 -p1
+%patch -P58 -p1
+%patch -P59 -p1
 %if "%{_lib}" == "libx32"
-%patch60 -p1
+%patch -P60 -p1
 %endif
+%patch -P61 -p1
+%patch -P62 -p1
+%patch -P63 -p1
+%patch -P64 -p1
 
 %if %{with hardening}
 zcat %{SOURCE8} | patch -p1
diff --git a/bison.patch b/bison.patch
new file mode 100644
index 0000000..6eee0e6
--- /dev/null
+++ b/bison.patch
@@ -0,0 +1,30 @@
+--- php-4.4.9/ext/standard/parsedate.y.orig	2005-05-20 13:13:14.000000000 +0200
++++ php-4.4.9/ext/standard/parsedate.y	2025-02-03 23:20:33.425601095 +0100
+@@ -143,13 +143,15 @@
+     enum _MERIDIAN	Meridian;
+ } date_ll;
+ 
+-#define YYPARSE_PARAM parm
+-#define YYLEX_PARAM parm
+ #define YYSTYPE date_ll
+-#define YYLTYPE void
++
++int yylex (YYSTYPE *lvalp, void *parm);
+ 
+ %}
+ 
++%parse-param {YYSTYPE* parm}
++%lex-param {void* parm}
++
+ /* This grammar has 40 shift/reduce conflicts. */
+ %expect 40
+ %pure_parser
+@@ -860,7 +862,7 @@
+   return tID;
+ }
+ 
+-yylex (YYSTYPE *lvalp, void *parm)
++int yylex (YYSTYPE *lvalp, void *parm)
+ {
+   register unsigned char c;
+   register char *p;
diff --git a/configure.patch b/configure.patch
new file mode 100644
index 0000000..6a55056
--- /dev/null
+++ b/configure.patch
@@ -0,0 +1,178 @@
+--- php-7.2.34/acinclude.m4.orig	2025-01-23 20:45:18.432571977 +0100
++++ php-7.2.34/acinclude.m4	2025-01-23 20:54:20.252520613 +0100
+@@ -1349,12 +1349,13 @@
+ #define _REENTRANT
+ #include <sys/types.h>
+ #include <dirent.h>
++#include <stdlib.h>
+ 
+ #ifndef PATH_MAX
+ #define PATH_MAX 1024
+ #endif
+ 
+-main() {
++int main() {
+ 	DIR *dir;
+ 	char entry[sizeof(struct dirent)+PATH_MAX];
+ 	struct dirent *pentry = (struct dirent *) &entry;
+--- php-7.2.34/acinclude.m4.orig	2025-01-24 18:36:21.516873084 +0100
++++ php-7.2.34/acinclude.m4	2025-01-24 20:22:44.293766361 +0100
+@@ -339,8 +340,9 @@
+ #include <fcntl.h>
+ #include <unistd.h>
+ #include <errno.h>
++#include <stdlib.h>
+ $1
+-    main() {
++    int main() {
+     int fd = open("conftest_in", O_WRONLY|O_CREAT, 0600);
+ 
+     if (fd < 0) exit(1);
+@@ -367,8 +369,9 @@
+ #include <fcntl.h>
+ #include <unistd.h>
+ #include <errno.h>
++#include <stdlib.h>
+ $1
+-    main() {
++    int main() {
+     char buf[3]; 
+     int fd = open("conftest_in", O_RDONLY);
+     if (fd < 0) exit(1);
+@@ -1157,7 +1157,7 @@
+ AC_TRY_RUN([
+ #include <time.h>
+ 
+-main() {
++int main() {
+ char buf[27];
+ struct tm t;
+ time_t old = 0;
+@@ -1474,7 +1476,10 @@
+ dnl
+ AC_DEFUN([PHP_AC_BROKEN_SPRINTF],[
+   AC_CACHE_CHECK(whether sprintf is broken, ac_cv_broken_sprintf,[
+-    AC_TRY_RUN([main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[
++    AC_TRY_RUN([
++#include <stdio.h>
++#include <stdlib.h>
++int main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[
+       ac_cv_broken_sprintf=no
+     ],[
+       ac_cv_broken_sprintf=yes
+@@ -1698,6 +1703,8 @@
+   AC_CACHE_VAL(have_broken_glibc_fopen_append,[
+   AC_TRY_RUN([
+ #include <stdio.h>
++#include <stdlib.h>
++#include <unistd.h>
+ int main(int argc, char *argv[])
+ {
+   FILE *fp;
+@@ -1765,6 +1772,7 @@
+ 		AC_TRY_RUN([
+ #define _GNU_SOURCE
+ #include <stdio.h>
++#include <stdlib.h>
+ 
+ struct cookiedata {
+ 	__off64_t pos;
+@@ -1781,7 +1789,7 @@
+ 
+ cookie_io_functions_t funcs = {reader, writer, seeker, closer};
+ 
+-main() {
++int main() {
+   struct cookiedata g = { 0 };
+   FILE *fp = fopencookie(&g, "r", funcs);
+ 
+@@ -1898,7 +1906,7 @@
+   if test "$found" = "yes"; then
+     ac_libs=$LIBS
+     LIBS="$LIBS -l$2"
+-    AC_TRY_RUN([main() { return (0); }],[found=yes],[found=no],[found=no])
++    AC_TRY_RUN([int main() { return (0); }],[found=yes],[found=no],[found=no])
+     LIBS=$ac_libs
+   fi
+ 
+--- php-7.2.34/configure.in.orig	2025-01-24 18:36:21.610206957 +0100
++++ php-7.2.34/configure.in	2025-01-24 19:52:10.669915792 +0100
+@@ -697,6 +697,8 @@
+ #ifndef AF_INET
+ # include <sys/socket.h>
+ #endif
++#include <string.h>
++#include <stdlib.h>
+ int main(void) {
+   struct addrinfo *ai, *pai, hints;
+ 
+#if HAVE_CRYPT
+--- php-5.5.38/ext/standard/config.m4.orig	2016-07-20 10:41:48.000000000 +0200
++++ php-5.5.38/ext/standard/config.m4	2025-01-29 22:44:40.021689011 +0100
+@@ -7,6 +7,8 @@
+   AC_TRY_RUN( [
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <string.h>
++#include <unistd.h>
+ 
+ int main(int argc, char **argv)
+ {
+@@ -68,7 +70,10 @@
+ #if HAVE_CRYPT_H
+ #include <crypt.h>
+ #endif
++#include <stdlib.h>
++#include <string.h>
+ 
++int
+ main() {
+ #if HAVE_CRYPT
+     exit (strcmp((char *)crypt("rasmuslerdorf","rl"),"rl.3StKT.4T8M"));
+@@ -92,7 +97,10 @@
+ #if HAVE_CRYPT_H
+ #include <crypt.h>
+ #endif
++#include <stdlib.h>
++#include <string.h>
+ 
++int
+ main() {
+ #if HAVE_CRYPT
+     exit (strcmp((char *)crypt("rasmuslerdorf","_J9..rasm"),"_J9..rasmBYk8r9AiWNc"));
+@@ -116,7 +124,10 @@
+ #if HAVE_CRYPT_H
+ #include <crypt.h>
+ #endif
++#include <stdlib.h>
++#include <string.h>
+ 
++int
+ main() {
+ #if HAVE_CRYPT
+     char salt[15], answer[40];
+@@ -149,7 +160,10 @@
+ #if HAVE_CRYPT_H
+ #include <crypt.h>
+ #endif
++#include <stdlib.h>
++#include <string.h>
+ 
++int
+ main() {
+ #if HAVE_CRYPT
+     char salt[30], answer[70];
+--- php-7.2.34/Zend/acinclude.m4.orig	2020-09-30 07:15:55.000000000 +0200
++++ php-7.2.34/Zend/acinclude.m4	2025-01-24 20:51:32.443588605 +0100
+@@ -67,7 +67,10 @@
+ dnl
+ AC_DEFUN([AC_ZEND_BROKEN_SPRINTF],[
+   AC_CACHE_CHECK(whether sprintf is broken, ac_cv_broken_sprintf,[
+-    AC_TRY_RUN([main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[
++    AC_TRY_RUN([
++#include <stdio.h>
++#include <stdlib.h>
++int main() {char buf[20];exit(sprintf(buf,"testing 123")!=11); }],[
+       ac_cv_broken_sprintf=no
+     ],[
+       ac_cv_broken_sprintf=yes
diff --git a/includes.patch b/includes.patch
new file mode 100644
index 0000000..1d66467
--- /dev/null
+++ b/includes.patch
@@ -0,0 +1,12 @@
+--- php-4.4.9/ext/gd/gd.c.orig	2025-02-03 23:32:50.103037199 +0100
++++ php-4.4.9/ext/gd/gd.c	2025-02-03 23:34:13.180166546 +0100
+@@ -73,6 +73,9 @@
+ #include <gdfontmb.h> /* 3 Medium bold font */
+ #include <gdfontl.h>  /* 4 Large font */
+ #include <gdfontg.h>  /* 5 Giant font */
++
++#include "gdhelpers.h"
++
+ #if HAVE_GD_BUNDLED
+ #ifdef HAVE_GD_WBMP
+ #include "libgd/wbmp.h"
diff --git a/types.patch b/types.patch
new file mode 100644
index 0000000..88e50a6
--- /dev/null
+++ b/types.patch
@@ -0,0 +1,531 @@
+--- php-4.4.9/ext/hyperwave/hg_comm.c.orig	2007-12-31 08:22:47.000000000 +0100
++++ php-4.4.9/ext/hyperwave/hg_comm.c	2025-02-03 23:39:05.551797387 +0100
+@@ -654,7 +654,7 @@
+ 		scriptname = emalloc(5*sizeof(char *));
+ 		if (zend_hash_find(&EG(symbol_table), "SCRIPT_NAME", sizeof("SCRIPT_NAME"), (void **) &script_name)==FAILURE)
+ 			for(i=0; i<5; i++)
+-				scriptname[i] = &emptystring;
++				scriptname[i] = emptystring;
+ 		else {
+ 			convert_to_string_ex(script_name);
+ 			for(i=0; i<5; i++)
+--- php-4.4.9/ext/mnogosearch/php_mnogo.c.orig	2025-02-03 15:39:29.567737815 +0100
++++ php-4.4.9/ext/mnogosearch/php_mnogo.c	2025-02-03 23:43:55.133417888 +0100
+@@ -902,7 +902,7 @@
+ 				php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s",Agent->Conf->errstr);
+ 				RETURN_FALSE;
+ #if UDM_VERSION_ID >= 30300
+-			} else UdmSynonymListSort(&(Agent->Conf->Synonym));
++			} else UdmSynonymListListSortItems(&(Agent->Conf->Synonym));
+ #else
+ #if UDM_VERSION_ID >= 30204
+ 			} else UdmSynonymListSort(&(Agent->Conf->Synonyms));
+@@ -1824,7 +1824,7 @@
+ 			php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s",Agent->Conf->errstr);
+ 			RETURN_FALSE;
+ #if UDM_VERSION_ID >= 30300
+-		} else UdmSynonymListSort(&(Agent->Conf->Synonym));
++		} else UdmSynonymListListSortItems(&(Agent->Conf->Synonym));
+ #else
+ 		} else UdmSynonymListSort(&(Agent->Conf->Synonyms));
+ #endif
+--- php-4.4.9/ext/qtdom/qtdom.c.orig	2007-12-31 08:22:51.000000000 +0100
++++ php-4.4.9/ext/qtdom/qtdom.c	2025-02-03 23:46:23.417581021 +0100
+@@ -26,6 +26,7 @@
+ #include "php_ini.h"
+ #include "qtdom.h"
+ #include "qtdom_qt.h"
++#include "ext/standard/info.h"
+ 
+ #if HAVE_QTDOM
+ 
+--- php-4.4.9/ext/readline/readline.c.orig	2007-12-31 08:22:51.000000000 +0100
++++ php-4.4.9/ext/readline/readline.c	2025-02-03 23:59:45.845414718 +0100
+@@ -336,7 +336,7 @@
+ /* {{{ proto void readline_completion_function(string funcname) 
+    Readline completion function? */
+ 
+-static char *_readline_command_generator(char *text,int state)
++static char *_readline_command_generator(const char *text,int state)
+ {
+ 	HashTable  *myht = Z_ARRVAL(_readline_array);
+ 	zval **entry;
+@@ -379,7 +379,7 @@
+ 	return ret;
+ }
+ 
+-static char **_readline_completion_cb(char *text, int start, int end)
++static char **_readline_completion_cb(const char *text, int start, int end)
+ { 
+ 	zval *params[4];
+ 	int i;
+@@ -394,7 +394,7 @@
+ 	if (call_user_function(CG(function_table), NULL, params[0], &_readline_array, 3, params+1 TSRMLS_CC) == SUCCESS) {
+ 		if (Z_TYPE(_readline_array) == IS_ARRAY) {
+ 			if (zend_hash_num_elements(Z_ARRVAL(_readline_array))) {
+-				matches = completion_matches(text,_readline_command_generator);
++				matches = rl_completion_matches(text,_readline_command_generator);
+ 			} else {
+ 				matches = malloc(sizeof(char *) * 2);
+ 				matches[0] = strdup("");
+--- php-4.4.9/ext/sysvmsg/sysvmsg.c.orig	2007-12-31 08:22:53.000000000 +0100
++++ php-4.4.9/ext/sysvmsg/sysvmsg.c	2025-02-04 00:02:29.046333400 +0100
+@@ -320,7 +320,7 @@
+ 
+ 			MAKE_STD_ZVAL(tmp);
+ 			PHP_VAR_UNSERIALIZE_INIT(var_hash);
+-			if (!php_var_unserialize(&tmp, &p, p + result, &var_hash TSRMLS_CC)) {
++			if (!php_var_unserialize(&tmp, (const unsigned char **)&p, p + result, &var_hash TSRMLS_CC)) {
+ 				zend_error(E_WARNING, "%s(): message corrupted", get_active_function_name(TSRMLS_C));
+ 				RETVAL_FALSE;
+ 			} else {
+--- php-4.4.9/ext/xmlrpc/libxmlrpc/encodings.c.orig	2004-03-08 19:52:40.000000000 +0100
++++ php-4.4.9/ext/xmlrpc/libxmlrpc/encodings.c	2025-02-04 00:05:27.930673700 +0100
+@@ -61,7 +61,7 @@
+       size_t inlenleft = src_len;
+       int outlen = src_len;
+       iconv_t ic = iconv_open(to_enc, from_enc);
+-      char const *src_ptr = src;
++      char *src_ptr = src;
+       char* out_ptr = 0;
+ 
+       if(ic != (iconv_t)-1) {
+--- php-4.4.9/ext/interbase/interbase.c.orig	2007-12-31 08:22:48.000000000 +0100
++++ php-4.4.9/ext/interbase/interbase.c	2025-02-04 12:45:49.839809259 +0100
+@@ -331,20 +331,20 @@
+ 	int i;
+ 
+ 	IBDEBUG("Checking transactions to close...");
+-	if (link->trans[0] != NULL) { /* commit default */
++	if (link->trans[0] != (isc_tr_handle) NULL) { /* commit default */
+ 		IBDEBUG("Committing default transaction...");
+ 		if (isc_commit_transaction(IB_STATUS, &link->trans[0])) {
+ 			_php_ibase_error(TSRMLS_C);
+ 		}
+-		link->trans[0] = NULL;
++		link->trans[0] = (isc_tr_handle) NULL;
+ 	}
+ 	for (i = 1; i < IBASE_TRANS_ON_LINK; i++) {
+-		if (link->trans[i] != NULL) {
++		if (link->trans[i] != (isc_tr_handle) NULL) {
+ 			IBDEBUG("Rolling back other transactions...");
+ 			if (isc_rollback_transaction(IB_STATUS, &link->trans[i])) {
+ 				_php_ibase_error(TSRMLS_C);
+ 			}
+-			link->trans[i] = NULL;
++			link->trans[i] = (isc_tr_handle) NULL;
+ 		}
+ 	}
+ }
+@@ -479,7 +479,7 @@
+ {
+ 	ibase_blob_handle *ib_blob = (ibase_blob_handle *)rsrc->ptr;
+ 
+-	if (ib_blob->bl_handle != NULL) { /* blob open*/
++	if (ib_blob->bl_handle != (isc_blob_handle) NULL) { /* blob open*/
+ 		if (isc_cancel_blob(IB_STATUS, &ib_blob->bl_handle)) {
+ 			php_error_docref(NULL TSRMLS_CC, E_ERROR, "You can lose data. Close any blob after reading of writing it. Use ibase_blob_close() before calling ibase_close()");
+ 		}
+@@ -501,12 +501,12 @@
+ 		ib_link = (ibase_db_link *) zend_fetch_resource(NULL TSRMLS_CC, ib_trans->link_rsrc, "InterBase link", NULL, 2, le_link, le_plink);
+ 	
+ 		if (ib_link) {
+-			if (ib_link->trans[ib_trans->trans_num] != NULL) {
++			if (ib_link->trans[ib_trans->trans_num] != (isc_tr_handle) NULL) {
+ 				IBDEBUG("Rolling back unhandled transaction...");
+ 				if (isc_rollback_transaction(IB_STATUS, &ib_link->trans[ib_trans->trans_num])) {
+ 					_php_ibase_error(TSRMLS_C);
+ 				}
+-				ib_link->trans[ib_trans->trans_num] = NULL;
++				ib_link->trans[ib_trans->trans_num] = (isc_tr_handle) NULL;
+ 			}
+ 		}
+ 	}	
+@@ -739,7 +739,7 @@
+ 	zval ***args;
+ 	char *ib_server = NULL, *ib_uname, *ib_passwd, *ib_charset = NULL, *ib_buffers = NULL, *ib_dialect = NULL, *ib_role = NULL;
+ 	int i, ib_uname_len, ib_passwd_len;
+-	isc_db_handle db_handle = NULL;
++	isc_db_handle db_handle = (isc_db_handle) NULL;
+ 	char *hashed_details;
+ 	int hashed_details_length = 0;
+ 	ibase_db_link *ib_link = NULL;
+@@ -850,7 +850,7 @@
+ 			ib_link->dialect = (ib_dialect ? (unsigned short) strtoul(ib_dialect, NULL, 10) : SQL_DIALECT_CURRENT);
+ 
+ 			for (i = 0; i < IBASE_TRANS_ON_LINK; i++) {
+-				ib_link->trans[i] = NULL;
++				ib_link->trans[i] = (isc_tr_handle) NULL;
+ 			}
+ 						
+ 			/* hash it up */
+@@ -913,7 +913,7 @@
+ 		ib_link->dialect = (ib_dialect ? (unsigned short) strtoul(ib_dialect, NULL, 10) : SQL_DIALECT_CURRENT);
+ 
+ 		for (i = 0; i < IBASE_TRANS_ON_LINK; i++) {
+-			ib_link->trans[i] = NULL;
++			ib_link->trans[i] = (isc_tr_handle) NULL;
+ 		}
+ 		
+ 		ZEND_REGISTER_RESOURCE(return_value, ib_link, le_link);
+@@ -1082,7 +1082,7 @@
+ 	IB_QUERY = emalloc(sizeof(ibase_query));
+ 	IB_QUERY->link = link;
+ 	IB_QUERY->trans = trans;
+-	IB_QUERY->stmt = NULL;
++	IB_QUERY->stmt = (isc_stmt_handle) NULL;
+ 	IB_QUERY->out_sqlda = NULL;
+ 	IB_QUERY->in_sqlda = NULL;
+ 	IB_QUERY->in_array = NULL;
+@@ -1322,7 +1322,7 @@
+ 							ib_blob = (ibase_blob_handle *) emalloc(sizeof(ibase_blob_handle));
+ 							ib_blob->trans_handle = ib_query->trans;
+ 							ib_blob->link = ib_query->link;
+-							ib_blob->bl_handle = NULL;
++							ib_blob->bl_handle = (isc_blob_handle) NULL;
+ 							if (isc_create_blob(IB_STATUS, &ib_blob->link, &ib_blob->trans_handle, &ib_blob->bl_handle, &ib_blob->bl_qd)) {
+ 								efree(ib_blob);
+ 								_php_ibase_error(TSRMLS_C);
+@@ -1610,7 +1610,7 @@
+ 		return FAILURE;
+ 	}
+ 
+-	if (trans_n == 0 && ib_link->trans[0] == NULL) { 
++	if (trans_n == 0 && ib_link->trans[0] == (isc_tr_handle) NULL) { 
+ 		if (isc_start_transaction(IB_STATUS, &ib_link->trans[0], 1, &ib_link->link, 0, NULL)) {
+ 			_php_ibase_error(TSRMLS_C);
+ 			return FAILURE;
+@@ -1652,7 +1652,7 @@
+ 		RETURN_FALSE;
+ 	}
+ 
+-	if (ib_link->trans[trans_n] == NULL) {
++	if (ib_link->trans[trans_n] == (isc_tr_handle) NULL) {
+ 		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Trying to commit or rollback an already handled transaction");
+ 		RETURN_FALSE;
+ 	}
+@@ -1668,7 +1668,7 @@
+ 			RETURN_FALSE;
+ 		}
+ 	}
+-	ib_link->trans[trans_n] = NULL;
++	ib_link->trans[trans_n] = (isc_tr_handle) NULL;
+ 
+ 	/* Don't try to destroy imnplicitly opened transaction from list... */
+ 	if (trans_id) {
+@@ -1766,7 +1766,7 @@
+ 	
+ 	if (ib_result) { /* select statement */
+ 		ib_result->drop_stmt = 1; /* drop stmt when free result */
+-		ib_query->stmt = NULL; /* keep stmt when free query */
++		ib_query->stmt = (isc_stmt_handle) NULL; /* keep stmt when free query */
+ 		_php_ibase_free_query(ib_query TSRMLS_CC);
+ 		ZEND_REGISTER_RESOURCE(return_value, ib_result, le_result);
+ 	} else {
+@@ -2102,7 +2102,7 @@
+ 						char bl_info[20];
+ 						unsigned short i;
+ 
+-						blob_handle.bl_handle = NULL;
++						blob_handle.bl_handle = (isc_blob_handle) NULL;
+ 						blob_handle.bl_qd = *(ISC_QUAD ISC_FAR *) var->sqldata;
+ 			
+ 						if (isc_open_blob(IB_STATUS, &ib_result->link, &ib_result->trans, &blob_handle.bl_handle, &blob_handle.bl_qd)) {
+@@ -2640,7 +2640,7 @@
+ 	ib_blob = (ibase_blob_handle *) emalloc(sizeof(ibase_blob_handle));
+ 	ib_blob->trans_handle = ib_link->trans[trans_n];
+ 	ib_blob->link = ib_link->link;
+-	ib_blob->bl_handle = NULL;
++	ib_blob->bl_handle = (isc_blob_handle) NULL;
+ 	
+ 	if (isc_create_blob(IB_STATUS, &ib_blob->link, &ib_blob->trans_handle, &ib_blob->bl_handle, &ib_blob->bl_qd)) {
+ 		efree(ib_blob);
+@@ -2677,7 +2677,7 @@
+ 	ib_blob->trans_handle = ib_blob_id->trans_handle;
+ 	ib_blob->bl_qd.gds_quad_high = ib_blob_id->bl_qd.gds_quad_high;
+ 	ib_blob->bl_qd.gds_quad_low = ib_blob_id->bl_qd.gds_quad_low;
+-	ib_blob->bl_handle = NULL;
++	ib_blob->bl_handle = (isc_blob_handle) NULL;
+ 	if (isc_open_blob(IB_STATUS, &ib_blob->link, &ib_blob->trans_handle, &ib_blob->bl_handle, &ib_blob->bl_qd)) {
+ 		efree(ib_blob);
+ 		_php_ibase_error(TSRMLS_C);
+@@ -2756,7 +2756,7 @@
+ 				RETURN_FALSE;
+ 			}
+ 		}
+-		ib_blob->bl_handle = NULL;
++		ib_blob->bl_handle = (isc_blob_handle) NULL;
+ 		RETVAL_STRINGL((char *) ib_blob, sizeof(ibase_blob_handle), 1);
+ 		zend_list_delete(Z_LVAL_PP(blob_arg));
+ 	} else { /* discard created blob */
+@@ -2764,7 +2764,7 @@
+ 			_php_ibase_error(TSRMLS_C);
+ 			RETURN_FALSE;
+ 		}
+-		ib_blob->bl_handle = NULL;
++		ib_blob->bl_handle = (isc_blob_handle) NULL;
+ 		zend_list_delete(Z_LVAL_PP(blob_arg));
+ 		RETURN_TRUE;
+ 	}
+@@ -2818,7 +2818,7 @@
+ 			_php_ibase_error(TSRMLS_C);
+ 			RETURN_FALSE;
+ 		}
+-		ib_blob_id->bl_handle = NULL;
++		ib_blob_id->bl_handle = (isc_blob_handle) NULL;
+ 	} else { /* null blob, all values to zero */
+ 		bl_info.max_segment = 0;
+ 		bl_info.num_segments = 0;
+@@ -2891,7 +2891,7 @@
+ 			_php_ibase_error(TSRMLS_C);
+ 			RETURN_FALSE;
+ 		}
+-		ib_blob_id->bl_handle = NULL;
++		ib_blob_id->bl_handle = (isc_blob_handle) NULL;
+ 	} /* not null ? */
+ 
+ 	RETURN_TRUE;
+@@ -2940,7 +2940,7 @@
+ 	
+ 	ib_blob.link = ib_link->link;
+ 	ib_blob.trans_handle = ib_link->trans[trans_n];
+-	ib_blob.bl_handle = NULL;
++	ib_blob.bl_handle = (isc_blob_handle) NULL;
+ 	ib_blob.bl_qd.gds_quad_high = 0;
+ 	ib_blob.bl_qd.gds_quad_low = 0;
+ 	
+@@ -2964,7 +2964,7 @@
+ 		RETURN_FALSE;
+ 	}
+ 
+-	ib_blob.bl_handle = NULL;
++	ib_blob.bl_handle = (isc_blob_handle) NULL;
+ 	RETVAL_STRINGL((char *) &ib_blob, sizeof(ibase_blob_handle), 1);
+ }
+ /* }}} */
+@@ -2979,7 +2979,7 @@
+ 	char service_name_buffer[128], *service_name = service_name_buffer;
+ 	char spb_buffer[128], *spb = spb_buffer;
+ 	unsigned short spb_length;
+-	isc_svc_handle service_handle = NULL;
++	isc_svc_handle service_handle = (isc_svc_handle) NULL;
+ 	
+ 	RESET_ERRMSG;
+ 
+--- php-4.4.9/ext/odbc/php_odbc.c.orig	2007-12-31 08:22:50.000000000 +0100
++++ php-4.4.9/ext/odbc/php_odbc.c	2025-02-04 14:08:32.236987149 +0100
+@@ -634,7 +634,8 @@
+ 	RETCODE rc;
+ 	int i;
+ 	SWORD       colnamelen; /* Not used */
+-	SDWORD      displaysize;
++	SQLLEN      displaysize;
++	SQLLEN      value;
+ 
+ 	result->values = (odbc_result_value *) emalloc(sizeof(odbc_result_value)*result->numcols);
+ 
+@@ -645,7 +646,8 @@
+ 		rc = SQLColAttributes(result->stmt, (UWORD)(i+1), SQL_COLUMN_NAME, 
+ 				result->values[i].name, sizeof(result->values[i].name), &colnamelen, 0);
+ 		rc = SQLColAttributes(result->stmt, (UWORD)(i+1), SQL_COLUMN_TYPE, 
+-				NULL, 0, NULL, &result->values[i].coltype);
++				NULL, 0, NULL, &value);
++		result->values[i].coltype = value;
+ 		
+ 		/* Don't bind LONG / BINARY columns, so that fetch behaviour can
+ 		 * be controlled by odbc_binmode() / odbc_longreadlen()
+@@ -673,7 +675,8 @@
+ 								result->longreadlen;
+ 				result->values[i].value = (char *)emalloc(displaysize + 1);
+ 				rc = SQLBindCol(result->stmt, (UWORD)(i+1), SQL_C_CHAR, result->values[i].value,
+-							displaysize + 1, &result->values[i].vallen);
++							displaysize + 1, &value);
++				result->values[i].vallen = value;
+ 				break;
+ 		}
+ 	}
+@@ -728,7 +731,7 @@
+ 	 */
+ 	SDWORD len;
+ #else
+-	SQLINTEGER len;
++	SQLLEN len;
+ #endif
+ 	pval **pv_res, **pv_num;
+ 
+@@ -933,7 +936,8 @@
+ 	unsigned char otype;
+    	SWORD sqltype, ctype, scale;
+ 	SWORD nullable;
+-	UDWORD precision;
++	SQLULEN precision;
++	SQLLEN value;
+    	odbc_result   *result;
+ 	int numArgs, i, ne;
+ 	RETCODE rc;
+@@ -1040,7 +1044,8 @@
+ 				rc = SQLBindParameter(result->stmt, (UWORD)i, SQL_PARAM_INPUT,
+ 									  ctype, sqltype, precision, scale,
+ 									  (void *)params[i-1].fp, 0,
+-									  &params[i-1].vallen);
++									  &value);
++				params[i-1].vallen = value;
+ 			} else {
+ #ifdef HAVE_DBMAKER
+ 				precision = params[i-1].vallen;
+@@ -1052,7 +1057,8 @@
+ 				rc = SQLBindParameter(result->stmt, (UWORD)i, SQL_PARAM_INPUT,
+ 									  ctype, sqltype, precision, scale,
+ 									  Z_STRVAL_PP(tmp), 0,
+-									  &params[i-1].vallen);
++									  &value);
++				params[i-1].vallen = value;
+ 			}
+ 			zend_hash_move_forward(Z_ARRVAL_PP(pv_param_arr));
+ 		}
+@@ -1347,9 +1353,10 @@
+ 	odbc_result *result;
+ 	RETCODE rc;
+ 	SWORD sql_c_type;
++	SQLLEN value;
+ 	char *buf = NULL;
+ #ifdef HAVE_SQL_EXTENDED_FETCH
+-	UDWORD crow;
++	SQLULEN crow;
+ 	UWORD  RowStatus[1];
+ 	SDWORD rownum = -1;
+ 	pval **pv_res, **pv_row, *tmp;
+@@ -1431,7 +1438,8 @@
+ 				}
+ 				if (buf == NULL) buf = emalloc(result->longreadlen + 1);
+ 				rc = SQLGetData(result->stmt, (UWORD)(i + 1), sql_c_type,
+-						buf, result->longreadlen + 1, &result->values[i].vallen);
++						buf, result->longreadlen + 1, &value);
++				result->values[i].vallen = value;
+ 
+ 				if (rc == SQL_ERROR) {
+ 					odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData");
+@@ -1505,11 +1513,12 @@
+ 	odbc_result *result;
+ 	RETCODE rc;
+ 	SWORD sql_c_type;
++	SQLLEN value;
+ 	char *buf = NULL;
+ 	pval **pv_res, **pv_res_arr, *tmp;
+ #ifdef HAVE_SQL_EXTENDED_FETCH
+ 	pval **pv_row;
+-	UDWORD crow;
++	SQLULEN crow;
+ 	UWORD  RowStatus[1];
+ 	SDWORD rownum = -1;
+ #endif /* HAVE_SQL_EXTENDED_FETCH */
+@@ -1591,7 +1600,8 @@
+ 
+ 				if (buf == NULL) buf = emalloc(result->longreadlen + 1);
+ 				rc = SQLGetData(result->stmt, (UWORD)(i + 1),sql_c_type,
+-								buf, result->longreadlen + 1, &result->values[i].vallen);
++								buf, result->longreadlen + 1, &value);
++				result->values[i].vallen = value;
+ 
+ 					if (rc == SQL_ERROR) {
+ 					odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData");
+@@ -1666,7 +1676,7 @@
+ 	RETCODE rc;
+ 	pval **pv_res, **pv_row;
+ #ifdef HAVE_SQL_EXTENDED_FETCH
+-	UDWORD crow;
++	SQLULEN crow;
+ 	UWORD RowStatus[1];
+ #endif
+ 
+@@ -1727,10 +1737,11 @@
+ 	odbc_result *result;
+ 	int i = 0;
+ 	RETCODE rc;
+-	SDWORD	fieldsize;
++	SQLLEN	fieldsize;
++	SQLLEN	value;
+ 	pval **pv_res, **pv_field;
+ #ifdef HAVE_SQL_EXTENDED_FETCH
+-	UDWORD crow;
++	SQLULEN crow;
+ 	UWORD RowStatus[1];
+ #endif
+ 
+@@ -1822,7 +1833,8 @@
+ 		 * For binary data it is truncated to fieldsize bytes. 
+ 		 */
+ 			rc = SQLGetData(result->stmt, (UWORD)(field_ind + 1), sql_c_type,
+-							field, fieldsize, &result->values[field_ind].vallen);
++							field, fieldsize, &value);
++			result->values[field_ind].vallen = value;
+ 
+ 			if (rc == SQL_ERROR) {
+ 				odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData");
+@@ -1865,7 +1877,8 @@
+ 	/* Call SQLGetData() until SQL_SUCCESS is returned */
+ 	while(1) {
+ 		rc = SQLGetData(result->stmt, (UWORD)(field_ind + 1),sql_c_type,
+-							field, fieldsize, &result->values[field_ind].vallen);
++							field, fieldsize, &value);
++		result->values[field_ind].vallen = value;
+ 
+ 		if (rc == SQL_ERROR) {
+ 			odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData");
+@@ -1900,8 +1913,9 @@
+ 	RETCODE rc;
+ 	pval **pv_res, **pv_format;
+ 	SWORD sql_c_type;
++	SQLLEN value;
+ #ifdef HAVE_SQL_EXTENDED_FETCH
+-	UDWORD crow;
++	SQLULEN crow;
+ 	UWORD RowStatus[1];
+ #endif
+ 
+@@ -1969,7 +1983,8 @@
+ 					if (buf == NULL) buf = emalloc(result->longreadlen);
+ 
+ 					rc = SQLGetData(result->stmt, (UWORD)(i + 1),sql_c_type,
+-								buf, result->longreadlen, &result->values[i].vallen);
++								buf, result->longreadlen, &value);
++					result->values[i].vallen = value;
+  
+ 					php_printf("<td>");
+ 
+@@ -2385,7 +2400,7 @@
+ PHP_FUNCTION(odbc_num_rows)
+ {
+ 	odbc_result *result;
+-	SDWORD rows;
++	SQLLEN rows;
+ 	pval **pv_res;
+ 	
+ 	if (zend_get_parameters_ex(1, &pv_res) == FAILURE) {
+--- php-4.4.9/ext/pgsql/pgsql.c.orig	2007-12-31 08:22:50.000000000 +0100
++++ php-4.4.9/ext/pgsql/pgsql.c	2025-02-04 14:36:18.019954669 +0100
+@@ -302,11 +302,13 @@
+ static void _php_pgsql_notice_handler(void *resource_id, const char *message)
+ {
+ 	php_pgsql_notice *notice;
++	int len;
+ 	
+ 	TSRMLS_FETCH();
+ 	if (! PGG(ignore_notices)) {
+ 		notice = (php_pgsql_notice *)emalloc(sizeof(php_pgsql_notice));
+-		notice->message = _php_pgsql_trim_message(message, &notice->len);
++		notice->message = _php_pgsql_trim_message(message, &len);
++		notice->len = len;
+ 		if (PGG(log_notices)) {
+ 			php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s", notice->message);
+ 		}
+@@ -4507,7 +4509,8 @@
+ {
+ 	zval *row;
+ 	char *field_name, *element, *data;
+-	size_t num_fields, element_len, data_len;
++	size_t num_fields, element_len;
++	int data_len;
+ 	int pg_numrows, pg_row;
+ 	uint i;
+ 	assert(Z_TYPE_P(ret_array) == IS_ARRAY);
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/php4.git/commitdiff/651d944459ba9ed5f561eabd92ca1957678874c2



More information about the pld-cvs-commit mailing list