felipe Fri Mar 27 19:50:56 2009 UTC
Modified files:
/php-src/ext/mysqlnd mysqlnd_palloc.c
/php-src/main snprintf.c
/php-src/sapi/cli php_cli_readline.c
Log:
- Removed leftover UG(unicode) checks
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_palloc.c?r1=1.16&r2=1.17&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_palloc.c
diff -u php-src/ext/mysqlnd/mysqlnd_palloc.c:1.16
php-src/ext/mysqlnd/mysqlnd_palloc.c:1.17
--- php-src/ext/mysqlnd/mysqlnd_palloc.c:1.16 Fri Mar 27 19:28:26 2009
+++ php-src/ext/mysqlnd/mysqlnd_palloc.c Fri Mar 27 19:50:56 2009
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mysqlnd_palloc.c,v 1.16 2009/03/27 19:28:26 felipe Exp $ */
+/* $Id: mysqlnd_palloc.c,v 1.17 2009/03/27 19:50:56 felipe Exp $ */
#include "php.h"
#include "mysqlnd.h"
#include "mysqlnd_priv.h"
@@ -544,48 +544,45 @@
{
if (cache) {
#if PHP_MAJOR_VERSION >= 6
+ UChar *ustr;
+ int ulen;
+
TSRMLS_FETCH();
#endif
LOCK_PCACHE(cache);
array_init(return_value);
#if PHP_MAJOR_VERSION >= 6
- if (UG(unicode)) {
- UChar *ustr;
- int ulen;
-
- zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen,
"put_hits", sizeof("put_hits") TSRMLS_CC);
- add_u_assoc_long_ex(return_value, IS_UNICODE,
ZSTR(ustr), ulen + 1, cache->put_hits);
- efree(ustr);
- zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen,
"put_misses", sizeof("put_misses") TSRMLS_CC);
- add_u_assoc_long_ex(return_value, IS_UNICODE,
ZSTR(ustr), ulen + 1, cache->put_hits);
- efree(ustr);
- zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen,
"get_hits", sizeof("get_hits") TSRMLS_CC);
- add_u_assoc_long_ex(return_value, IS_UNICODE,
ZSTR(ustr), ulen + 1, cache->put_hits);
- efree(ustr);
- zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen,
"get_misses", sizeof("get_misses") TSRMLS_CC);
- add_u_assoc_long_ex(return_value, IS_UNICODE,
ZSTR(ustr), ulen + 1, cache->put_hits);
- efree(ustr);
- zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen,
"size", sizeof("size") TSRMLS_CC);
- add_u_assoc_long_ex(return_value, IS_UNICODE,
ZSTR(ustr), ulen + 1, cache->put_hits);
- efree(ustr);
- zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen,
"free_items", sizeof("free_items") TSRMLS_CC);
- add_u_assoc_long_ex(return_value, IS_UNICODE,
ZSTR(ustr), ulen + 1, cache->put_hits);
- efree(ustr);
- zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen,
"references", sizeof("references") TSRMLS_CC);
- add_u_assoc_long_ex(return_value, IS_UNICODE,
ZSTR(ustr), ulen + 1, cache->put_hits);
- efree(ustr);
- } else
+ zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen, "put_hits",
sizeof("put_hits") TSRMLS_CC);
+ add_u_assoc_long_ex(return_value, IS_UNICODE, ZSTR(ustr), ulen
+ 1, cache->put_hits);
+ efree(ustr);
+ zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen,
"put_misses", sizeof("put_misses") TSRMLS_CC);
+ add_u_assoc_long_ex(return_value, IS_UNICODE, ZSTR(ustr), ulen
+ 1, cache->put_hits);
+ efree(ustr);
+ zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen, "get_hits",
sizeof("get_hits") TSRMLS_CC);
+ add_u_assoc_long_ex(return_value, IS_UNICODE, ZSTR(ustr), ulen
+ 1, cache->put_hits);
+ efree(ustr);
+ zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen,
"get_misses", sizeof("get_misses") TSRMLS_CC);
+ add_u_assoc_long_ex(return_value, IS_UNICODE, ZSTR(ustr), ulen
+ 1, cache->put_hits);
+ efree(ustr);
+ zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen, "size",
sizeof("size") TSRMLS_CC);
+ add_u_assoc_long_ex(return_value, IS_UNICODE, ZSTR(ustr), ulen
+ 1, cache->put_hits);
+ efree(ustr);
+ zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen,
"free_items", sizeof("free_items") TSRMLS_CC);
+ add_u_assoc_long_ex(return_value, IS_UNICODE, ZSTR(ustr), ulen
+ 1, cache->put_hits);
+ efree(ustr);
+ zend_string_to_unicode(UG(utf8_conv), &ustr, &ulen,
"references", sizeof("references") TSRMLS_CC);
+ add_u_assoc_long_ex(return_value, IS_UNICODE, ZSTR(ustr), ulen
+ 1, cache->put_hits);
+ efree(ustr);
+#else
+ add_assoc_long_ex(return_value, "put_hits",
sizeof("put_hits"), cache->put_hits);
+ add_assoc_long_ex(return_value, "put_misses",
sizeof("put_misses"), cache->put_misses);
+ add_assoc_long_ex(return_value, "get_hits",
sizeof("get_hits"), cache->get_hits);
+ add_assoc_long_ex(return_value, "get_misses",
sizeof("get_misses"), cache->get_misses);
+ add_assoc_long_ex(return_value, "size",
sizeof("size"), cache->max_items);
+ add_assoc_long_ex(return_value, "free_items",
sizeof("free_items"), cache->free_items);
+ add_assoc_long_ex(return_value, "references",
sizeof("references"), cache->references);
#endif
- {
- add_assoc_long_ex(return_value, "put_hits",
sizeof("put_hits"), cache->put_hits);
- add_assoc_long_ex(return_value, "put_misses",
sizeof("put_misses"), cache->put_misses);
- add_assoc_long_ex(return_value, "get_hits",
sizeof("get_hits"), cache->get_hits);
- add_assoc_long_ex(return_value, "get_misses",
sizeof("get_misses"), cache->get_misses);
- add_assoc_long_ex(return_value, "size",
sizeof("size"), cache->max_items);
- add_assoc_long_ex(return_value, "free_items",
sizeof("free_items"), cache->free_items);
- add_assoc_long_ex(return_value, "references",
sizeof("references"), cache->references);
- }
UNLOCK_PCACHE(cache);
} else {
ZVAL_NULL(return_value);
http://cvs.php.net/viewvc.cgi/php-src/main/snprintf.c?r1=1.68&r2=1.69&diff_format=u
Index: php-src/main/snprintf.c
diff -u php-src/main/snprintf.c:1.68 php-src/main/snprintf.c:1.69
--- php-src/main/snprintf.c:1.68 Tue Mar 10 23:39:53 2009
+++ php-src/main/snprintf.c Fri Mar 27 19:50:56 2009
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: snprintf.c,v 1.68 2009/03/10 23:39:53 helly Exp $ */
+/* $Id: snprintf.c,v 1.69 2009/03/27 19:50:56 felipe Exp $ */
#include "php.h"
@@ -957,11 +957,7 @@
break;
case 'v':
- if (UG(unicode)) {
- goto fmt_unicode;
- } else {
- goto fmt_string;
- }
+ goto fmt_unicode;
break;
case 'R':
http://cvs.php.net/viewvc.cgi/php-src/sapi/cli/php_cli_readline.c?r1=1.16&r2=1.17&diff_format=u
Index: php-src/sapi/cli/php_cli_readline.c
diff -u php-src/sapi/cli/php_cli_readline.c:1.16
php-src/sapi/cli/php_cli_readline.c:1.17
--- php-src/sapi/cli/php_cli_readline.c:1.16 Tue Mar 10 23:40:02 2009
+++ php-src/sapi/cli/php_cli_readline.c Fri Mar 27 19:50:56 2009
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_cli_readline.c,v 1.16 2009/03/10 23:40:02 helly Exp $ */
+/* $Id: php_cli_readline.c,v 1.17 2009/03/27 19:50:56 felipe Exp $ */
#include "php.h"
@@ -286,7 +286,7 @@
}
while(zend_hash_has_more_elements(ht) == SUCCESS) {
zend_hash_get_current_key(ht, &name, &number, 0);
- if (!textlen || (UG(unicode) ?
!zend_cmp_unicode_and_string(name.u, (char *)text, textlen) : !strncmp(name.s,
text, textlen))) {
+ if (!textlen || !zend_cmp_unicode_and_string(name.u, (char
*)text, textlen)) {
if (pData) {
zend_hash_get_current_data(ht, pData);
}
@@ -307,25 +307,18 @@
tmp = retval = cli_completion_generator_ht(text + 1, textlen - 1,
state, EG(active_symbol_table), NULL TSRMLS_CC);
if (retval) {
- if (UG(unicode)) {
- int32_t tmp_len, len;
- UErrorCode status = U_ZERO_ERROR;
-
- len = u_strlen((UChar *)retval);
-
zend_unicode_to_string_ex(ZEND_U_CONVERTER(UG(output_encoding_conv)), &tmp,
&tmp_len,
-
(UChar *)retval, len, &status);
-
- retval = malloc(tmp_len + 2);
- retval[0] = '$';
- strcpy(&retval[1], tmp);
- rl_completion_append_character = '\0';
- efree(tmp);
- } else {
- retval = malloc(strlen(tmp) + 2);
- retval[0] = '$';
- strcpy(&retval[1], tmp);
- rl_completion_append_character = '\0';
- }
+ int32_t tmp_len, len;
+ UErrorCode status = U_ZERO_ERROR;
+
+ len = u_strlen((UChar *)retval);
+
zend_unicode_to_string_ex(ZEND_U_CONVERTER(UG(output_encoding_conv)), &tmp,
&tmp_len,
+ (UChar
*)retval, len, &status);
+
+ retval = malloc(tmp_len + 2);
+ retval[0] = '$';
+ strcpy(&retval[1], tmp);
+ rl_completion_append_character = '\0';
+ efree(tmp);
}
return retval;
} /* }}} */
@@ -337,22 +330,18 @@
retval = cli_completion_generator_ht(text, textlen, state, ht,
(void**)&func TSRMLS_CC);
if (retval) {
- rl_completion_append_character = '(';
+ char *tmp;
+ int32_t tmp_len, len;
+ UErrorCode status = U_ZERO_ERROR;
+
+ rl_completion_append_character = '(';
+
+ len = u_strlen((UChar *)func->common.function_name.u);
+
zend_unicode_to_string_ex(ZEND_U_CONVERTER(UG(output_encoding_conv)), &tmp,
&tmp_len,
+ (UChar
*)func->common.function_name.u, len, &status);
- if (UG(unicode)) {
- char *tmp;
- int32_t tmp_len, len;
- UErrorCode status = U_ZERO_ERROR;
-
- len = u_strlen((UChar *)func->common.function_name.u);
-
zend_unicode_to_string_ex(ZEND_U_CONVERTER(UG(output_encoding_conv)), &tmp,
&tmp_len,
-
(UChar *)func->common.function_name.u, len, &status);
-
- retval = strdup(tmp);
- efree(tmp);
- } else {
- retval = strdup(func->common.function_name.s);
- }
+ retval = strdup(tmp);
+ efree(tmp);
}
return retval;
@@ -363,22 +352,18 @@
zend_class_entry **pce;
char *retval = cli_completion_generator_ht(text, textlen, state,
EG(class_table), (void**)&pce TSRMLS_CC);
if (retval) {
+ char *tmp;
+ int32_t tmp_len, len;
+ UErrorCode status = U_ZERO_ERROR;
+
rl_completion_append_character = '\0';
- if (UG(unicode)) {
- char *tmp;
- int32_t tmp_len, len;
- UErrorCode status = U_ZERO_ERROR;
-
- len = u_strlen((UChar *)(*pce)->name.u);
-
zend_unicode_to_string_ex(ZEND_U_CONVERTER(UG(output_encoding_conv)), &tmp,
&tmp_len,
-
(UChar *)(*pce)->name.u, len, &status);
+ len = u_strlen((UChar *)(*pce)->name.u);
+
zend_unicode_to_string_ex(ZEND_U_CONVERTER(UG(output_encoding_conv)), &tmp,
&tmp_len,
+ (UChar
*)(*pce)->name.u, len, &status);
- retval = strdup(tmp);
- efree(tmp);
- } else {
- retval = strdup((*pce)->name.s);
- }
+ retval = strdup(tmp);
+ efree(tmp);
}
return retval;
@@ -389,22 +374,18 @@
zend_class_entry **pce;
char *retval = cli_completion_generator_ht(text, textlen, state, ht,
(void**)&pce TSRMLS_CC);
if (retval) {
+ char *tmp;
+ int32_t tmp_len, len;
+ UErrorCode status = U_ZERO_ERROR;
+
rl_completion_append_character = '\0';
- if (UG(unicode)) {
- char *tmp;
- int32_t tmp_len, len;
- UErrorCode status = U_ZERO_ERROR;
-
- len = u_strlen((UChar *)retval);
-
zend_unicode_to_string_ex(ZEND_U_CONVERTER(UG(output_encoding_conv)), &tmp,
&tmp_len,
-
(UChar *)retval, len, &status);
+ len = u_strlen((UChar *)retval);
+
zend_unicode_to_string_ex(ZEND_U_CONVERTER(UG(output_encoding_conv)), &tmp,
&tmp_len,
+ (UChar
*)retval, len, &status);
- retval = strdup(tmp);
- efree(tmp);
- } else {
- retval = strdup(retval);
- }
+ retval = strdup(tmp);
+ efree(tmp);
}
return retval;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php