@@ -328,7 +328,7 @@ static void umsg_set_timezone(MessageFormatter_object *mfo,
328328
329329 formats = mf->getFormats (count);
330330
331- if (formats == NULL ) {
331+ if (UNEXPECTED ( formats == NULL ) ) {
332332 intl_errors_set (&err, U_MEMORY_ALLOCATION_ERROR,
333333 " Out of memory retrieving subformats" , 0 );
334334 }
@@ -403,7 +403,7 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
403403 /* Process key and retrieve type */
404404 if (str_index == NULL ) {
405405 /* includes case where index < 0 because it's exposed as unsigned */
406- if (num_index > (zend_ulong)INT32_MAX) {
406+ if (UNEXPECTED ( num_index > (zend_ulong)INT32_MAX) ) {
407407 intl_errors_set (&err, U_ILLEGAL_ARGUMENT_ERROR,
408408 " Found negative or too large array key" , 0 );
409409 continue ;
@@ -477,17 +477,17 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
477477 int32_t tInt32 = 0 ;
478478
479479 if (Z_TYPE_P (elem) == IS_DOUBLE) {
480- if (Z_DVAL_P (elem) > (double )INT32_MAX ||
481- Z_DVAL_P (elem) < (double )INT32_MIN) {
480+ if (UNEXPECTED ( Z_DVAL_P (elem) > (double )INT32_MAX ||
481+ Z_DVAL_P (elem) < (double )INT32_MIN)) {
482482 intl_errors_set (&err, U_ILLEGAL_ARGUMENT_ERROR,
483483 " Found PHP float with absolute value too large for "
484484 " 32 bit integer argument" , 0 );
485485 } else {
486486 tInt32 = (int32_t )Z_DVAL_P (elem);
487487 }
488488 } else if (Z_TYPE_P (elem) == IS_LONG) {
489- if (Z_LVAL_P (elem) > INT32_MAX ||
490- Z_LVAL_P (elem) < INT32_MIN) {
489+ if (UNEXPECTED ( Z_LVAL_P (elem) > INT32_MAX ||
490+ Z_LVAL_P (elem) < INT32_MIN)) {
491491 intl_errors_set (&err, U_ILLEGAL_ARGUMENT_ERROR,
492492 " Found PHP integer with absolute value too large "
493493 " for 32 bit integer argument" , 0 );
@@ -505,8 +505,8 @@ U_CFUNC void umsg_format_helper(MessageFormatter_object *mfo,
505505 int64_t tInt64 = 0 ;
506506
507507 if (Z_TYPE_P (elem) == IS_DOUBLE) {
508- if (Z_DVAL_P (elem) > (double )U_INT64_MAX ||
509- Z_DVAL_P (elem) < (double )U_INT64_MIN) {
508+ if (UNEXPECTED ( Z_DVAL_P (elem) > (double )U_INT64_MAX ||
509+ Z_DVAL_P (elem) < (double )U_INT64_MIN)) {
510510 intl_errors_set (&err, U_ILLEGAL_ARGUMENT_ERROR,
511511 " Found PHP float with absolute value too large for "
512512 " 64 bit integer argument" , 0 );
0 commit comments