From 61a43195f5578c33105ca5a0a097a9d974e479f6 Mon Sep 17 00:00:00 2001 From: Sara Golemon Date: Sat, 31 Dec 2016 08:59:49 -0800 Subject: Use new param API in pdo_sqlite --- ext/pdo_sqlite/sqlite_driver.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'ext/pdo_sqlite') diff --git a/ext/pdo_sqlite/sqlite_driver.c b/ext/pdo_sqlite/sqlite_driver.c index 22fb8a46b9..3d76f088d8 100644 --- a/ext/pdo_sqlite/sqlite_driver.c +++ b/ext/pdo_sqlite/sqlite_driver.c @@ -519,10 +519,12 @@ static PHP_METHOD(SQLite, sqliteCreateFunction) pdo_sqlite_db_handle *H; int ret; - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "sz|l", - &func_name, &func_name_len, &callback, &argc)) { - RETURN_FALSE; - } + ZEND_PARSE_PARAMETERS_START(2, 3) + Z_PARAM_STRING(func_name, func_name_len) + Z_PARAM_ZVAL_DEREF(callback) + Z_PARAM_OPTIONAL + Z_PARAM_LONG(argc) + ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE); dbh = Z_PDO_DBH_P(getThis()); PDO_CONSTRUCT_CHECK; @@ -589,10 +591,13 @@ static PHP_METHOD(SQLite, sqliteCreateAggregate) pdo_sqlite_db_handle *H; int ret; - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "szz|l", - &func_name, &func_name_len, &step_callback, &fini_callback, &argc)) { - RETURN_FALSE; - } + ZEND_PARSE_PARAMETERS_START(3, 4) + Z_PARAM_STRING(func_name, func_name_len) + Z_PARAM_ZVAL_DEREF(step_callback) + Z_PARAM_ZVAL_DEREF(fini_callback) + Z_PARAM_OPTIONAL + Z_PARAM_LONG(argc) + ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE); dbh = Z_PDO_DBH_P(getThis()); PDO_CONSTRUCT_CHECK; @@ -649,10 +654,10 @@ static PHP_METHOD(SQLite, sqliteCreateCollation) pdo_sqlite_db_handle *H; int ret; - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "sz", - &collation_name, &collation_name_len, &callback)) { - RETURN_FALSE; - } + ZEND_PARSE_PARAMETERS_START(2, 2) + Z_PARAM_STRING(collation_name, collation_name_len) + Z_PARAM_ZVAL_DEREF(callback) + ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE); dbh = Z_PDO_DBH_P(getThis()); PDO_CONSTRUCT_CHECK; -- cgit v1.2.1