@@ -112,7 +112,7 @@ static HashTable *umsg_get_numeric_types(MessageFormatter_object *mfo,
112
112
113
113
for (int i = 0 ; i < parts_count; i++) {
114
114
const Formattable::Type t = types[i];
115
- if (zend_hash_index_update_mem (ret, (ulong )i, (void *)&t, sizeof (t)) == NULL ) {
115
+ if (zend_hash_index_update_mem (ret, (php_uint_t )i, (void *)&t, sizeof (t)) == NULL ) {
116
116
intl_errors_set (&err, U_MEMORY_ALLOCATION_ERROR,
117
117
" Write to argument types hash table failed" , 0 TSRMLS_CC);
118
118
break ;
@@ -200,10 +200,10 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
200
200
" Found part with negative number" , 0 TSRMLS_CC);
201
201
continue ;
202
202
}
203
- if ((storedType = (Formattable::Type*)zend_hash_index_find_ptr (ret, (ulong )argNumber)) == NULL ) {
203
+ if ((storedType = (Formattable::Type*)zend_hash_index_find_ptr (ret, (php_uint_t )argNumber)) == NULL ) {
204
204
/* not found already; create new entry in HT */
205
205
Formattable::Type bogusType = Formattable::kObject ;
206
- if ((storedType = (Formattable::Type*)zend_hash_index_update_mem (ret, (ulong )argNumber, (void *)&bogusType, sizeof (bogusType))) == NULL ) {
206
+ if ((storedType = (Formattable::Type*)zend_hash_index_update_mem (ret, (php_uint_t )argNumber, (void *)&bogusType, sizeof (bogusType))) == NULL ) {
207
207
intl_errors_set (&err, U_MEMORY_ALLOCATION_ERROR,
208
208
" Write to argument types hash table failed" , 0 TSRMLS_CC);
209
209
continue ;
@@ -401,7 +401,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
401
401
/* Process key and retrieve type */
402
402
if (str_index == NULL ) {
403
403
/* includes case where index < 0 because it's exposed as unsigned */
404
- if (num_index > (ulong )INT32_MAX) {
404
+ if (num_index > (php_uint_t )INT32_MAX) {
405
405
intl_errors_set (&err, U_ILLEGAL_ARGUMENT_ERROR,
406
406
" Found negative or too large array key" , 0 TSRMLS_CC);
407
407
continue ;
@@ -411,7 +411,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
411
411
int32_t len = u_sprintf (temp, " %u" , (uint32_t )num_index);
412
412
key.append (temp, len);
413
413
414
- storedArgType = (Formattable::Type*)zend_hash_index_find_ptr (types, (ulong )num_index);
414
+ storedArgType = (Formattable::Type*)zend_hash_index_find_ptr (types, (php_uint_t )num_index);
415
415
} else { // string; assumed to be in UTF-8
416
416
intl_stringFromChar (key, str_index->val , str_index->len , &err.code );
417
417
@@ -663,10 +663,10 @@ U_CFUNC void umsg_parse_helper(UMessageFormat *fmt, int *count, zval **args, UCh
663
663
664
664
case Formattable::kInt64 :
665
665
aInt64 = fargs[i].getInt64 ();
666
- if (aInt64 > LONG_MAX || aInt64 < -LONG_MAX ) {
666
+ if (aInt64 > PHP_INT_MAX || aInt64 < -PHP_INT_MAX ) {
667
667
ZVAL_DOUBLE (&(*args)[i], (double )aInt64);
668
668
} else {
669
- ZVAL_INT (&(*args)[i], (long )aInt64);
669
+ ZVAL_INT (&(*args)[i], (php_int_t )aInt64);
670
670
}
671
671
break ;
672
672
0 commit comments