com php-src: Hint the compiler: ext/gettext/gettext.c

From: Date: Fri, 15 May 2015 14:57:17 +0000
Subject: com php-src: Hint the compiler: ext/gettext/gettext.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-86774@lists.php.net to get a copy of this message
Commit: 48f3f44f3200cf7284322f80cc34511866b3d5f5 Author: Xinchen Hui <laruence@php.net> Fri, 15 May 2015 22:57:17 +0800 Parents: a4640457263e2e6abaa2df3c66fae89ccca9257f Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=48f3f44f3200cf7284322f80cc34511866b3d5f5 Log: Hint the compiler Changed paths: M ext/gettext/gettext.c Diff: diff --git a/ext/gettext/gettext..c b/ext/gettext/gettext.c index 90038fa..4450272 100644 --- a/ext/gettext/gettext.c +++ b/ext/gettext/gettext.c @@ -139,13 +139,13 @@ ZEND_GET_MODULE(php_gettext) #define PHP_GETTEXT_MAX_MSGID_LENGTH 4096 #define PHP_GETTEXT_DOMAIN_LENGTH_CHECK \ - if (domain_len > PHP_GETTEXT_MAX_DOMAIN_LENGTH) { \ + if (UNEXPECTED(domain_len > PHP_GETTEXT_MAX_DOMAIN_LENGTH)) { \ php_error_docref(NULL, E_WARNING, "domain passed too long"); \ RETURN_FALSE; \ } #define PHP_GETTEXT_LENGTH_CHECK(check_name, check_len) \ - if (check_len > PHP_GETTEXT_MAX_MSGID_LENGTH) { \ + if (UNEXPECTED(check_len > PHP_GETTEXT_MAX_MSGID_LENGTH)) { \ php_error_docref(NULL, E_WARNING, "%s passed too long", check_name); \ RETURN_FALSE; \ }

« previous php.cvs (#86774) next »