Skip to content

Commit 551d56c

Browse files
committed
Remove another PHP 5 era macro
1 parent 3847439 commit 551d56c

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed

ibm_db2.c

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ res = (stmt_type) zend_fetch_resource(Z_RES_P(*stmt),resource_type_name,le_stmt)
4242
if(res == NULL)\
4343
RETURN_FALSE;
4444

45-
#define ZEND_REGISTER_RESOURCE_NEW(return_value, stmt_res, le_stmt_struct) \
46-
RETURN_RES(zend_register_resource( stmt_res, le_stmt_struct))
47-
4845
#define ZEND_FETCH_RESOURCE_2(rsrc, rsrc_type, passed_id, default_id, resource_type_name, resource_type1, resource_type2)\
4946
rsrc = (rsrc_type) zend_fetch_resource2(Z_RES_P(*passed_id),resource_type_name,resource_type1,resource_type2); \
5047
if(rsrc == NULL)\
@@ -3241,7 +3238,7 @@ PHP_FUNCTION(db2_connect)
32413238
return;
32423239
}
32433240
else {
3244-
ZEND_REGISTER_RESOURCE_NEW(return_value, conn_res, le_pconn_struct);
3241+
RETURN_RES(zend_register_resource(conn_res, le_pconn_struct));
32453242
}
32463243
}
32473244
else {
@@ -3260,7 +3257,7 @@ PHP_FUNCTION(db2_connect)
32603257
RETVAL_FALSE;
32613258
return;
32623259
} else {
3263-
ZEND_REGISTER_RESOURCE_NEW(return_value, conn_res, le_conn_struct);
3260+
RETURN_RES(zend_register_resource(conn_res, le_conn_struct));
32643261
}
32653262
#ifdef PASE /* ini file switch all to pconnect */
32663263
}
@@ -3282,7 +3279,7 @@ PHP_FUNCTION(db2_pconnect)
32823279
return;
32833280
}
32843281
else {
3285-
ZEND_REGISTER_RESOURCE_NEW(return_value, conn_res, le_pconn_struct);
3282+
RETURN_RES(zend_register_resource(conn_res, le_pconn_struct));
32863283
}
32873284
}
32883285
/* }}} */
@@ -3696,7 +3693,7 @@ PHP_FUNCTION(db2_column_privileges)
36963693
#ifdef PASE /* IBM i reuses handles. Connect close out of sync with le_stmt_struct dtor logic */
36973694
_php_db2_incr_stmt_struct(stmt_res);
36983695
#endif /* PASE */
3699-
ZEND_REGISTER_RESOURCE_NEW(return_value, stmt_res, le_stmt_struct);
3696+
RETURN_RES(zend_register_resource(stmt_res, le_stmt_struct));
37003697
} else {
37013698
RETURN_FALSE;
37023699
}
@@ -3763,7 +3760,7 @@ PHP_FUNCTION(db2_columns)
37633760
#ifdef PASE /* IBM i reuses handles. Connect close out of sync with le_stmt_struct dtor logic */
37643761
_php_db2_incr_stmt_struct(stmt_res);
37653762
#endif /* PASE */
3766-
ZEND_REGISTER_RESOURCE_NEW(return_value, stmt_res, le_stmt_struct);
3763+
RETURN_RES(zend_register_resource(stmt_res, le_stmt_struct));
37673764
}
37683765
}
37693766
/* }}} */
@@ -3829,7 +3826,7 @@ PHP_FUNCTION(db2_foreign_keys)
38293826
#ifdef PASE /* IBM i reuses handles. Connect close out of sync with le_stmt_struct dtor logic */
38303827
_php_db2_incr_stmt_struct(stmt_res);
38313828
#endif /* PASE */
3832-
ZEND_REGISTER_RESOURCE_NEW(return_value, stmt_res, le_stmt_struct);
3829+
RETURN_RES(zend_register_resource(stmt_res, le_stmt_struct));
38333830
} else {
38343831
RETURN_FALSE;
38353832
}
@@ -3893,7 +3890,7 @@ PHP_FUNCTION(db2_primary_keys)
38933890
#ifdef PASE /* IBM i reuses handles. Connect close out of sync with le_stmt_struct dtor logic */
38943891
_php_db2_incr_stmt_struct(stmt_res);
38953892
#endif /* PASE */
3896-
ZEND_REGISTER_RESOURCE_NEW(return_value, stmt_res, le_stmt_struct);
3893+
RETURN_RES(zend_register_resource(stmt_res, le_stmt_struct));
38973894
} else {
38983895
RETURN_FALSE;
38993896
}
@@ -3959,7 +3956,7 @@ PHP_FUNCTION(db2_procedure_columns)
39593956
#ifdef PASE /* IBM i reuses handles. Connect close out of sync with le_stmt_struct dtor logic */
39603957
_php_db2_incr_stmt_struct(stmt_res);
39613958
#endif /* PASE */
3962-
ZEND_REGISTER_RESOURCE_NEW(return_value, stmt_res, le_stmt_struct);
3959+
RETURN_RES(zend_register_resource(stmt_res, le_stmt_struct));
39633960
} else {
39643961
RETURN_FALSE;
39653962
}
@@ -4021,7 +4018,7 @@ PHP_FUNCTION(db2_procedures)
40214018
#ifdef PASE /* IBM i reuses handles. Connect close out of sync with le_stmt_struct dtor logic */
40224019
_php_db2_incr_stmt_struct(stmt_res);
40234020
#endif /* PASE */
4024-
ZEND_REGISTER_RESOURCE_NEW(return_value, stmt_res, le_stmt_struct);
4021+
RETURN_RES(zend_register_resource(stmt_res, le_stmt_struct));
40254022
} else {
40264023
RETURN_FALSE;
40274024
}
@@ -4086,7 +4083,7 @@ PHP_FUNCTION(db2_special_columns)
40864083
#ifdef PASE /* IBM i reuses handles. Connect close out of sync with le_stmt_struct dtor logic */
40874084
_php_db2_incr_stmt_struct(stmt_res);
40884085
#endif /* PASE */
4089-
ZEND_REGISTER_RESOURCE_NEW(return_value, stmt_res, le_stmt_struct);
4086+
RETURN_RES(zend_register_resource(stmt_res, le_stmt_struct));
40904087
} else {
40914088
RETURN_FALSE;
40924089
}
@@ -4154,7 +4151,7 @@ PHP_FUNCTION(db2_statistics)
41544151
#ifdef PASE /* IBM i reuses handles. Connect close out of sync with le_stmt_struct dtor logic */
41554152
_php_db2_incr_stmt_struct(stmt_res);
41564153
#endif /* PASE */
4157-
ZEND_REGISTER_RESOURCE_NEW(return_value, stmt_res, le_stmt_struct);
4154+
RETURN_RES(zend_register_resource(stmt_res, le_stmt_struct));
41584155
} else {
41594156
RETURN_FALSE;
41604157
}
@@ -4222,7 +4219,7 @@ PHP_FUNCTION(db2_table_privileges)
42224219
#ifdef PASE /* IBM i reuses handles. Connect close out of sync with le_stmt_struct dtor logic */
42234220
_php_db2_incr_stmt_struct(stmt_res);
42244221
#endif /* PASE */
4225-
ZEND_REGISTER_RESOURCE_NEW(return_value, stmt_res, le_stmt_struct);
4222+
RETURN_RES(zend_register_resource(stmt_res, le_stmt_struct));
42264223
} else {
42274224
RETURN_FALSE;
42284225
}
@@ -4293,7 +4290,7 @@ PHP_FUNCTION(db2_tables)
42934290
#ifdef PASE /* IBM i reuses handles. Connect close out of sync with le_stmt_struct dtor logic */
42944291
_php_db2_incr_stmt_struct(stmt_res);
42954292
#endif /* PASE */
4296-
ZEND_REGISTER_RESOURCE_NEW(return_value, stmt_res, le_stmt_struct);
4293+
RETURN_RES(zend_register_resource(stmt_res, le_stmt_struct));
42974294
} else {
42984295
RETURN_FALSE;
42994296
}
@@ -4447,7 +4444,7 @@ PHP_FUNCTION(db2_exec)
44474444
#ifdef PASE /* IBM i reuses handles. Connect close out of sync with le_stmt_struct dtor logic */
44484445
_php_db2_incr_stmt_struct(stmt_res);
44494446
#endif /* PASE */
4450-
ZEND_REGISTER_RESOURCE_NEW(return_value, stmt_res, le_stmt_struct);
4447+
RETURN_RES(zend_register_resource(stmt_res, le_stmt_struct));
44514448
}
44524449
}
44534450
/* }}} */
@@ -4522,7 +4519,7 @@ PHP_FUNCTION(db2_prepare)
45224519
#ifdef PASE /* IBM i reuses handles. Connect close out of sync with le_stmt_struct dtor logic */
45234520
_php_db2_incr_stmt_struct(stmt_res);
45244521
#endif /* PASE */
4525-
ZEND_REGISTER_RESOURCE_NEW(return_value, stmt_res, le_stmt_struct);
4522+
RETURN_RES(zend_register_resource(stmt_res, le_stmt_struct));
45264523
}
45274524
}
45284525
/* }}} */
@@ -5547,7 +5544,7 @@ PHP_FUNCTION(db2_next_result)
55475544
#ifdef PASE /* IBM i reuses handles. Connect close out of sync with le_stmt_struct dtor logic */
55485545
_php_db2_incr_stmt_struct(stmt_res);
55495546
#endif /* PASE */
5550-
ZEND_REGISTER_RESOURCE_NEW(return_value, new_stmt_res, le_stmt_struct);
5547+
RETURN_RES(zend_register_resource(new_stmt_res, le_stmt_struct));
55515548
} else {
55525549
RETURN_FALSE;
55535550
}

0 commit comments

Comments
 (0)