Skip to content

Commit b373ccd

Browse files
committed
fix shadowing of parameters
1 parent b5831c0 commit b373ccd

File tree

3 files changed

+24
-24
lines changed

3 files changed

+24
-24
lines changed

ext/mysqli/mysqli.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -1235,12 +1235,12 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
12351235
fci.retval_ptr_ptr = &retval_ptr;
12361236
if (ctor_params && Z_TYPE_P(ctor_params) != IS_NULL) {
12371237
if (Z_TYPE_P(ctor_params) == IS_ARRAY) {
1238-
HashTable *ht = Z_ARRVAL_P(ctor_params);
1238+
HashTable *params_ht = Z_ARRVAL_P(ctor_params);
12391239
Bucket *p;
12401240

12411241
fci.param_count = 0;
1242-
fci.params = safe_emalloc(sizeof(zval*), ht->nNumOfElements, 0);
1243-
p = ht->pListHead;
1242+
fci.params = safe_emalloc(sizeof(zval*), params_ht->nNumOfElements, 0);
1243+
p = params_ht->pListHead;
12441244
while (p != NULL) {
12451245
fci.params[fci.param_count++] = (zval**)p->pData;
12461246
p = p->pListNext;

ext/mysqli/mysqli_priv.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ extern PHPAPI zend_class_entry *spl_ce_RuntimeException;
7979
#endif
8080

8181
#define REGISTER_MYSQLI_CLASS_ENTRY(name, mysqli_entry, class_functions) { \
82-
zend_class_entry ce; \
83-
INIT_CLASS_ENTRY(ce, name,class_functions); \
84-
ce.create_object = mysqli_objects_new; \
85-
mysqli_entry = zend_register_internal_class(&ce TSRMLS_CC); \
82+
zend_class_entry tmp_ce; \
83+
INIT_CLASS_ENTRY(tmp_ce, name,class_functions); \
84+
tmp_ce.create_object = mysqli_objects_new; \
85+
mysqli_entry = zend_register_internal_class(&tmp_ce TSRMLS_CC); \
8686
} \
8787

8888
#define PHP_MYSQLI_EXPORT(__type) PHP_MYSQLI_API __type

ext/mysqlnd/mysqlnd_ps_codec.c

+17-17
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ void ps_fetch_time(zval *zv, const MYSQLND_FIELD * const field,
231231
{
232232
struct st_mysqlnd_time t;
233233
unsigned int length; /* First byte encodes the length*/
234-
char *to;
234+
char * value;
235235
DBG_ENTER("ps_fetch_time");
236236

237237
if ((length = php_mysqlnd_net_field_length(row))) {
@@ -262,17 +262,17 @@ void ps_fetch_time(zval *zv, const MYSQLND_FIELD * const field,
262262
QQ : How to make this unicode without copying two times the buffer -
263263
Unicode equivalent of spprintf?
264264
*/
265-
length = spprintf(&to, 0, "%s%02u:%02u:%02u", (t.neg ? "-" : ""), t.hour, t.minute, t.second);
265+
length = spprintf(&value, 0, "%s%02u:%02u:%02u", (t.neg ? "-" : ""), t.hour, t.minute, t.second);
266266

267-
DBG_INF_FMT("%s", to);
267+
DBG_INF_FMT("%s", value);
268268
#if MYSQLND_UNICODE
269269
if (!as_unicode) {
270270
#endif
271-
ZVAL_STRINGL(zv, to, length, 1);
272-
efree(to); /* allocated by spprintf */
271+
ZVAL_STRINGL(zv, value, length, 1);
272+
efree(value); /* allocated by spprintf */
273273
#if MYSQLND_UNICODE
274274
} else {
275-
ZVAL_UTF8_STRINGL(zv, to, length, ZSTR_AUTOFREE);
275+
ZVAL_UTF8_STRINGL(zv, value, length, ZSTR_AUTOFREE);
276276
}
277277
#endif
278278
DBG_VOID_RETURN;
@@ -288,7 +288,7 @@ void ps_fetch_date(zval *zv, const MYSQLND_FIELD * const field,
288288
{
289289
struct st_mysqlnd_time t = {0};
290290
unsigned int length; /* First byte encodes the length*/
291-
char *to;
291+
char * value;
292292
DBG_ENTER("ps_fetch_date");
293293

294294
if ((length = php_mysqlnd_net_field_length(row))) {
@@ -313,17 +313,17 @@ void ps_fetch_date(zval *zv, const MYSQLND_FIELD * const field,
313313
QQ : How to make this unicode without copying two times the buffer -
314314
Unicode equivalent of spprintf?
315315
*/
316-
length = spprintf(&to, 0, "%04u-%02u-%02u", t.year, t.month, t.day);
316+
length = spprintf(&value, 0, "%04u-%02u-%02u", t.year, t.month, t.day);
317317

318-
DBG_INF_FMT("%s", to);
318+
DBG_INF_FMT("%s", value);
319319
#if MYSQLND_UNICODE
320320
if (!as_unicode) {
321321
#endif
322-
ZVAL_STRINGL(zv, to, length, 1);
323-
efree(to); /* allocated by spprintf */
322+
ZVAL_STRINGL(zv, value, length, 1);
323+
efree(value); /* allocated by spprintf */
324324
#if MYSQLND_UNICODE
325325
} else {
326-
ZVAL_UTF8_STRINGL(zv, to, length, ZSTR_AUTOFREE);
326+
ZVAL_UTF8_STRINGL(zv, value, length, ZSTR_AUTOFREE);
327327
}
328328
#endif
329329
DBG_VOID_RETURN;
@@ -339,7 +339,7 @@ void ps_fetch_datetime(zval *zv, const MYSQLND_FIELD * const field,
339339
{
340340
struct st_mysqlnd_time t;
341341
unsigned int length; /* First byte encodes the length*/
342-
char *to;
342+
char * value;
343343
DBG_ENTER("ps_fetch_datetime");
344344

345345
if ((length = php_mysqlnd_net_field_length(row))) {
@@ -371,15 +371,15 @@ void ps_fetch_datetime(zval *zv, const MYSQLND_FIELD * const field,
371371
QQ : How to make this unicode without copying two times the buffer -
372372
Unicode equivalent of spprintf?
373373
*/
374-
length = spprintf(&to, 0, "%04u-%02u-%02u %02u:%02u:%02u",
374+
length = spprintf(&value, 0, "%04u-%02u-%02u %02u:%02u:%02u",
375375
t.year, t.month, t.day, t.hour, t.minute, t.second);
376376

377-
DBG_INF_FMT("%s", to);
377+
DBG_INF_FMT("%s", value);
378378
#if MYSQLND_UNICODE
379379
if (!as_unicode) {
380380
#endif
381-
ZVAL_STRINGL(zv, to, length, 1);
382-
efree(to); /* allocated by spprintf */
381+
ZVAL_STRINGL(zv, value, length, 1);
382+
efree(value); /* allocated by spprintf */
383383
#if MYSQLND_UNICODE
384384
} else {
385385
ZVAL_UTF8_STRINGL(zv, to, length, ZSTR_AUTOFREE);

0 commit comments

Comments
 (0)