summaryrefslogtreecommitdiffstats
path: root/Judy-svn.patch
blob: cc675a8242ae66bfd38f35a72caade7d4f33d2c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
--- pecl/judy/trunk/php_judy.c	2013/10/09 14:43:09	331752
+++ pecl/judy/trunk/php_judy.c	2013/10/09 15:09:50	331753
@@ -144,7 +144,7 @@
 	long index = 0;
 	Word_t j_index;
 	Pvoid_t *PValue = NULL;
-	zval *result;
+	zval *result = NULL;
 	zval string_key, *pstring_key = &string_key;
 	judy_object *intern = (judy_object *) zend_object_store_get_object(object TSRMLS_CC);
 
@@ -603,7 +603,7 @@
 	} else if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &type) == SUCCESS) {
 		JTYPE(jtype, type);
 		intern->counter = 0;
-		intern->type = type;
+		intern->type = jtype;
 		intern->array = (Pvoid_t) NULL;
 	}
 
@@ -615,7 +615,7 @@
    Free Judy array and any other references */
 PHP_METHOD(judy, __destruct)
 {
-	JUDY_METHOD_GET_OBJECT
+	zval *object = getThis();
 
 		/* calling the object's free() method */
 		zend_call_method_with_0_params(&object, NULL, NULL, "free", NULL);
@@ -628,7 +628,7 @@
 {
 	JUDY_METHOD_GET_OBJECT
 
-		Word_t    Rc_word;
+		Word_t    Rc_word = 0;
 	Word_t    index;
 	uint8_t   kindex[PHP_JUDY_MAX_LENGTH];
 	Word_t    *PValue;
@@ -1019,7 +1019,7 @@
 PHP_METHOD(judy, firstEmpty)
 {
 	Word_t         index = 0;
-	int            Rc_int;
+	int            Rc_int = 0;
 
 	JUDY_METHOD_GET_OBJECT
 
@@ -1051,7 +1051,7 @@
 PHP_METHOD(judy, lastEmpty)
 {
 	Word_t         index = -1;
-	int            Rc_int;
+	int            Rc_int = 0;
 
 	JUDY_METHOD_GET_OBJECT
 
@@ -1083,7 +1083,7 @@
 PHP_METHOD(judy, nextEmpty)
 {
 	Word_t         index;
-	int            Rc_int;
+	int            Rc_int = 0;
 
 	JUDY_METHOD_GET_OBJECT
 
@@ -1115,7 +1115,7 @@
 PHP_METHOD(judy, prevEmpty)
 {
 	Word_t         index;
-	int            Rc_int;
+	int            Rc_int = 0;
 
 	JUDY_METHOD_GET_OBJECT
 
--- pecl/judy/trunk/judy_iterator.c	2013/10/09 15:20:22	331754
+++ pecl/judy/trunk/judy_iterator.c	2013/10/09 17:14:16	331755
@@ -151,6 +151,14 @@
 
 /* {{{ judy_iterator_current_key
 */
+#if ZEND_MODULE_API_NO >= 20121212
+void judy_iterator_current_key(zend_object_iterator *iterator, zval *key TSRMLS_DC)
+{
+	judy_iterator 	*it = (judy_iterator*) iterator;
+	
+	ZVAL_ZVAL(key, it->key, 1, 0);
+
+#else
 int judy_iterator_current_key(zend_object_iterator *iterator,
 		char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC)
 {
@@ -171,6 +179,7 @@
 	*str_key_len = Z_STRLEN_P(it->key)+1;
 
 	return HASH_KEY_IS_STRING;
+#endif
 }
 /* }}} */
 
--- pecl/judy/trunk/judy_iterator.h	2013/10/09 15:20:22	331754
+++ pecl/judy/trunk/judy_iterator.h	2013/10/09 17:14:16	331755
@@ -43,8 +43,12 @@
 void judy_iterator_dtor(zend_object_iterator *iterator TSRMLS_DC);
 int judy_iterator_valid(zend_object_iterator *iterator TSRMLS_DC);
 void judy_iterator_current_data(zend_object_iterator *iterator,	zval ***data TSRMLS_DC);
+#if ZEND_MODULE_API_NO >= 20121212
+void judy_iterator_current_key(zend_object_iterator *iterator, zval *key TSRMLS_DC);
+#else
 int judy_iterator_current_key(zend_object_iterator *iterator,
 		char **str_key, uint *str_key_len, ulong *int_key TSRMLS_DC);
+#endif
 void judy_iterator_move_forward(zend_object_iterator *iterator TSRMLS_DC);
 void judy_iterator_rewind(zend_object_iterator *iterator TSRMLS_DC);
 /* }}} */
--- pecl/judy/trunk/php_judy.c	2013/10/09 19:10:22	331757
+++ pecl/judy/trunk/php_judy.c	2013/10/10 02:24:32	331758
@@ -94,7 +94,7 @@
 }
 /* }}} */
 
-PHPAPI zend_class_entry *php_judy_ce(void)
+PHP_JUDY_API zend_class_entry *php_judy_ce(void)
 {
 	return judy_ce;
 }
--- pecl/judy/trunk/php_judy.h	2013/10/10 02:24:40	331759
+++ pecl/judy/trunk/php_judy.h	2013/10/10 04:38:41	331760
@@ -19,7 +19,7 @@
 #ifndef PHP_JUDY_H
 #define PHP_JUDY_H
 
-#define PHP_JUDY_VERSION "0.1.6"
+#define PHP_JUDY_VERSION "1.0.0"
 #define PHP_JUDY_EXTNAME "judy"
 
 #include <Judy.h>
--- pecl/judy/trunk/tests/001.phpt	2013/10/10 02:24:40	331759
+++ pecl/judy/trunk/tests/001.phpt	2013/10/10 04:38:41	331760
@@ -20,4 +20,4 @@
 ?>
 --EXPECT--
 judy extension is available
-PHP Judy Version: 0.1.6
+PHP Judy Version: 1.0.0
--- pecl/judy/trunk/tests/github_issue2_003.phpt	2013/10/10 04:38:41	331760
+++ pecl/judy/trunk/tests/github_issue2_003.phpt	2013/10/10 04:43:24	331761
@@ -2,6 +2,8 @@
 Check for Judy ITERATOR using foreach() and INT_TO_MIXED
 --SKIPIF--
 <?php if (!extension_loaded("judy")) print "skip"; ?>
+--INI--
+date.timezone=UTC
 --FILE--
 <?php
 /*