View | Details | Raw Unified | Return to bug 120088
Collapse All | Expand All

(-)ports/lang/php5/Makefile (-1 / +1 lines)
Lines 7-13 Link Here
7
7
8
PORTNAME=	php5
8
PORTNAME=	php5
9
PORTVERSION=	5.2.5
9
PORTVERSION=	5.2.5
10
PORTREVISION?=	0
10
PORTREVISION?=	1
11
CATEGORIES?=	lang devel www
11
CATEGORIES?=	lang devel www
12
MASTER_SITES=	${MASTER_SITE_PHP}
12
MASTER_SITES=	${MASTER_SITE_PHP}
13
MASTER_SITE_SUBDIR=	distributions
13
MASTER_SITE_SUBDIR=	distributions
(-)ports/lang/php5/files/patch-Zend-zend_list.h (+50 lines)
Added Link Here
1
--- Zend/zend_list.h	Mon Jan  1 04:35:46 2007
2
+++ Zend/zend_list.h	Thu Dec  6 22:52:34 2007
3
@@ -72,7 +72,7 @@
4
 
5
 ZEND_API int zend_list_insert(void *ptr, int type);
6
-ZEND_API int _zend_list_addref(int id TSRMLS_DC);
7
-ZEND_API int _zend_list_delete(int id TSRMLS_DC);
8
-ZEND_API void *_zend_list_find(int id, int *type TSRMLS_DC);
9
+ZEND_API int _zend_list_addref(ulong id TSRMLS_DC);
10
+ZEND_API int _zend_list_delete(ulong id TSRMLS_DC);
11
+ZEND_API void *_zend_list_find(ulong id, int *type TSRMLS_DC);
12
 
13
 #define zend_list_addref(id)		_zend_list_addref(id TSRMLS_CC)
14
@@ -83,5 +83,5 @@
15
 ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, char *resource_type_name, int *found_resource_type, int num_resource_types, ...);
16
 
17
-ZEND_API char *zend_rsrc_list_get_rsrc_type(int resource TSRMLS_DC);
18
+ZEND_API char *zend_rsrc_list_get_rsrc_type(ulong resource TSRMLS_DC);
19
 ZEND_API int zend_fetch_list_dtor_id(char *type_name);
20
 
21
--- Zend/zend_list.c	Mon Jan  1 04:35:46 2007
22
+++ Zend/zend_list.c	Thu Dec  6 22:58:18 2007
23
@@ -49,5 +49,5 @@
24
 }
25
 
26
-ZEND_API int _zend_list_delete(int id TSRMLS_DC)
27
+ZEND_API int _zend_list_delete(ulong id TSRMLS_DC)
28
 {
29
 	zend_rsrc_list_entry *le;
30
@@ -66,5 +66,5 @@
31
 
32
 
33
-ZEND_API void *_zend_list_find(int id, int *type TSRMLS_DC)
34
+ZEND_API void *_zend_list_find(ulong id, int *type TSRMLS_DC)
35
 {
36
 	zend_rsrc_list_entry *le;
37
@@ -79,5 +79,5 @@
38
 }
39
 
40
-ZEND_API int _zend_list_addref(int id TSRMLS_DC)
41
+ZEND_API int _zend_list_addref(ulong id TSRMLS_DC)
42
 {
43
 	zend_rsrc_list_entry *le;
44
@@ -351,5 +351,5 @@
45
 
46
 
47
-char *zend_rsrc_list_get_rsrc_type(int resource TSRMLS_DC)
48
+char *zend_rsrc_list_get_rsrc_type(ulong resource TSRMLS_DC)
49
 {
50
 	zend_rsrc_list_dtors_entry *lde;
(-)ports/databases/php5-pgsql/files/patch-pgsql.c (+82 lines)
Added Link Here
1
--- pgsql.c	Wed Oct  3 19:31:58 2007
2
+++ pgsql.c	Thu Dec  6 23:16:34 2007
3
@@ -63,4 +63,5 @@
4
 #define PGSQL_MAX_LENGTH_OF_DOUBLE 60
5
 
6
+#if UINT_MAX > LONG_MAX
7
 #define PGSQL_RETURN_OID(oid) do { \
8
 	if (oid > LONG_MAX) { \
9
@@ -72,5 +73,7 @@
10
 	RETURN_LONG((long)oid); \
11
 } while(0)
12
-
13
+#else
14
+#define PGSQL_RETURN_OID(oid) RETURN_LONG((long)oid)
15
+#endif
16
 
17
 #if HAVE_PQSETNONBLOCKING
18
@@ -273,5 +276,5 @@
19
 
20
 /* {{{ _php_pgsql_trim_message */
21
-static char * _php_pgsql_trim_message(const char *message, int *len)
22
+static char * _php_pgsql_trim_message(const char *message, size_t *len)
23
 {
24
 	register int i = strlen(message)-1;
25
@@ -364,5 +367,5 @@
26
 			php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s", notice->message);
27
 		}
28
-		zend_hash_index_update(&PGG(notices), (int)resource_id, (void **)&notice, sizeof(php_pgsql_notice *), NULL);
29
+		zend_hash_index_update(&PGG(notices), (ulong)resource_id, (void **)&notice, sizeof(php_pgsql_notice *), NULL);
30
 	}
31
 }
32
@@ -762,5 +765,6 @@
33
 		if (!(connect_type & PGSQL_CONNECT_FORCE_NEW)
34
 			&& zend_hash_find(&EG(regular_list),str.c,str.len+1,(void **) &index_ptr)==SUCCESS) {
35
-			int type,link;
36
+			int type;
37
+			ulong link;
38
 			void *ptr;
39
 
40
@@ -768,5 +772,5 @@
41
 				RETURN_FALSE;
42
 			}
43
-			link = (int) index_ptr->ptr;
44
+			link = (uintptr_t /* ulong is as wide or wider than pointer */) index_ptr->ptr;
45
 			ptr = zend_list_find(link,&type);   /* check if the link is still there */
46
 			if (ptr && (type==le_link || type==le_plink)) {
47
@@ -1749,4 +1753,5 @@
48
 
49
 	if (return_oid) {
50
+#if UINT_MAX > LONG_MAX /* Oid is unsigned int, we don't need this code, where LONG is wider */
51
 		if (oid > LONG_MAX) {
52
 			smart_str oidstr = {0};
53
@@ -1754,5 +1759,7 @@
54
 			smart_str_0(&oidstr);
55
 			RETURN_STRINGL(oidstr.c, oidstr.len, 0);
56
-		} else {
57
+		} else
58
+#endif
59
+		{
60
 			RETURN_LONG((long)oid);
61
 		}
62
@@ -1855,4 +1862,5 @@
63
 			oid = PQftype(pgsql_result, Z_LVAL_PP(field));
64
 
65
+#if UINT_MAX > LONG_MAX
66
 			if (oid > LONG_MAX) {
67
 				smart_str s = {0};
68
@@ -1864,4 +1872,5 @@
69
 			}
70
 			else
71
+#endif
72
 			{
73
 				Z_LVAL_P(return_value) = (long)oid;
74
@@ -5742,6 +5751,6 @@
75
 	zval *row;
76
 	char *field_name, *element, *data;
77
-	size_t num_fields, element_len, data_len;
78
-	int pg_numrows, pg_row;
79
+	size_t num_fields, element_len;
80
+	int pg_numrows, pg_row, data_len;
81
 	uint i;
82
 	assert(Z_TYPE_P(ret_array) == IS_ARRAY);

Return to bug 120088