@@ -112,7 +112,7 @@ static HashTable *umsg_get_numeric_types(MessageFormatter_object *mfo,
112112
113113 for (int i = 0 ; i < parts_count; i++) {
114114 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 ) {
116116 intl_errors_set (&err, U_MEMORY_ALLOCATION_ERROR,
117117 " Write to argument types hash table failed" , 0 TSRMLS_CC);
118118 break ;
@@ -200,10 +200,10 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
200200 " Found part with negative number" , 0 TSRMLS_CC);
201201 continue ;
202202 }
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 ) {
204204 /* not found already; create new entry in HT */
205205 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 ) {
207207 intl_errors_set (&err, U_MEMORY_ALLOCATION_ERROR,
208208 " Write to argument types hash table failed" , 0 TSRMLS_CC);
209209 continue ;
@@ -401,7 +401,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
401401 /* Process key and retrieve type */
402402 if (str_index == NULL ) {
403403 /* 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) {
405405 intl_errors_set (&err, U_ILLEGAL_ARGUMENT_ERROR,
406406 " Found negative or too large array key" , 0 TSRMLS_CC);
407407 continue ;
@@ -411,7 +411,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
411411 int32_t len = u_sprintf (temp, " %u" , (uint32_t )num_index);
412412 key.append (temp, len);
413413
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);
415415 } else { // string; assumed to be in UTF-8
416416 intl_stringFromChar (key, str_index->val , str_index->len , &err.code );
417417
@@ -663,10 +663,10 @@ U_CFUNC void umsg_parse_helper(UMessageFormat *fmt, int *count, zval **args, UCh
663663
664664 case Formattable::kInt64 :
665665 aInt64 = fargs[i].getInt64 ();
666- if (aInt64 > LONG_MAX || aInt64 < -LONG_MAX ) {
666+ if (aInt64 > PHP_INT_MAX || aInt64 < -PHP_INT_MAX ) {
667667 ZVAL_DOUBLE (&(*args)[i], (double )aInt64);
668668 } else {
669- ZVAL_INT (&(*args)[i], (long )aInt64);
669+ ZVAL_INT (&(*args)[i], (php_int_t )aInt64);
670670 }
671671 break ;
672672
0 commit comments