From 05593baf9ac50429bb4b5a0edbfca18e64e33820 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Sat, 24 Aug 2013 07:02:28 -0700 Subject: Z_STRLEN vs Z_STRSIZE in ext/intl --- ext/intl/msgformat/msgformat_helpers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/intl/msgformat/msgformat_helpers.cpp') diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp index c4456d54f3..ad855e384b 100644 --- a/ext/intl/msgformat/msgformat_helpers.cpp +++ b/ext/intl/msgformat/msgformat_helpers.cpp @@ -454,7 +454,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo, UnicodeString *text = new UnicodeString(); intl_stringFromChar(*text, - Z_STRVAL_PP(elem), Z_STRLEN_PP(elem), &err.code); + Z_STRVAL_PP(elem), Z_STRSIZE_PP(elem), &err.code); if (U_FAILURE(err.code)) { char *message; -- cgit v1.2.1 From 52a74bbdd64e03a606e4f6bfc95600362a4d2276 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Sat, 24 Aug 2013 07:32:28 -0700 Subject: more fixes to ext/intl --- ext/intl/msgformat/msgformat_helpers.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ext/intl/msgformat/msgformat_helpers.cpp') diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp index ad855e384b..9f9e0235e4 100644 --- a/ext/intl/msgformat/msgformat_helpers.cpp +++ b/ext/intl/msgformat/msgformat_helpers.cpp @@ -388,7 +388,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo, // Key related variables int key_type; char *str_index; - uint str_len; + zend_str_size_uint str_len; ulong num_index; for (zend_hash_internal_pointer_reset_ex(args, &pos); @@ -544,7 +544,7 @@ retry_kint64: double dd = intl_zval_to_millis(*elem, &err, "msgfmt_format" TSRMLS_CC); if (U_FAILURE(err.code)) { char *message, *key_char; - int key_len; + zend_str_size_int key_len; UErrorCode status = UErrorCode(); if (intl_charFromString(key, &key_char, &key_len, &status) == SUCCESS) { @@ -587,7 +587,7 @@ retry_kint64: default: { char *message, *key_char; - int key_len; + zend_str_size_int key_len; UErrorCode status = UErrorCode(); if (intl_charFromString(key, &key_char, &key_len, &status) == SUCCESS) { @@ -650,7 +650,7 @@ U_CFUNC void umsg_parse_helper(UMessageFormat *fmt, int *count, zval ***args, UC double aDate; UnicodeString temp; char *stmp; - int stmp_len; + zend_str_size_int stmp_len; ALLOC_INIT_ZVAL((*args)[i]); -- cgit v1.2.1 From a45082e78d710a9f302efaf817400438759f6b23 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 25 Nov 2013 21:59:09 +0100 Subject: fixed ext/intl --- ext/intl/msgformat/msgformat_helpers.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/intl/msgformat/msgformat_helpers.cpp') diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp index 72e27fd80d..320b68b674 100644 --- a/ext/intl/msgformat/msgformat_helpers.cpp +++ b/ext/intl/msgformat/msgformat_helpers.cpp @@ -392,7 +392,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo, int key_type; char *str_index; zend_str_size_uint str_len; - ulong num_index; + php_uint_t num_index; for (zend_hash_internal_pointer_reset_ex(args, &pos); U_SUCCESS(err.code) && @@ -676,7 +676,7 @@ U_CFUNC void umsg_parse_helper(UMessageFormat *fmt, int *count, zval ***args, UC if(aInt64 > LONG_MAX || aInt64 < -LONG_MAX) { ZVAL_DOUBLE((*args)[i], (double)aInt64); } else { - ZVAL_LONG((*args)[i], (long)aInt64); + ZVAL_LONG((*args)[i], (php_int_t)aInt64); } break; -- cgit v1.2.1 From af362b20c6c78f966e76f8523be43284d03d531e Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Wed, 18 Dec 2013 15:07:30 -0800 Subject: zend_size_t for *.cpp files as well --- ext/intl/msgformat/msgformat_helpers.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ext/intl/msgformat/msgformat_helpers.cpp') diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp index 320b68b674..50fd19c757 100644 --- a/ext/intl/msgformat/msgformat_helpers.cpp +++ b/ext/intl/msgformat/msgformat_helpers.cpp @@ -391,7 +391,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo, // Key related variables int key_type; char *str_index; - zend_str_size_uint str_len; + php_size_t str_len; php_uint_t num_index; for (zend_hash_internal_pointer_reset_ex(args, &pos); @@ -547,7 +547,7 @@ retry_kint64: double dd = intl_zval_to_millis(*elem, &err, "msgfmt_format" TSRMLS_CC); if (U_FAILURE(err.code)) { char *message, *key_char; - zend_str_size_int key_len; + php_size_t key_len; UErrorCode status = UErrorCode(); if (intl_charFromString(key, &key_char, &key_len, &status) == SUCCESS) { @@ -590,7 +590,7 @@ retry_kint64: default: { char *message, *key_char; - zend_str_size_int key_len; + php_size_t key_len; UErrorCode status = UErrorCode(); if (intl_charFromString(key, &key_char, &key_len, &status) == SUCCESS) { @@ -653,7 +653,7 @@ U_CFUNC void umsg_parse_helper(UMessageFormat *fmt, int *count, zval ***args, UC double aDate; UnicodeString temp; char *stmp; - zend_str_size_int stmp_len; + php_size_t stmp_len; ALLOC_INIT_ZVAL((*args)[i]); -- cgit v1.2.1 From f58d0b35edf25a8f39fad6bd5e0e4eeb5cdfe9a7 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Thu, 19 Dec 2013 05:07:37 -0800 Subject: massive update semantical LONG vs INT replacements --- ext/intl/msgformat/msgformat_helpers.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'ext/intl/msgformat/msgformat_helpers.cpp') diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp index 50fd19c757..6f886d91c9 100644 --- a/ext/intl/msgformat/msgformat_helpers.cpp +++ b/ext/intl/msgformat/msgformat_helpers.cpp @@ -408,7 +408,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo, *storedArgType = NULL; /* Process key and retrieve type */ - if (key_type == HASH_KEY_IS_LONG) { + if (key_type == HASH_KEY_IS_INT) { /* includes case where index < 0 because it's exposed as unsigned */ if (num_index > (ulong)INT32_MAX) { intl_errors_set(&err, U_ILLEGAL_ARGUMENT_ERROR, @@ -476,14 +476,14 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo, double d; if (Z_TYPE_PP(elem) == IS_DOUBLE) { d = Z_DVAL_PP(elem); - } else if (Z_TYPE_PP(elem) == IS_LONG) { - d = (double)Z_LVAL_PP(elem); + } else if (Z_TYPE_PP(elem) == IS_INT) { + d = (double)Z_IVAL_PP(elem); } else { SEPARATE_ZVAL_IF_NOT_REF(elem); convert_scalar_to_number(*elem TSRMLS_CC); d = (Z_TYPE_PP(elem) == IS_DOUBLE) ? Z_DVAL_PP(elem) - : (double)Z_LVAL_PP(elem); + : (double)Z_IVAL_PP(elem); } formattable.setDouble(d); break; @@ -501,14 +501,14 @@ retry_klong: } else { tInt32 = (int32_t)Z_DVAL_PP(elem); } - } else if (Z_TYPE_PP(elem) == IS_LONG) { - if (Z_LVAL_PP(elem) > INT32_MAX || - Z_LVAL_PP(elem) < INT32_MIN) { + } else if (Z_TYPE_PP(elem) == IS_INT) { + if (Z_IVAL_PP(elem) > INT32_MAX || + Z_IVAL_PP(elem) < INT32_MIN) { intl_errors_set(&err, U_ILLEGAL_ARGUMENT_ERROR, "Found PHP integer with absolute value too large " "for 32 bit integer argument", 0 TSRMLS_CC); } else { - tInt32 = (int32_t)Z_LVAL_PP(elem); + tInt32 = (int32_t)Z_IVAL_PP(elem); } } else { SEPARATE_ZVAL_IF_NOT_REF(elem); @@ -531,9 +531,9 @@ retry_kint64: } else { tInt64 = (int64_t)Z_DVAL_PP(elem); } - } else if (Z_TYPE_PP(elem) == IS_LONG) { + } else if (Z_TYPE_PP(elem) == IS_INT) { /* assume long is not wider than 64 bits */ - tInt64 = (int64_t)Z_LVAL_PP(elem); + tInt64 = (int64_t)Z_IVAL_PP(elem); } else { SEPARATE_ZVAL_IF_NOT_REF(elem); convert_scalar_to_number(*elem TSRMLS_CC); @@ -576,10 +576,10 @@ retry_kint64: formattable.setDouble(Z_DVAL_PP(elem)); break; case IS_BOOL: - convert_to_long_ex(elem); + convert_to_int_ex(elem); /* Intentional fallthrough */ - case IS_LONG: - formattable.setInt64((int64_t)Z_LVAL_PP(elem)); + case IS_INT: + formattable.setInt64((int64_t)Z_IVAL_PP(elem)); break; case IS_NULL: formattable.setInt64((int64_t)0); @@ -668,7 +668,7 @@ U_CFUNC void umsg_parse_helper(UMessageFormat *fmt, int *count, zval ***args, UC break; case Formattable::kLong: - ZVAL_LONG((*args)[i], fargs[i].getLong()); + ZVAL_INT((*args)[i], fargs[i].getLong()); break; case Formattable::kInt64: @@ -676,7 +676,7 @@ U_CFUNC void umsg_parse_helper(UMessageFormat *fmt, int *count, zval ***args, UC if(aInt64 > LONG_MAX || aInt64 < -LONG_MAX) { ZVAL_DOUBLE((*args)[i], (double)aInt64); } else { - ZVAL_LONG((*args)[i], (php_int_t)aInt64); + ZVAL_INT((*args)[i], (php_int_t)aInt64); } break; -- cgit v1.2.1 From 63d3f0b844b3a5f1c94be3c97bca29235dc2b3fc Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Tue, 19 Aug 2014 08:07:31 +0200 Subject: basic macro replacements, all at once --- ext/intl/msgformat/msgformat_helpers.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'ext/intl/msgformat/msgformat_helpers.cpp') diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp index ba5a5df001..a23f9e87cb 100644 --- a/ext/intl/msgformat/msgformat_helpers.cpp +++ b/ext/intl/msgformat/msgformat_helpers.cpp @@ -447,7 +447,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo, UnicodeString *text = new UnicodeString(); intl_stringFromChar(*text, - Z_STRVAL_P(elem), Z_STRLEN_P(elem), &err.code); + Z_STRVAL_P(elem), Z_STRSIZE_P(elem), &err.code); if (U_FAILURE(err.code)) { char *message; @@ -466,14 +466,14 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo, double d; if (Z_TYPE_P(elem) == IS_DOUBLE) { d = Z_DVAL_P(elem); - } else if (Z_TYPE_P(elem) == IS_LONG) { - d = (double)Z_LVAL_P(elem); + } else if (Z_TYPE_P(elem) == IS_INT) { + d = (double)Z_IVAL_P(elem); } else { SEPARATE_ZVAL_IF_NOT_REF(elem); convert_scalar_to_number(elem TSRMLS_CC); d = (Z_TYPE_P(elem) == IS_DOUBLE) ? Z_DVAL_P(elem) - : (double)Z_LVAL_P(elem); + : (double)Z_IVAL_P(elem); } formattable.setDouble(d); break; @@ -491,14 +491,14 @@ retry_klong: } else { tInt32 = (int32_t)Z_DVAL_P(elem); } - } else if (Z_TYPE_P(elem) == IS_LONG) { - if (Z_LVAL_P(elem) > INT32_MAX || - Z_LVAL_P(elem) < INT32_MIN) { + } else if (Z_TYPE_P(elem) == IS_INT) { + if (Z_IVAL_P(elem) > INT32_MAX || + Z_IVAL_P(elem) < INT32_MIN) { intl_errors_set(&err, U_ILLEGAL_ARGUMENT_ERROR, "Found PHP integer with absolute value too large " "for 32 bit integer argument", 0 TSRMLS_CC); } else { - tInt32 = (int32_t)Z_LVAL_P(elem); + tInt32 = (int32_t)Z_IVAL_P(elem); } } else { SEPARATE_ZVAL_IF_NOT_REF(elem); @@ -521,9 +521,9 @@ retry_kint64: } else { tInt64 = (int64_t)Z_DVAL_P(elem); } - } else if (Z_TYPE_P(elem) == IS_LONG) { + } else if (Z_TYPE_P(elem) == IS_INT) { /* assume long is not wider than 64 bits */ - tInt64 = (int64_t)Z_LVAL_P(elem); + tInt64 = (int64_t)Z_IVAL_P(elem); } else { SEPARATE_ZVAL_IF_NOT_REF(elem); convert_scalar_to_number(elem TSRMLS_CC); @@ -567,10 +567,10 @@ retry_kint64: break; case IS_TRUE: case IS_FALSE: - convert_to_long_ex(elem); + convert_to_int_ex(elem); /* Intentional fallthrough */ - case IS_LONG: - formattable.setInt64((int64_t)Z_LVAL_P(elem)); + case IS_INT: + formattable.setInt64((int64_t)Z_IVAL_P(elem)); break; case IS_NULL: formattable.setInt64((int64_t)0); @@ -658,7 +658,7 @@ U_CFUNC void umsg_parse_helper(UMessageFormat *fmt, int *count, zval **args, UCh break; case Formattable::kLong: - ZVAL_LONG(&(*args)[i], fargs[i].getLong()); + ZVAL_INT(&(*args)[i], fargs[i].getLong()); break; case Formattable::kInt64: @@ -666,7 +666,7 @@ U_CFUNC void umsg_parse_helper(UMessageFormat *fmt, int *count, zval **args, UCh if(aInt64 > LONG_MAX || aInt64 < -LONG_MAX) { ZVAL_DOUBLE(&(*args)[i], (double)aInt64); } else { - ZVAL_LONG(&(*args)[i], (long)aInt64); + ZVAL_INT(&(*args)[i], (long)aInt64); } break; -- cgit v1.2.1 From 063079b62e383036dd24cd6465d3db31edf6cb6d Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Tue, 19 Aug 2014 22:57:17 +0200 Subject: ported ext/intl, bugfixes to go --- ext/intl/msgformat/msgformat_helpers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/intl/msgformat/msgformat_helpers.cpp') diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp index a23f9e87cb..571fab2a4d 100644 --- a/ext/intl/msgformat/msgformat_helpers.cpp +++ b/ext/intl/msgformat/msgformat_helpers.cpp @@ -388,7 +388,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo, // Key related variables zend_string *str_index; - ulong num_index; + php_uint_t num_index; ZEND_HASH_FOREACH_KEY_VAL(args, num_index, str_index, elem) { Formattable& formattable = fargs[argNum]; -- cgit v1.2.1 From 888ef26cc5e03b19729c1e5fa4993fd6a9febb3f Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Wed, 20 Aug 2014 22:54:00 +0200 Subject: yet trivial fixes --- ext/intl/msgformat/msgformat_helpers.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'ext/intl/msgformat/msgformat_helpers.cpp') diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp index 571fab2a4d..3be80791ba 100644 --- a/ext/intl/msgformat/msgformat_helpers.cpp +++ b/ext/intl/msgformat/msgformat_helpers.cpp @@ -112,7 +112,7 @@ static HashTable *umsg_get_numeric_types(MessageFormatter_object *mfo, for (int i = 0; i < parts_count; i++) { const Formattable::Type t = types[i]; - if (zend_hash_index_update_mem(ret, (ulong)i, (void*)&t, sizeof(t)) == NULL) { + if (zend_hash_index_update_mem(ret, (php_uint_t)i, (void*)&t, sizeof(t)) == NULL) { intl_errors_set(&err, U_MEMORY_ALLOCATION_ERROR, "Write to argument types hash table failed", 0 TSRMLS_CC); break; @@ -200,10 +200,10 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo, "Found part with negative number", 0 TSRMLS_CC); continue; } - if ((storedType = (Formattable::Type*)zend_hash_index_find_ptr(ret, (ulong)argNumber)) == NULL) { + if ((storedType = (Formattable::Type*)zend_hash_index_find_ptr(ret, (php_uint_t)argNumber)) == NULL) { /* not found already; create new entry in HT */ Formattable::Type bogusType = Formattable::kObject; - if ((storedType = (Formattable::Type*)zend_hash_index_update_mem(ret, (ulong)argNumber, (void*)&bogusType, sizeof(bogusType))) == NULL) { + if ((storedType = (Formattable::Type*)zend_hash_index_update_mem(ret, (php_uint_t)argNumber, (void*)&bogusType, sizeof(bogusType))) == NULL) { intl_errors_set(&err, U_MEMORY_ALLOCATION_ERROR, "Write to argument types hash table failed", 0 TSRMLS_CC); continue; @@ -401,7 +401,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo, /* Process key and retrieve type */ if (str_index == NULL) { /* includes case where index < 0 because it's exposed as unsigned */ - if (num_index > (ulong)INT32_MAX) { + if (num_index > (php_uint_t)INT32_MAX) { intl_errors_set(&err, U_ILLEGAL_ARGUMENT_ERROR, "Found negative or too large array key", 0 TSRMLS_CC); continue; @@ -411,7 +411,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo, int32_t len = u_sprintf(temp, "%u", (uint32_t)num_index); key.append(temp, len); - storedArgType = (Formattable::Type*)zend_hash_index_find_ptr(types, (ulong)num_index); + storedArgType = (Formattable::Type*)zend_hash_index_find_ptr(types, (php_uint_t)num_index); } else { //string; assumed to be in UTF-8 intl_stringFromChar(key, str_index->val, str_index->len, &err.code); @@ -663,10 +663,10 @@ U_CFUNC void umsg_parse_helper(UMessageFormat *fmt, int *count, zval **args, UCh case Formattable::kInt64: aInt64 = fargs[i].getInt64(); - if(aInt64 > LONG_MAX || aInt64 < -LONG_MAX) { + if(aInt64 > PHP_INT_MAX || aInt64 < -PHP_INT_MAX) { ZVAL_DOUBLE(&(*args)[i], (double)aInt64); } else { - ZVAL_INT(&(*args)[i], (long)aInt64); + ZVAL_INT(&(*args)[i], (php_int_t)aInt64); } break; -- cgit v1.2.1 From c3e3c98ec666812daaaca896cf5ef758a8a6df14 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 25 Aug 2014 19:24:55 +0200 Subject: master renames phase 1 --- ext/intl/msgformat/msgformat_helpers.cpp | 40 ++++++++++++++++---------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'ext/intl/msgformat/msgformat_helpers.cpp') diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp index 3be80791ba..50527b7f06 100644 --- a/ext/intl/msgformat/msgformat_helpers.cpp +++ b/ext/intl/msgformat/msgformat_helpers.cpp @@ -112,7 +112,7 @@ static HashTable *umsg_get_numeric_types(MessageFormatter_object *mfo, for (int i = 0; i < parts_count; i++) { const Formattable::Type t = types[i]; - if (zend_hash_index_update_mem(ret, (php_uint_t)i, (void*)&t, sizeof(t)) == NULL) { + if (zend_hash_index_update_mem(ret, (zend_ulong)i, (void*)&t, sizeof(t)) == NULL) { intl_errors_set(&err, U_MEMORY_ALLOCATION_ERROR, "Write to argument types hash table failed", 0 TSRMLS_CC); break; @@ -200,10 +200,10 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo, "Found part with negative number", 0 TSRMLS_CC); continue; } - if ((storedType = (Formattable::Type*)zend_hash_index_find_ptr(ret, (php_uint_t)argNumber)) == NULL) { + if ((storedType = (Formattable::Type*)zend_hash_index_find_ptr(ret, (zend_ulong)argNumber)) == NULL) { /* not found already; create new entry in HT */ Formattable::Type bogusType = Formattable::kObject; - if ((storedType = (Formattable::Type*)zend_hash_index_update_mem(ret, (php_uint_t)argNumber, (void*)&bogusType, sizeof(bogusType))) == NULL) { + if ((storedType = (Formattable::Type*)zend_hash_index_update_mem(ret, (zend_ulong)argNumber, (void*)&bogusType, sizeof(bogusType))) == NULL) { intl_errors_set(&err, U_MEMORY_ALLOCATION_ERROR, "Write to argument types hash table failed", 0 TSRMLS_CC); continue; @@ -388,7 +388,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo, // Key related variables zend_string *str_index; - php_uint_t num_index; + zend_ulong num_index; ZEND_HASH_FOREACH_KEY_VAL(args, num_index, str_index, elem) { Formattable& formattable = fargs[argNum]; @@ -401,7 +401,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo, /* Process key and retrieve type */ if (str_index == NULL) { /* includes case where index < 0 because it's exposed as unsigned */ - if (num_index > (php_uint_t)INT32_MAX) { + if (num_index > (zend_ulong)INT32_MAX) { intl_errors_set(&err, U_ILLEGAL_ARGUMENT_ERROR, "Found negative or too large array key", 0 TSRMLS_CC); continue; @@ -411,7 +411,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo, int32_t len = u_sprintf(temp, "%u", (uint32_t)num_index); key.append(temp, len); - storedArgType = (Formattable::Type*)zend_hash_index_find_ptr(types, (php_uint_t)num_index); + storedArgType = (Formattable::Type*)zend_hash_index_find_ptr(types, (zend_ulong)num_index); } else { //string; assumed to be in UTF-8 intl_stringFromChar(key, str_index->val, str_index->len, &err.code); @@ -447,7 +447,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo, UnicodeString *text = new UnicodeString(); intl_stringFromChar(*text, - Z_STRVAL_P(elem), Z_STRSIZE_P(elem), &err.code); + Z_STRVAL_P(elem), Z_STRLEN_P(elem), &err.code); if (U_FAILURE(err.code)) { char *message; @@ -466,14 +466,14 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo, double d; if (Z_TYPE_P(elem) == IS_DOUBLE) { d = Z_DVAL_P(elem); - } else if (Z_TYPE_P(elem) == IS_INT) { - d = (double)Z_IVAL_P(elem); + } else if (Z_TYPE_P(elem) == IS_LONG) { + d = (double)Z_LVAL_P(elem); } else { SEPARATE_ZVAL_IF_NOT_REF(elem); convert_scalar_to_number(elem TSRMLS_CC); d = (Z_TYPE_P(elem) == IS_DOUBLE) ? Z_DVAL_P(elem) - : (double)Z_IVAL_P(elem); + : (double)Z_LVAL_P(elem); } formattable.setDouble(d); break; @@ -491,14 +491,14 @@ retry_klong: } else { tInt32 = (int32_t)Z_DVAL_P(elem); } - } else if (Z_TYPE_P(elem) == IS_INT) { - if (Z_IVAL_P(elem) > INT32_MAX || - Z_IVAL_P(elem) < INT32_MIN) { + } else if (Z_TYPE_P(elem) == IS_LONG) { + if (Z_LVAL_P(elem) > INT32_MAX || + Z_LVAL_P(elem) < INT32_MIN) { intl_errors_set(&err, U_ILLEGAL_ARGUMENT_ERROR, "Found PHP integer with absolute value too large " "for 32 bit integer argument", 0 TSRMLS_CC); } else { - tInt32 = (int32_t)Z_IVAL_P(elem); + tInt32 = (int32_t)Z_LVAL_P(elem); } } else { SEPARATE_ZVAL_IF_NOT_REF(elem); @@ -521,9 +521,9 @@ retry_kint64: } else { tInt64 = (int64_t)Z_DVAL_P(elem); } - } else if (Z_TYPE_P(elem) == IS_INT) { + } else if (Z_TYPE_P(elem) == IS_LONG) { /* assume long is not wider than 64 bits */ - tInt64 = (int64_t)Z_IVAL_P(elem); + tInt64 = (int64_t)Z_LVAL_P(elem); } else { SEPARATE_ZVAL_IF_NOT_REF(elem); convert_scalar_to_number(elem TSRMLS_CC); @@ -569,8 +569,8 @@ retry_kint64: case IS_FALSE: convert_to_int_ex(elem); /* Intentional fallthrough */ - case IS_INT: - formattable.setInt64((int64_t)Z_IVAL_P(elem)); + case IS_LONG: + formattable.setInt64((int64_t)Z_LVAL_P(elem)); break; case IS_NULL: formattable.setInt64((int64_t)0); @@ -658,7 +658,7 @@ U_CFUNC void umsg_parse_helper(UMessageFormat *fmt, int *count, zval **args, UCh break; case Formattable::kLong: - ZVAL_INT(&(*args)[i], fargs[i].getLong()); + ZVAL_LONG(&(*args)[i], fargs[i].getLong()); break; case Formattable::kInt64: @@ -666,7 +666,7 @@ U_CFUNC void umsg_parse_helper(UMessageFormat *fmt, int *count, zval **args, UCh if(aInt64 > PHP_INT_MAX || aInt64 < -PHP_INT_MAX) { ZVAL_DOUBLE(&(*args)[i], (double)aInt64); } else { - ZVAL_INT(&(*args)[i], (php_int_t)aInt64); + ZVAL_LONG(&(*args)[i], (zend_long)aInt64); } break; -- cgit v1.2.1 From 4d997f63d98c663b2d9acccd3655572652f61c7d Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 25 Aug 2014 20:22:49 +0200 Subject: master renames phase 3 --- ext/intl/msgformat/msgformat_helpers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/intl/msgformat/msgformat_helpers.cpp') diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp index 50527b7f06..466db01731 100644 --- a/ext/intl/msgformat/msgformat_helpers.cpp +++ b/ext/intl/msgformat/msgformat_helpers.cpp @@ -663,7 +663,7 @@ U_CFUNC void umsg_parse_helper(UMessageFormat *fmt, int *count, zval **args, UCh case Formattable::kInt64: aInt64 = fargs[i].getInt64(); - if(aInt64 > PHP_INT_MAX || aInt64 < -PHP_INT_MAX) { + if(aInt64 > ZEND_LONG_MAX || aInt64 < -ZEND_LONG_MAX) { ZVAL_DOUBLE(&(*args)[i], (double)aInt64); } else { ZVAL_LONG(&(*args)[i], (zend_long)aInt64); -- cgit v1.2.1 From af59e92b24c8f624672720d47ef65bd8457728b9 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 25 Aug 2014 21:51:49 +0200 Subject: master renames phase 7 --- ext/intl/msgformat/msgformat_helpers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/intl/msgformat/msgformat_helpers.cpp') diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp index 466db01731..c0c204cc69 100644 --- a/ext/intl/msgformat/msgformat_helpers.cpp +++ b/ext/intl/msgformat/msgformat_helpers.cpp @@ -567,7 +567,7 @@ retry_kint64: break; case IS_TRUE: case IS_FALSE: - convert_to_int_ex(elem); + convert_to_long_ex(elem); /* Intentional fallthrough */ case IS_LONG: formattable.setInt64((int64_t)Z_LVAL_P(elem)); -- cgit v1.2.1