andrey                                   Wed, 06 Oct 2010 06:08:55 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=304131

Log:
fix shadowing of parameters

Changed paths:
    U   php/php-src/branches/PHP_5_3/ext/mysqli/mysqli.c
    U   php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_priv.h
    U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps_codec.c
    U   php/php-src/trunk/ext/mysqli/mysqli.c
    U   php/php-src/trunk/ext/mysqli/mysqli_priv.h
    U   php/php-src/trunk/ext/mysqlnd/mysqlnd_ps_codec.c

Modified: php/php-src/branches/PHP_5_3/ext/mysqli/mysqli.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqli/mysqli.c	2010-10-06 00:44:53 UTC (rev 304130)
+++ php/php-src/branches/PHP_5_3/ext/mysqli/mysqli.c	2010-10-06 06:08:55 UTC (rev 304131)
@@ -1274,12 +1274,12 @@
 			fci.retval_ptr_ptr = &retval_ptr;
 			if (ctor_params && Z_TYPE_P(ctor_params) != IS_NULL) {
 				if (Z_TYPE_P(ctor_params) == IS_ARRAY) {
-					HashTable *ht = Z_ARRVAL_P(ctor_params);
+					HashTable *params_ht = Z_ARRVAL_P(ctor_params);
 					Bucket *p;

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

Modified: php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_priv.h
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_priv.h	2010-10-06 00:44:53 UTC (rev 304130)
+++ php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_priv.h	2010-10-06 06:08:55 UTC (rev 304131)
@@ -79,10 +79,10 @@
 #endif

 #define REGISTER_MYSQLI_CLASS_ENTRY(name, mysqli_entry, class_functions) { \
-	zend_class_entry ce; \
-	INIT_CLASS_ENTRY(ce, name,class_functions); \
-	ce.create_object = mysqli_objects_new; \
-	mysqli_entry = zend_register_internal_class(&ce TSRMLS_CC); \
+	zend_class_entry tmp_ce; \
+	INIT_CLASS_ENTRY(tmp_ce, name,class_functions); \
+	tmp_ce.create_object = mysqli_objects_new; \
+	mysqli_entry = zend_register_internal_class(&tmp_ce TSRMLS_CC); \
 } \

 #define PHP_MYSQLI_EXPORT(__type) PHP_MYSQLI_API __type

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps_codec.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps_codec.c	2010-10-06 00:44:53 UTC (rev 304130)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps_codec.c	2010-10-06 06:08:55 UTC (rev 304131)
@@ -231,7 +231,7 @@
 {
 	struct st_mysqlnd_time t;
 	unsigned int length; /* First byte encodes the length*/
-	char *to;
+	char * value;
 	DBG_ENTER("ps_fetch_time");

 	if ((length = php_mysqlnd_net_field_length(row))) {
@@ -262,17 +262,17 @@
 	  QQ : How to make this unicode without copying two times the buffer -
 	  Unicode equivalent of spprintf?
 	*/
-	length = spprintf(&to, 0, "%s%02u:%02u:%02u", (t.neg ? "-" : ""), t.hour, t.minute, t.second);
+	length = spprintf(&value, 0, "%s%02u:%02u:%02u", (t.neg ? "-" : ""), t.hour, t.minute, t.second);

-	DBG_INF_FMT("%s", to);
+	DBG_INF_FMT("%s", value);
 #if MYSQLND_UNICODE
 	if (!as_unicode) {
 #endif
-		ZVAL_STRINGL(zv, to, length, 1);
-		efree(to);  /* allocated by spprintf */
+		ZVAL_STRINGL(zv, value, length, 1);
+		efree(value);  /* allocated by spprintf */
 #if MYSQLND_UNICODE
 	} else {
-		ZVAL_UTF8_STRINGL(zv, to, length, ZSTR_AUTOFREE);
+		ZVAL_UTF8_STRINGL(zv, value, length, ZSTR_AUTOFREE);
 	}
 #endif
 	DBG_VOID_RETURN;
@@ -288,7 +288,7 @@
 {
 	struct st_mysqlnd_time t = {0};
 	unsigned int length; /* First byte encodes the length*/
-	char *to;
+	char * value;
 	DBG_ENTER("ps_fetch_date");

 	if ((length = php_mysqlnd_net_field_length(row))) {
@@ -313,17 +313,17 @@
 	  QQ : How to make this unicode without copying two times the buffer -
 	  Unicode equivalent of spprintf?
 	*/
-	length = spprintf(&to, 0, "%04u-%02u-%02u", t.year, t.month, t.day);
+	length = spprintf(&value, 0, "%04u-%02u-%02u", t.year, t.month, t.day);

-	DBG_INF_FMT("%s", to);
+	DBG_INF_FMT("%s", value);
 #if MYSQLND_UNICODE
 	if (!as_unicode) {
 #endif
-		ZVAL_STRINGL(zv, to, length, 1);
-		efree(to); /* allocated by spprintf */
+		ZVAL_STRINGL(zv, value, length, 1);
+		efree(value); /* allocated by spprintf */
 #if MYSQLND_UNICODE
 	} else {
-		ZVAL_UTF8_STRINGL(zv, to, length, ZSTR_AUTOFREE);
+		ZVAL_UTF8_STRINGL(zv, value, length, ZSTR_AUTOFREE);
 	}
 #endif
 	DBG_VOID_RETURN;
@@ -339,7 +339,7 @@
 {
 	struct st_mysqlnd_time t;
 	unsigned int length; /* First byte encodes the length*/
-	char *to;
+	char * value;
 	DBG_ENTER("ps_fetch_datetime");

 	if ((length = php_mysqlnd_net_field_length(row))) {
@@ -371,15 +371,15 @@
 	  QQ : How to make this unicode without copying two times the buffer -
 	  Unicode equivalent of spprintf?
 	*/
-	length = spprintf(&to, 0, "%04u-%02u-%02u %02u:%02u:%02u",
+	length = spprintf(&value, 0, "%04u-%02u-%02u %02u:%02u:%02u",
 					  t.year, t.month, t.day, t.hour, t.minute, t.second);

-	DBG_INF_FMT("%s", to);
+	DBG_INF_FMT("%s", value);
 #if MYSQLND_UNICODE
 	if (!as_unicode) {
 #endif
-		ZVAL_STRINGL(zv, to, length, 1);
-		efree(to); /* allocated by spprintf */
+		ZVAL_STRINGL(zv, value, length, 1);
+		efree(value); /* allocated by spprintf */
 #if MYSQLND_UNICODE
 	} else {
 		ZVAL_UTF8_STRINGL(zv, to, length, ZSTR_AUTOFREE);

Modified: php/php-src/trunk/ext/mysqli/mysqli.c
===================================================================
--- php/php-src/trunk/ext/mysqli/mysqli.c	2010-10-06 00:44:53 UTC (rev 304130)
+++ php/php-src/trunk/ext/mysqli/mysqli.c	2010-10-06 06:08:55 UTC (rev 304131)
@@ -1235,12 +1235,12 @@
 			fci.retval_ptr_ptr = &retval_ptr;
 			if (ctor_params && Z_TYPE_P(ctor_params) != IS_NULL) {
 				if (Z_TYPE_P(ctor_params) == IS_ARRAY) {
-					HashTable *ht = Z_ARRVAL_P(ctor_params);
+					HashTable *params_ht = Z_ARRVAL_P(ctor_params);
 					Bucket *p;

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

Modified: php/php-src/trunk/ext/mysqli/mysqli_priv.h
===================================================================
--- php/php-src/trunk/ext/mysqli/mysqli_priv.h	2010-10-06 00:44:53 UTC (rev 304130)
+++ php/php-src/trunk/ext/mysqli/mysqli_priv.h	2010-10-06 06:08:55 UTC (rev 304131)
@@ -79,10 +79,10 @@
 #endif

 #define REGISTER_MYSQLI_CLASS_ENTRY(name, mysqli_entry, class_functions) { \
-	zend_class_entry ce; \
-	INIT_CLASS_ENTRY(ce, name,class_functions); \
-	ce.create_object = mysqli_objects_new; \
-	mysqli_entry = zend_register_internal_class(&ce TSRMLS_CC); \
+	zend_class_entry tmp_ce; \
+	INIT_CLASS_ENTRY(tmp_ce, name,class_functions); \
+	tmp_ce.create_object = mysqli_objects_new; \
+	mysqli_entry = zend_register_internal_class(&tmp_ce TSRMLS_CC); \
 } \

 #define PHP_MYSQLI_EXPORT(__type) PHP_MYSQLI_API __type

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_ps_codec.c
===================================================================
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_ps_codec.c	2010-10-06 00:44:53 UTC (rev 304130)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_ps_codec.c	2010-10-06 06:08:55 UTC (rev 304131)
@@ -231,7 +231,7 @@
 {
 	struct st_mysqlnd_time t;
 	unsigned int length; /* First byte encodes the length*/
-	char *to;
+	char * value;
 	DBG_ENTER("ps_fetch_time");

 	if ((length = php_mysqlnd_net_field_length(row))) {
@@ -262,17 +262,17 @@
 	  QQ : How to make this unicode without copying two times the buffer -
 	  Unicode equivalent of spprintf?
 	*/
-	length = spprintf(&to, 0, "%s%02u:%02u:%02u", (t.neg ? "-" : ""), t.hour, t.minute, t.second);
+	length = spprintf(&value, 0, "%s%02u:%02u:%02u", (t.neg ? "-" : ""), t.hour, t.minute, t.second);

-	DBG_INF_FMT("%s", to);
+	DBG_INF_FMT("%s", value);
 #if MYSQLND_UNICODE
 	if (!as_unicode) {
 #endif
-		ZVAL_STRINGL(zv, to, length, 1);
-		efree(to);  /* allocated by spprintf */
+		ZVAL_STRINGL(zv, value, length, 1);
+		efree(value);  /* allocated by spprintf */
 #if MYSQLND_UNICODE
 	} else {
-		ZVAL_UTF8_STRINGL(zv, to, length, ZSTR_AUTOFREE);
+		ZVAL_UTF8_STRINGL(zv, value, length, ZSTR_AUTOFREE);
 	}
 #endif
 	DBG_VOID_RETURN;
@@ -288,7 +288,7 @@
 {
 	struct st_mysqlnd_time t = {0};
 	unsigned int length; /* First byte encodes the length*/
-	char *to;
+	char * value;
 	DBG_ENTER("ps_fetch_date");

 	if ((length = php_mysqlnd_net_field_length(row))) {
@@ -313,17 +313,17 @@
 	  QQ : How to make this unicode without copying two times the buffer -
 	  Unicode equivalent of spprintf?
 	*/
-	length = spprintf(&to, 0, "%04u-%02u-%02u", t.year, t.month, t.day);
+	length = spprintf(&value, 0, "%04u-%02u-%02u", t.year, t.month, t.day);

-	DBG_INF_FMT("%s", to);
+	DBG_INF_FMT("%s", value);
 #if MYSQLND_UNICODE
 	if (!as_unicode) {
 #endif
-		ZVAL_STRINGL(zv, to, length, 1);
-		efree(to); /* allocated by spprintf */
+		ZVAL_STRINGL(zv, value, length, 1);
+		efree(value); /* allocated by spprintf */
 #if MYSQLND_UNICODE
 	} else {
-		ZVAL_UTF8_STRINGL(zv, to, length, ZSTR_AUTOFREE);
+		ZVAL_UTF8_STRINGL(zv, value, length, ZSTR_AUTOFREE);
 	}
 #endif
 	DBG_VOID_RETURN;
@@ -339,7 +339,7 @@
 {
 	struct st_mysqlnd_time t;
 	unsigned int length; /* First byte encodes the length*/
-	char *to;
+	char * value;
 	DBG_ENTER("ps_fetch_datetime");

 	if ((length = php_mysqlnd_net_field_length(row))) {
@@ -371,15 +371,15 @@
 	  QQ : How to make this unicode without copying two times the buffer -
 	  Unicode equivalent of spprintf?
 	*/
-	length = spprintf(&to, 0, "%04u-%02u-%02u %02u:%02u:%02u",
+	length = spprintf(&value, 0, "%04u-%02u-%02u %02u:%02u:%02u",
 					  t.year, t.month, t.day, t.hour, t.minute, t.second);

-	DBG_INF_FMT("%s", to);
+	DBG_INF_FMT("%s", value);
 #if MYSQLND_UNICODE
 	if (!as_unicode) {
 #endif
-		ZVAL_STRINGL(zv, to, length, 1);
-		efree(to); /* allocated by spprintf */
+		ZVAL_STRINGL(zv, value, length, 1);
+		efree(value); /* allocated by spprintf */
 #if MYSQLND_UNICODE
 	} else {
 		ZVAL_UTF8_STRINGL(zv, to, length, ZSTR_AUTOFREE);
-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to