Skip to content

Commit e5a4217

Browse files
bjoriderickr
authored andcommitted
PHPC-399: zval_used_for_init is no longer needed (or defined)
1 parent 48f0469 commit e5a4217

File tree

14 files changed

+61
-5
lines changed

14 files changed

+61
-5
lines changed

src/BSON/Binary.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,11 @@ phongo_create_object_retval php_phongo_binary_create_object(zend_class_entry *cl
172172
HashTable *php_phongo_binary_get_debug_info(zval *object, int *is_temp TSRMLS_DC) /* {{{ */
173173
{
174174
php_phongo_binary_t *intern;
175+
#if PHP_VERSION_ID <= 70000
176+
zval retval;
177+
#else
175178
zval retval = zval_used_for_init;
179+
#endif
176180

177181
intern = Z_BINARY_OBJ_P(object);
178182
*is_temp = 1;

src/BSON/ObjectID.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,11 @@ static int php_phongo_objectid_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /*
173173
HashTable *php_phongo_objectid_get_debug_info(zval *object, int *is_temp TSRMLS_DC) /* {{{ */
174174
{
175175
php_phongo_objectid_t *intern;
176+
#if PHP_VERSION_ID <= 70000
177+
zval retval;
178+
#else
176179
zval retval = zval_used_for_init;
180+
#endif
177181

178182

179183
*is_temp = 1;

src/MongoDB/BulkWrite.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,12 @@ phongo_create_object_retval php_phongo_bulkwrite_create_object(zend_class_entry
311311

312312
HashTable *php_phongo_bulkwrite_get_debug_info(zval *object, int *is_temp TSRMLS_DC) /* {{{ */
313313
{
314-
zval retval = zval_used_for_init;
315-
php_phongo_bulkwrite_t *intern = NULL;
314+
#if PHP_VERSION_ID <= 70000
315+
zval retval;
316+
#else
317+
zval retval = zval_used_for_init;
318+
#endif
319+
php_phongo_bulkwrite_t *intern = NULL;
316320

317321

318322
*is_temp = 1;

src/MongoDB/Command.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,11 @@ phongo_create_object_retval php_phongo_command_create_object(zend_class_entry *c
134134
HashTable *php_phongo_command_get_debug_info(zval *object, int *is_temp TSRMLS_DC) /* {{{ */
135135
{
136136
php_phongo_command_t *intern;
137-
zval retval = zval_used_for_init;
137+
#if PHP_VERSION_ID <= 70000
138+
zval retval;
139+
#else
140+
zval retval = zval_used_for_init;
141+
#endif
138142

139143

140144
*is_temp = 1;

src/MongoDB/Cursor.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,11 @@ phongo_create_object_retval php_phongo_cursor_create_object(zend_class_entry *cl
254254
HashTable *php_phongo_cursor_get_debug_info(zval *object, int *is_temp TSRMLS_DC) /* {{{ */
255255
{
256256
php_phongo_cursor_t *intern;
257-
zval retval = zval_used_for_init;
257+
#if PHP_VERSION_ID <= 70000
258+
zval retval;
259+
#else
260+
zval retval = zval_used_for_init;
261+
#endif
258262

259263

260264
*is_temp = 1;

src/MongoDB/CursorId.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,11 @@ phongo_create_object_retval php_phongo_cursorid_create_object(zend_class_entry *
120120
HashTable *php_phongo_cursorid_get_debug_info(zval *object, int *is_temp TSRMLS_DC) /* {{{ */
121121
{
122122
php_phongo_cursorid_t *intern;
123+
#if PHP_VERSION_ID <= 70000
124+
zval retval;
125+
#else
123126
zval retval = zval_used_for_init;
127+
#endif
124128

125129

126130
*is_temp = 1;

src/MongoDB/Manager.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,11 @@ bool phongo_add_server_debug(void *item, void *ctx) /* {{{ */
435435
HashTable *php_phongo_manager_get_debug_info(zval *object, int *is_temp TSRMLS_DC) /* {{{ */
436436
{
437437
php_phongo_manager_t *intern;
438+
#if PHP_VERSION_ID <= 70000
439+
zval retval;
440+
#else
438441
zval retval = zval_used_for_init;
442+
#endif
439443

440444

441445
*is_temp = 1;

src/MongoDB/Query.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,11 @@ phongo_create_object_retval php_phongo_query_create_object(zend_class_entry *cla
171171
HashTable *php_phongo_query_get_debug_info(zval *object, int *is_temp TSRMLS_DC) /* {{{ */
172172
{
173173
php_phongo_query_t *intern;
174+
#if PHP_VERSION_ID <= 70000
175+
zval retval;
176+
#else
174177
zval retval = zval_used_for_init;
178+
#endif
175179

176180

177181
*is_temp = 1;

src/MongoDB/ReadPreference.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,11 @@ phongo_create_object_retval php_phongo_readpreference_create_object(zend_class_e
208208

209209
HashTable *php_phongo_readpreference_get_debug_info(zval *object, int *is_temp TSRMLS_DC) /* {{{ */
210210
{
211-
zval retval = zval_used_for_init;
211+
#if PHP_VERSION_ID <= 70000
212+
zval retval;
213+
#else
214+
zval retval = zval_used_for_init;
215+
#endif
212216
const mongoc_read_prefs_t *read_prefs = phongo_read_preference_from_zval(object TSRMLS_CC);
213217

214218

src/MongoDB/Server.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,11 @@ phongo_create_object_retval php_phongo_server_create_object(zend_class_entry *cl
545545
HashTable *php_phongo_server_get_debug_info(zval *object, int *is_temp TSRMLS_DC) /* {{{ */
546546
{
547547
php_phongo_server_t *intern = NULL;
548+
#if PHP_VERSION_ID <= 70000
549+
zval retval;
550+
#else
548551
zval retval = zval_used_for_init;
552+
#endif
549553
mongoc_server_description_t *sd;
550554
bson_error_t error;
551555

0 commit comments

Comments
 (0)