Skip to content

Commit 52e5bb9

Browse files
jmikoladerickr
authored andcommitted
PHPC-369: Additional Z_<CLASSNAME>_OBJ_P() macros
1 parent 0b4b793 commit 52e5bb9

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

php_phongo.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ void phongo_readpreference_init(zval *return_value, const mongoc_read_prefs_t *r
264264

265265
object_init_ex(return_value, php_phongo_readpreference_ce);
266266

267-
intern = (php_phongo_readpreference_t *)zend_object_store_get_object(return_value TSRMLS_CC);
267+
intern = Z_READPREFERENCE_OBJ_P(return_value);
268268
intern->read_preference = mongoc_read_prefs_copy(read_prefs);
269269
}
270270
/* }}} */
@@ -275,7 +275,7 @@ void phongo_writeconcern_init(zval *return_value, const mongoc_write_concern_t *
275275

276276
object_init_ex(return_value, php_phongo_writeconcern_ce);
277277

278-
intern = (php_phongo_writeconcern_t *)zend_object_store_get_object(return_value TSRMLS_CC);
278+
intern = Z_WRITECONCERN_OBJ_P(return_value);
279279
intern->write_concern = mongoc_write_concern_copy(write_concern);
280280
}
281281
/* }}} */

src/BSON/Javascript.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ HashTable *php_phongo_javascript_get_debug_info(zval *object, int *is_temp TSRML
149149

150150

151151
*is_temp = 1;
152-
intern = (php_phongo_javascript_t *)zend_object_store_get_object(object TSRMLS_CC);
152+
intern = Z_JAVASCRIPT_OBJ_P(object);
153153

154154
array_init(&retval);
155155

src/BSON/Regex.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ HashTable *php_phongo_regex_get_debug_info(zval *object, int *is_temp TSRMLS_DC)
215215

216216

217217
*is_temp = 1;
218-
intern = (php_phongo_regex_t *)zend_object_store_get_object(object TSRMLS_CC);
218+
intern = Z_REGEX_OBJ_P(object);
219219

220220
array_init(&retval);
221221

src/BSON/Timestamp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ HashTable *php_phongo_timestamp_get_debug_info(zval *object, int *is_temp TSRMLS
158158

159159

160160
*is_temp = 1;
161-
intern = (php_phongo_timestamp_t *)zend_object_store_get_object(object TSRMLS_CC);
161+
intern = Z_TIMESTAMP_OBJ_P(object);
162162

163163
array_init(&retval);
164164

src/BSON/UTCDateTime.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ HashTable *php_phongo_utcdatetime_get_debug_info(zval *object, int *is_temp TSRM
189189
#endif
190190

191191
*is_temp = 1;
192-
intern = (php_phongo_utcdatetime_t *)zend_object_store_get_object(object TSRMLS_CC);
192+
intern = Z_UTCDATETIME_OBJ_P(object);
193193

194194
array_init(&retval);
195195

src/MongoDB/ReadPreference.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ PHP_METHOD(ReadPreference, getMode)
102102
php_phongo_readpreference_t *intern;
103103
(void)return_value_ptr; (void)return_value_used;
104104

105-
intern = (php_phongo_readpreference_t *)zend_object_store_get_object(getThis() TSRMLS_CC);
105+
intern = Z_READPREFERENCE_OBJ_P(getThis());
106106

107107
if (zend_parse_parameters_none() == FAILURE) {
108108
return;
@@ -119,7 +119,7 @@ PHP_METHOD(ReadPreference, getTagSets)
119119
php_phongo_readpreference_t *intern;
120120
(void)return_value_ptr; (void)return_value_used;
121121

122-
intern = (php_phongo_readpreference_t *)zend_object_store_get_object(getThis() TSRMLS_CC);
122+
intern = Z_READPREFERENCE_OBJ_P(getThis());
123123

124124
if (zend_parse_parameters_none() == FAILURE) {
125125
return;

src/MongoDB/WriteConcern.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ PHP_METHOD(WriteConcern, getW)
112112
const char *wtag;
113113
(void)return_value_ptr; (void)return_value_used;
114114

115-
intern = (php_phongo_writeconcern_t *)zend_object_store_get_object(getThis() TSRMLS_CC);
115+
intern = Z_WRITECONCERN_OBJ_P(getThis());
116116

117117
if (zend_parse_parameters_none() == FAILURE) {
118118
return;
@@ -143,7 +143,7 @@ PHP_METHOD(WriteConcern, getWtimeout)
143143
php_phongo_writeconcern_t *intern;
144144
(void)return_value_ptr; (void)return_value_used;
145145

146-
intern = (php_phongo_writeconcern_t *)zend_object_store_get_object(getThis() TSRMLS_CC);
146+
intern = Z_WRITECONCERN_OBJ_P(getThis());
147147

148148
if (zend_parse_parameters_none() == FAILURE) {
149149
return;
@@ -160,7 +160,7 @@ PHP_METHOD(WriteConcern, getJournal)
160160
php_phongo_writeconcern_t *intern;
161161
(void)return_value_ptr; (void)return_value_used;
162162

163-
intern = (php_phongo_writeconcern_t *)zend_object_store_get_object(getThis() TSRMLS_CC);
163+
intern = Z_WRITECONCERN_OBJ_P(getThis());
164164

165165
if (zend_parse_parameters_none() == FAILURE) {
166166
return;

0 commit comments

Comments
 (0)