summaryrefslogtreecommitdiff
path: root/ext/mysqli/mysqli_exception.c
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2014-05-11 14:53:18 +0800
committerXinchen Hui <laruence@php.net>2014-05-11 14:53:18 +0800
commit2402d6cbbc5e04362b23b183f9129a8db230bcce (patch)
treeee740b34929b74cc39a095c4a47b8c860b062703 /ext/mysqli/mysqli_exception.c
parente9274de503d3e7c75214913cfe4a0e1b9a8b857b (diff)
downloadphp-git-2402d6cbbc5e04362b23b183f9129a8db230bcce.tar.gz
Refactor MySQLi (incompleted, only compilable now)
Diffstat (limited to 'ext/mysqli/mysqli_exception.c')
-rw-r--r--ext/mysqli/mysqli_exception.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/ext/mysqli/mysqli_exception.c b/ext/mysqli/mysqli_exception.c
index 82cf5cd7bf..30ed75ddb7 100644
--- a/ext/mysqli/mysqli_exception.c
+++ b/ext/mysqli/mysqli_exception.c
@@ -38,7 +38,7 @@ const zend_function_entry mysqli_exception_methods[] = {
void php_mysqli_throw_sql_exception(char *sqlstate, int errorno TSRMLS_DC, char *format, ...)
{
- zval *sql_ex;
+ zval sql_ex;
va_list arg;
char *message;
@@ -52,26 +52,25 @@ void php_mysqli_throw_sql_exception(char *sqlstate, int errorno TSRMLS_DC, char
return;
}
- MAKE_STD_ZVAL(sql_ex);
- object_init_ex(sql_ex, mysqli_exception_class_entry);
+ object_init_ex(&sql_ex, mysqli_exception_class_entry);
if (message) {
- zend_update_property_string(mysqli_exception_class_entry, sql_ex, "message", sizeof("message") - 1,
+ zend_update_property_string(mysqli_exception_class_entry, &sql_ex, "message", sizeof("message") - 1,
message TSRMLS_CC);
}
if (sqlstate) {
- zend_update_property_string(mysqli_exception_class_entry, sql_ex, "sqlstate", sizeof("sqlstate") - 1,
+ zend_update_property_string(mysqli_exception_class_entry, &sql_ex, "sqlstate", sizeof("sqlstate") - 1,
sqlstate TSRMLS_CC);
} else {
- zend_update_property_string(mysqli_exception_class_entry, sql_ex, "sqlstate", sizeof("sqlstate") - 1,
+ zend_update_property_string(mysqli_exception_class_entry, &sql_ex, "sqlstate", sizeof("sqlstate") - 1,
"00000" TSRMLS_CC);
}
efree(message);
- zend_update_property_long(mysqli_exception_class_entry, sql_ex, "code", sizeof("code") - 1, errorno TSRMLS_CC);
+ zend_update_property_long(mysqli_exception_class_entry, &sql_ex, "code", sizeof("code") - 1, errorno TSRMLS_CC);
- zend_throw_exception_object(sql_ex TSRMLS_CC);
+ zend_throw_exception_object(&sql_ex TSRMLS_CC);
}
/*