com php-src: Drop now unnecessary start parameter: ext/mysqli/m ysqli_api.c
| From: | Nikita Popov | Date: | Sat, 04 Apr 2015 11:10:29 +0000 |
| Subject: | com php-src: Drop now unnecessary start parameter: ext/mysqli/m ysqli_api.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-86070@lists.php.net to get a copy of this message | ||
Commit: f3e3d85bb2dec908f348e470f64bd99001345998
Author: Nikita Popov <nikic@php.net> Sat, 4 Apr 2015 13:10:29 +0200
Parents: 9a4b7ad9bb54ea158d62390fe4d4a813ec255941
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f3e3d85bb2dec908f348e470f64bd99001345998
Log:
Drop now unnecessary start parameter
Changed paths:
M ext/mysqli/mysqli_api.c
Diff:
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c
index 568d518..22ef0c8 100644
--- a/ext/mysqli/mysqli_api.c
+++ b/ext/mysqli/mysqli_api.c
@@ -387,11 +387,11 @@ PHP_FUNCTION(mysqli_stmt_bind_param)
do_alloca, free_alloca
*/
static int
-mysqli_stmt_bind_result_do_bind(MY_STMT *stmt, zval *args, unsigned int argc, unsigned int start)
+mysqli_stmt_bind_result_do_bind(MY_STMT *stmt, zval *args, unsigned int argc)
{
MYSQL_BIND *bind;
int i, ofs;
- int var_cnt = argc - start;
+ int var_cnt = argc;
zend_long col_type;
zend_ulong rc;
@@ -409,8 +409,8 @@ mysqli_stmt_bind_result_do_bind(MY_STMT *stmt, zval *args, unsigned int argc, un
memset(p, 0, size);
}
- for (i=start; i < var_cnt + start ; i++) {
- ofs = i - start;
+ for (i = 0; i < var_cnt; i++) {
+ ofs = i;
col_type = (stmt->stmt->fields) ? stmt->stmt->fields[ofs].type : MYSQL_TYPE_STRING;
switch (col_type) {
@@ -555,9 +555,8 @@ mysqli_stmt_bind_result_do_bind(MY_STMT *stmt, zval *args, unsigned int argc, un
} else {
stmt->result.var_cnt = var_cnt;
stmt->result.vars = safe_emalloc((var_cnt), sizeof(zval), 0);
- for (i = start; i < var_cnt+start; i++) {
- ofs = i-start;
- ZVAL_COPY(&stmt->result.vars[ofs], &args[i]);
+ for (i = 0; i < var_cnt; i++) {
+ ZVAL_COPY(&stmt->result..vars[i], &args[i]);
}
}
efree(bind);
@@ -566,13 +565,13 @@ mysqli_stmt_bind_result_do_bind(MY_STMT *stmt, zval *args, unsigned int argc,
un
}
#else
static int
-mysqli_stmt_bind_result_do_bind(MY_STMT *stmt, zval *args, unsigned int argc, unsigned int start)
+mysqli_stmt_bind_result_do_bind(MY_STMT *stmt, zval *args, unsigned int argc)
{
unsigned int i;
MYSQLND_RESULT_BIND *params = mysqlnd_stmt_alloc_result_bind(stmt->stmt);
if (params) {
- for (i = 0; i < (argc - start); i++) {
- ZVAL_COPY_VALUE(¶ms[i].zv, &args[i + start]);
+ for (i = 0; i < argc; i++) {
+ ZVAL_COPY_VALUE(¶ms[i].zv, &args[i]);
}
return mysqlnd_stmt_bind_result(stmt->stmt, params);
}
@@ -602,7 +601,7 @@ PHP_FUNCTION(mysqli_stmt_bind_result)
RETURN_FALSE;
}
- rc = mysqli_stmt_bind_result_do_bind(stmt, args, argc, 0);
+ rc = mysqli_stmt_bind_result_do_bind(stmt, args, argc);
RETURN_BOOL(!rc);
}
/* }}} */