jani            Sat Nov  1 23:09:31 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/gettext        gettext.c 
  Log:
  MFH
  
http://cvs.php.net/viewvc.cgi/php-src/ext/gettext/gettext.c?r1=1.46.2.2.2.4.2.6&r2=1.46.2.2.2.4.2.7&diff_format=u
Index: php-src/ext/gettext/gettext.c
diff -u php-src/ext/gettext/gettext.c:1.46.2.2.2.4.2.6 
php-src/ext/gettext/gettext.c:1.46.2.2.2.4.2.7
--- php-src/ext/gettext/gettext.c:1.46.2.2.2.4.2.6      Thu Oct 30 14:22:50 2008
+++ php-src/ext/gettext/gettext.c       Sat Nov  1 23:09:31 2008
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: gettext.c,v 1.46.2.2.2.4.2.6 2008/10/30 14:22:50 lstrojny Exp $ */
+/* $Id: gettext.c,v 1.46.2.2.2.4.2.7 2008/11/01 23:09:31 jani Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -144,27 +144,12 @@
                RETURN_FALSE; \
        }
 
-#define PHP_GETTEXT_MSGID_LENGTH_CHECK \
-       char *check_name = "msgid"; \
-       int check_len   = msgid_len; \
-       PHP_GETTEXT_LENGTH_CHECK
-
-#define PHP_GETTEXT_LENGTH_CHECK \
+#define PHP_GETTEXT_LENGTH_CHECK(check_name, check_len) \
        if (check_len > PHP_GETTEXT_MAX_MSGID_LENGTH) { \
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s passed too 
long", check_name); \
                RETURN_FALSE; \
        }
 
-#define PHP_GETTEXT_MULTI_MSGID_LENGTH_CHECK \
-       int check_len; \
-       char *check_name; \
-       check_name = "msgid1"; \
-       check_len = msgid1_len; \
-       PHP_GETTEXT_LENGTH_CHECK \
-       check_name = "msgid2"; \
-       check_len = msgid2_len; \
-       PHP_GETTEXT_LENGTH_CHECK
-
 PHP_MINFO_FUNCTION(php_gettext)
 {
        php_info_print_table_start();
@@ -208,7 +193,7 @@
                return;
        }
 
-       PHP_GETTEXT_MSGID_LENGTH_CHECK
+       PHP_GETTEXT_LENGTH_CHECK("msgid", msgid_len)
        msgstr = gettext(msgid);
 
        RETURN_STRING(msgstr, 1);
@@ -227,7 +212,7 @@
        }
 
        PHP_GETTEXT_DOMAIN_LENGTH_CHECK
-       PHP_GETTEXT_MSGID_LENGTH_CHECK
+       PHP_GETTEXT_LENGTH_CHECK("msgid", msgid_len)
 
        msgstr = dgettext(domain, msgid);
 
@@ -248,7 +233,7 @@
        }
 
        PHP_GETTEXT_DOMAIN_LENGTH_CHECK
-       PHP_GETTEXT_MSGID_LENGTH_CHECK
+       PHP_GETTEXT_LENGTH_CHECK("msgid", msgid_len)
 
        msgstr = dcgettext(domain, msgid, category);
 
@@ -302,7 +287,8 @@
                return;
        }
 
-       PHP_GETTEXT_MULTI_MSGID_LENGTH_CHECK
+       PHP_GETTEXT_LENGTH_CHECK("msgid1", msgid1_len)
+       PHP_GETTEXT_LENGTH_CHECK("msgid2", msgid2_len)
 
        msgstr = ngettext(msgid1, msgid2, count);
        if (msgstr) {
@@ -327,7 +313,8 @@
        }
 
        PHP_GETTEXT_DOMAIN_LENGTH_CHECK
-       PHP_GETTEXT_MULTI_MSGID_LENGTH_CHECK
+       PHP_GETTEXT_LENGTH_CHECK("msgid1", msgid1_len)
+       PHP_GETTEXT_LENGTH_CHECK("msgid2", msgid2_len)
 
        msgstr = dngettext(domain, msgid1, msgid2, count);
        if (msgstr) {
@@ -354,7 +341,8 @@
        }
 
        PHP_GETTEXT_DOMAIN_LENGTH_CHECK
-       PHP_GETTEXT_MULTI_MSGID_LENGTH_CHECK
+       PHP_GETTEXT_LENGTH_CHECK("msgid1", msgid1_len)
+       PHP_GETTEXT_LENGTH_CHECK("msgid2", msgid2_len)
 
        msgstr = dcngettext(domain, msgid1, msgid2, count, category);
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to