summaryrefslogtreecommitdiff
path: root/ext/intl/msgformat/msgformat_helpers.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ext/intl/msgformat/msgformat_helpers.cpp')
-rw-r--r--ext/intl/msgformat/msgformat_helpers.cpp30
1 files changed, 15 insertions, 15 deletions
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;