]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Use streq.
authorBruno Haible <bruno@clisp.org>
Thu, 7 May 2026 21:26:47 +0000 (23:26 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 7 May 2026 21:26:47 +0000 (23:26 +0200)
* autogen.sh (GNULIB_MODULES_RUNTIME_FOR_SRC, GNULIB_MODULES_TOOLS_FOR_SRC,
GNULIB_MODULES_LIBGETTEXTPO): Add streq.
* gettext-runtime/src/envsubst.c (string_list_member): Use streq instead of
strcmp.
* gettext-tools/src/cldr-plural.y (yylex): Likewise.
* gettext-tools/src/file-list.c (read_names_from_file): Likewise.
* gettext-tools/src/format-java.c (message_format_parse): Likewise.
* gettext-tools/src/format-ocaml.c (parse_upto, format_check): Likewise.
* gettext-tools/src/format-perl-brace.c (format_parse): Likewise.
* gettext-tools/src/format-python.c (format_parse, format_check): Likewise.
* gettext-tools/src/format-python-brace.c (format_parse): Likewise.
* gettext-tools/src/format-ruby.c (format_parse, format_check): Likewise.
* gettext-tools/src/format-rust.c (format_parse): Likewise.
* gettext-tools/src/format-sh.c (format_parse): Likewise.
* gettext-tools/src/its.c: Include <string.h>.
(its_value_list_get_value, its_value_list_set_value, its_value_list_merge,
its_preserve_space_rule_constructor, its_extension_escape_rule_eval,
its_rule_list_is_translatable, its_rule_list_extract_text,
_its_copy_node_with_attributes, its_merge_context_merge_node): Use streq instead
of strcmp.
* gettext-tools/src/message.c (message_comment_filepos, message_list_search,
fuzzy_search_goal_function, msgdomain_list_sublist): Likewise.
* gettext-tools/src/msgexec.c (main, process_string): Likewise.
* gettext-tools/src/msgfilter.c (main): Likewise.
* gettext-tools/src/msgfmt.c (main, new_domain): Likewise.
* gettext-tools/src/msginit.c (main, catalogname_for_locale,
englishname_of_language, project_id, project_id_version,
language_team_englishname, plural_forms, get_title): Likewise.
* gettext-tools/src/msgl-cat.c (catenate_msgdomain_list): Likewise.
* gettext-tools/src/msgl-charset.c (check_pot_charset,
compare_po_locale_charsets): Likewise.
* gettext-tools/src/msgl-equal.c (pos_equal, string_list_equal, message_equal,
msgdomain_equal): Likewise.
* gettext-tools/src/msgl-header.c (msgdomain_list_set_header_field): Likewise.
* gettext-tools/src/msgl-iconv.c (iconv_message_list_internal,
iconv_msgdomain_list, is_message_list_iconvable): Likewise.
* gettext-tools/src/msgl-merge.c (message_merge): Likewise.
* gettext-tools/src/msgpre.c (main): Likewise.
* gettext-tools/src/open-catalog.c (try_open_catalog_file): Likewise.
* gettext-tools/src/po-charset.c (po_charset_ascii_compatible,
po_is_charset_weird, po_is_charset_weird_cjk, po_charset_character_iterator):
Likewise.
* gettext-tools/src/read-csharp.c: Include <string.h>.
(msgdomain_read_csharp): Use streq instead of strcmp.
* gettext-tools/src/read-mo.c (read_mo_file): Likewise.
* gettext-tools/src/read-po-lex.c (po_lex_charset_set, keyword_p): Likewise.
* gettext-tools/src/read-stringtable.c (comment_line_end, stringtable_parse):
Likewise.
* gettext-tools/src/spit.c (englishname_of_language, englishname_of_country,
language_in_english, main): Likewise.
* gettext-tools/src/str-list.c (string_list_append_unique, string_list_member,
string_list_remove): Likewise.
* gettext-tools/src/write-catalog.c (msgdomain_list_print): Likewise.
* gettext-tools/src/write-csharp.c (msgdomain_write_csharp): Likewise.
* gettext-tools/src/write-desktop.c: Include <string.h>.
(msgdomain_write_desktop_bulk): Use streq instead of strcmp.
* gettext-tools/src/write-mo.c (msgdomain_write_mo): Likewise.
* gettext-tools/src/write-po.c (message_print_comment_filepos,
handle_filepos_comment_option, msgdomain_list_print_po): Likewise.
* gettext-tools/src/write-qt.c (msgdomain_write_qt): Likewise.
* gettext-tools/src/write-xml.c: Include <string.h>.
(msgdomain_write_xml_bulk): Use streq instead of strcmp.
* gettext-tools/src/x-awk.c (phase3_get, extract_parenthesized): Likewise.
* gettext-tools/src/x-c.c (phase6_get): Likewise.
* gettext-tools/src/x-go.c (scan_import_spec, get_type_from_type_name,
get_type_from_type_node, variable_env_lookup, type_equals,
get_mvtypes_of_expression, extract_from_function_call): Likewise.
* gettext-tools/src/x-java.c (extract_parenthesized): Likewise.
* gettext-tools/src/x-javascript.c (get_tag_step1_fn, phase5_get): Likewise.
* gettext-tools/src/x-lua.c: Include <string.h>.
(phase3_get): Use streq instead of strcmp.
* gettext-tools/src/x-perl.c (get_here_document, x_perl_prelex, x_perl_lex):
Likewise.
* gettext-tools/src/x-rst.c: Include <string.h>.
(extract_rsj): Use streq instead of strcmp.
* gettext-tools/src/x-sh.c (read_command): Likewise.
* gettext-tools/src/x-smalltalk.c: Include <string.h>.
(phase4_get, extract_smalltalk): Use streq instead of strcmp.
* gettext-tools/src/x-vala.c (phase3_get, extract_balanced): Likewise.
* gettext-tools/src/xg-arglist-parser.c (arglist_parser_done): Likewise.
* gettext-tools/src/xg-message.c: Include <string.h>.
(remember_a_message): Use streq instead of strcmp.
* gettext-tools/src/xgettext.c (main, xgettext_record_flag, xgettext_open,
language_to_extractor, extension_to_language): Likewise.

54 files changed:
autogen.sh
gettext-runtime/src/envsubst.c
gettext-tools/src/cldr-plural.y
gettext-tools/src/file-list.c
gettext-tools/src/format-java.c
gettext-tools/src/format-ocaml.c
gettext-tools/src/format-perl-brace.c
gettext-tools/src/format-python-brace.c
gettext-tools/src/format-python.c
gettext-tools/src/format-ruby.c
gettext-tools/src/format-rust.c
gettext-tools/src/format-sh.c
gettext-tools/src/its.c
gettext-tools/src/message.c
gettext-tools/src/msgexec.c
gettext-tools/src/msgfilter.c
gettext-tools/src/msgfmt.c
gettext-tools/src/msginit.c
gettext-tools/src/msgl-cat.c
gettext-tools/src/msgl-charset.c
gettext-tools/src/msgl-equal.c
gettext-tools/src/msgl-header.c
gettext-tools/src/msgl-iconv.c
gettext-tools/src/msgl-merge.c
gettext-tools/src/msgpre.c
gettext-tools/src/open-catalog.c
gettext-tools/src/po-charset.c
gettext-tools/src/read-csharp.c
gettext-tools/src/read-mo.c
gettext-tools/src/read-po-lex.c
gettext-tools/src/read-stringtable.c
gettext-tools/src/spit.c
gettext-tools/src/str-list.c
gettext-tools/src/write-catalog.c
gettext-tools/src/write-csharp.c
gettext-tools/src/write-desktop.c
gettext-tools/src/write-mo.c
gettext-tools/src/write-po.c
gettext-tools/src/write-qt.c
gettext-tools/src/write-xml.c
gettext-tools/src/x-awk.c
gettext-tools/src/x-c.c
gettext-tools/src/x-go.c
gettext-tools/src/x-java.c
gettext-tools/src/x-javascript.c
gettext-tools/src/x-lua.c
gettext-tools/src/x-perl.c
gettext-tools/src/x-rst.c
gettext-tools/src/x-sh.c
gettext-tools/src/x-smalltalk.c
gettext-tools/src/x-vala.c
gettext-tools/src/xg-arglist-parser.c
gettext-tools/src/xg-message.c
gettext-tools/src/xgettext.c

index 0199f7f0c4c1284932b50375b7c1ca2ccc1c86d3..92b8055e41dc0753c1805b2a7122e95f52c830a4 100755 (executable)
@@ -122,6 +122,7 @@ if ! $skip_gnulib; then
     stdint-h
     stdio-h
     stdlib-h
+    streq
     strtoimax
     strtold
     strtoul
@@ -271,6 +272,7 @@ if ! $skip_gnulib; then
     str_startswith
     strchrnul
     strcspn
+    streq
     strerror
     string-desc
     strnlen
@@ -527,6 +529,7 @@ if ! $skip_gnulib; then
     stpncpy
     str_startswith
     strchrnul
+    streq
     strerror
     string-desc
     strnlen
index 4ff05d9d5daec715f1c96b1632cff969ca12a382..f5b59bd8a5f7e9bfd878ea73054d303c41a029f5 100644 (file)
@@ -363,7 +363,7 @@ MAYBE_UNUSED static inline int
 string_list_member (const string_list_ty *slp, const char *s)
 {
   for (size_t j = 0; j < slp->nitems; ++j)
-    if (strcmp (slp->item[j], s) == 0)
+    if (streq (slp->item[j], s))
       return 1;
   return 0;
 }
index f0c3e48b6ee713d2898067905036a07c79d9ef82..f95fdeb82a6a70962aea3b8d2a02d2e518d63664 100644 (file)
@@ -442,13 +442,13 @@ yylex (YYSTYPE *lval, struct cldr_plural_parse_args *arg)
           }
 
         /* Keywords.  */
-        if (strcmp (ident, "and") == 0)
+        if (streq (ident, "and"))
           {
             arg->cp = exp;
             sb_free (&buffer);
             return AND;
           }
-        else if (strcmp (ident, "or") == 0)
+        else if (streq (ident, "or"))
           {
             arg->cp = exp;
             sb_free (&buffer);
index 179eca3bccaeabe2afb50da096626e3aacbb8692..21207611353b3fe38b0b21e27e283f0dd0fee3df 100644 (file)
@@ -39,7 +39,7 @@ string_list_ty *
 read_names_from_file (const char *file_name)
 {
   FILE *fp;
-  if (strcmp (file_name, "-") == 0)
+  if (streq (file_name, "-"))
     fp = stdin;
   else
     {
index af4f97bf7145e79aa9510c0b0c57c793192e3895..7bb926efa813597571817d840e3c0d0b2b0b2c00 100644 (file)
@@ -228,10 +228,10 @@ message_format_parse (const char *format, char *fdi, struct spec *spec,
               else if (*element == ',')
                 {
                   element++;
-                  if (strcmp (element, "short") == 0
-                      || strcmp (element, "medium") == 0
-                      || strcmp (element, "long") == 0
-                      || strcmp (element, "full") == 0
+                  if (streq (element, "short")
+                      || streq (element, "medium")
+                      || streq (element, "long")
+                      || streq (element, "full")
                       || date_format_parse (element))
                     ;
                   else
@@ -263,9 +263,9 @@ message_format_parse (const char *format, char *fdi, struct spec *spec,
               else if (*element == ',')
                 {
                   element++;
-                  if (strcmp (element, "currency") == 0
-                      || strcmp (element, "percent") == 0
-                      || strcmp (element, "integer") == 0
+                  if (streq (element, "currency")
+                      || streq (element, "percent")
+                      || streq (element, "integer")
                       || number_format_parse (element))
                     ;
                   else
index ec98961b3c7dccc977ff5586abd3d27bbff0636b..af0ad3cfaea155297eaf9eead8675524d147be4e 100644 (file)
@@ -806,8 +806,8 @@ parse_upto (struct spec *spec,
             format_arg_type_t type_both;
             if (((type1 == type2)
                  && (type1 != FAT_FORMAT_STRING
-                     || strcmp (spec->numbered[i].signature,
-                                spec->numbered[j-1].signature) == 0))
+                     || streq (spec->numbered[i].signature,
+                               spec->numbered[j-1].signature)))
                 || (((type1 | type2) & FAT_OPTIONAL_OCAML_SYNTAX) != 0
                     && (((type1 & ~FAT_OPTIONAL_OCAML_SYNTAX) | FAT_OCAML_SYNTAX)
                         == ((type2 & ~FAT_OPTIONAL_OCAML_SYNTAX) | FAT_OCAML_SYNTAX))))
@@ -951,8 +951,8 @@ format_check (void *msgid_descr, void *msgstr_descr, bool equality,
 
                   if (!(((type1 == type2)
                          && (type1 != FAT_FORMAT_STRING
-                             || strcmp (spec1->numbered[i].signature,
-                                        spec2->numbered[j].signature) == 0))
+                             || streq (spec1->numbered[i].signature,
+                                       spec2->numbered[j].signature)))
                         || ((type2 & FAT_OPTIONAL_OCAML_SYNTAX) != 0
                             && (type2 & ~FAT_OPTIONAL_OCAML_SYNTAX)
                                == (type1 & ~FAT_OCAML_SYNTAX))))
index a15e54594e2dc5efea388f2e5c18c0ed9eb37258..c43151a8ce3ddc7bbc279dd12ea1fa7397390421 100644 (file)
@@ -122,7 +122,7 @@ format_parse (const char *format, bool translated, char *fdi,
       /* Remove duplicates: Copy from i to j, keeping 0 <= j <= i.  */
       size_t i, j;
       for (i = j = 0; i < spec.named_arg_count; i++)
-        if (j > 0 && strcmp (spec.named[i].name, spec.named[j-1].name) == 0)
+        if (j > 0 && streq (spec.named[i].name, spec.named[j-1].name))
           free (spec.named[i].name);
         else
           {
index 178be15415363c3b651844f9139d81db9d992f64..eb3a2b935f820960c146edc7ba3014f7ab1f7a7e 100644 (file)
@@ -470,7 +470,7 @@ format_parse (const char *format, bool translated,
       /* Remove duplicates: Copy from i to j, keeping 0 <= j <= i.  */
       size_t i, j;
       for (i = j = 0; i < spec.named_arg_count; i++)
-        if (j > 0 && strcmp (spec.named[i].name, spec.named[j-1].name) == 0)
+        if (j > 0 && streq (spec.named[i].name, spec.named[j-1].name))
           free (spec.named[i].name);
         else
           {
index d2ec9bc2823f5045a6254280dbae8025fde14352..1084e3f677c2281afed3574aad3908f83595a348 100644 (file)
@@ -342,7 +342,7 @@ format_parse (const char *format, bool translated, char *fdi,
       bool err = false;
       size_t i, j;
       for (i = j = 0; i < spec.named_arg_count; i++)
-        if (j > 0 && strcmp (spec.named[i].name, spec.named[j-1].name) == 0)
+        if (j > 0 && streq (spec.named[i].name, spec.named[j-1].name))
           {
             enum format_arg_type type1 = spec.named[i].type;
             enum format_arg_type type2 = spec.named[j-1].type;
@@ -504,7 +504,7 @@ format_check (void *msgid_descr, void *msgstr_descr, bool equality,
               size_t i, j;
               for (i = 0, j = 0; j < n2; )
                 {
-                  if (strcmp (spec1->named[i].name, spec2->named[j].name) == 0)
+                  if (streq (spec1->named[i].name, spec2->named[j].name))
                     {
                       if (!(spec1->named[i].type == spec2->named[j].type
                             || (!equality
index d393929e29170e990976cdfb0529d930c259339a..7d8870aa1eac53a222542e32d6934b951d2d8d83 100644 (file)
@@ -772,7 +772,7 @@ format_parse (const char *format, bool translated, char *fdi,
       bool err = false;
       size_t i, j;
       for (i = j = 0; i < spec.named_arg_count; i++)
-        if (j > 0 && strcmp (spec.named[i].name, spec.named[j-1].name) == 0)
+        if (j > 0 && streq (spec.named[i].name, spec.named[j-1].name))
           {
             enum format_arg_type type1 = spec.named[i].type;
             enum format_arg_type type2 = spec.named[j-1].type;
@@ -934,7 +934,7 @@ format_check (void *msgid_descr, void *msgstr_descr, bool equality,
               size_t i, j;
               for (i = 0, j = 0; j < n2; )
                 {
-                  if (strcmp (spec1->named[i].name, spec2->named[j].name) == 0)
+                  if (streq (spec1->named[i].name, spec2->named[j].name))
                     {
                       if (!(spec1->named[i].type == spec2->named[j].type))
                         {
index c50a21d2acc68465a2f0d6410cba662215a70960..9a780c631102af6a0a38e03bbc18dc481622a09f 100644 (file)
@@ -372,7 +372,7 @@ format_parse (const char *format, bool translated, char *fdi,
       /* Remove duplicates: Copy from i to j, keeping 0 <= j <= i.  */
       size_t i, j;
       for (i = j = 0; i < spec.named_arg_count; i++)
-        if (j > 0 && strcmp (spec.named[i].name, spec.named[j-1].name) == 0)
+        if (j > 0 && streq (spec.named[i].name, spec.named[j-1].name))
           free (spec.named[i].name);
         else
           {
index 92259c8d61655c11ef91775d69250706e74f72a5..ee45065f0930136cfb83d46b230dc5f654ead6cf 100644 (file)
@@ -208,7 +208,7 @@ format_parse (const char *format, bool translated, char *fdi,
       /* Remove duplicates: Copy from i to j, keeping 0 <= j <= i.  */
       size_t i, j;
       for (i = j = 0; i < spec.named_arg_count; i++)
-        if (j > 0 && strcmp (spec.named[i].name, spec.named[j-1].name) == 0)
+        if (j > 0 && streq (spec.named[i].name, spec.named[j-1].name))
           free (spec.named[i].name);
         else
           {
index ae625b12dcdead941d6f6248e76e5529f4290a2b..bbd8c809d1a21a6030e8ba37352260783dd883e8 100644 (file)
@@ -27,6 +27,7 @@
 #include <stdarg.h>
 #include <stdint.h>
 #include <stdlib.h>
+#include <string.h>
 
 #include <libxml/xmlversion.h>
 #include <libxml/xmlerror.h>
@@ -158,7 +159,7 @@ its_value_list_get_value (struct its_value_list_ty *values,
   for (size_t i = 0; i < values->nitems; i++)
     {
       struct its_value_ty *value = &values->items[i];
-      if (strcmp (value->name, name) == 0)
+      if (streq (value->name, name))
         return value->value;
     }
   return NULL;
@@ -173,7 +174,7 @@ its_value_list_set_value (struct its_value_list_ty *values,
   for (i = 0; i < values->nitems; i++)
     {
       struct its_value_ty *_value = &values->items[i];
-      if (strcmp (_value->name, name) == 0)
+      if (streq (_value->name, name))
         {
           free (_value->value);
           _value->value = xstrdup (value);
@@ -198,8 +199,8 @@ its_value_list_merge (struct its_value_list_ty *values,
         {
           struct its_value_ty *value = &values->items[j];
 
-          if (strcmp (value->name, other_value->name) == 0
-              && strcmp (value->value, other_value->value) != 0)
+          if (streq (value->name, other_value->name)
+              && !streq (value->value, other_value->value))
             {
               free (value->value);
               value->value = xstrdup (other_value->value);
@@ -1102,15 +1103,15 @@ its_preserve_space_rule_constructor (struct its_rule_ty *rule,
   {
     char *prop = _its_get_attribute (node, "space", NULL);
     if (prop
-        && !(strcmp (prop, "preserve") ==0
-             || strcmp (prop, "default") == 0
+        && !(streq (prop, "preserve")
+             || streq (prop, "default")
              /* gettext extension: remove leading/trailing whitespaces only.  */
              || (node->ns && xmlStrEqual (node->ns->href, BAD_CAST GT_NS)
-                 && strcmp (prop, "trim") == 0)
+                 && streq (prop, "trim"))
              /* gettext extension: same as default except keeping
                 paragraph boundaries.  */
              || (node->ns && xmlStrEqual (node->ns->href, BAD_CAST GT_NS)
-                 && strcmp (prop, "paragraph") == 0)))
+                 && streq (prop, "paragraph"))))
       {
         error (0, 0, _("invalid attribute value \"%s\" for \"%s\""),
                prop, "space");
@@ -1339,10 +1340,10 @@ its_extension_escape_rule_eval (struct its_rule_ty *rule,
             if (xmlHasNsProp (node, BAD_CAST "escape", BAD_CAST GT_NS))
               {
                 char *prop = _its_get_attribute (node, "escape", GT_NS);
-                if (strcmp (prop, "yes") == 0 || strcmp (prop, "no") == 0)
+                if (streq (prop, "yes") || streq (prop, "no"))
                   {
                     its_value_list_append (result, "escape", prop);
-                    if (strcmp (prop, "no") != 0)
+                    if (!streq (prop, "no"))
                       {
                         free (prop);
                         return result;
@@ -1354,13 +1355,13 @@ its_extension_escape_rule_eval (struct its_rule_ty *rule,
             if (xmlHasNsProp (node, BAD_CAST "unescape-if", BAD_CAST GT_NS))
               {
                 char *prop = _its_get_attribute (node, "unescape-if", GT_NS);
-                if (strcmp (prop, "xml") == 0
-                    || strcmp (prop, "xhtml") == 0
-                    || strcmp (prop, "html") == 0
-                    || strcmp (prop, "no") == 0)
+                if (streq (prop, "xml")
+                    || streq (prop, "xhtml")
+                    || streq (prop, "html")
+                    || streq (prop, "no"))
                   {
                     its_value_list_append (result, "unescape-if", prop);
-                    if (strcmp (prop, "no") != 0)
+                    if (!streq (prop, "no"))
                       {
                         free (prop);
                         return result;
@@ -1672,7 +1673,7 @@ its_rule_list_is_translatable (its_rule_list_ty *rules,
   /* Check if NODE has translate="yes".  */
   {
     const char *value = its_value_list_get_value (values, "translate");
-    if (!(value && strcmp (value, "yes") == 0))
+    if (!(value && streq (value, "yes")))
       {
         its_value_list_destroy (values);
         free (values);
@@ -1684,7 +1685,7 @@ its_rule_list_is_translatable (its_rule_list_ty *rules,
   if (depth > 0)
     {
       const char *value = its_value_list_get_value (values, "withinText");
-      if (!(value && strcmp (value, "yes") == 0))
+      if (!(value && streq (value, "yes")))
         {
           its_value_list_destroy (values);
           free (values);
@@ -1862,7 +1863,7 @@ its_rule_list_extract_text (its_rule_list_ty *rules,
       bool do_escape;
       {
         const char *value = its_value_list_get_value (values, "escape");
-        do_escape = value != NULL && strcmp (value, "yes") == 0;
+        do_escape = value != NULL && streq (value, "yes");
       }
 
       bool do_escape_during_extract = do_escape;
@@ -1929,11 +1930,11 @@ its_rule_list_extract_text (its_rule_list_ty *rules,
       enum its_whitespace_type_ty whitespace;
       {
         const char *value = its_value_list_get_value (values, "space");
-        if (value && strcmp (value, "preserve") == 0)
+        if (value && streq (value, "preserve"))
           whitespace = ITS_WHITESPACE_PRESERVE;
-        else if (value && strcmp (value, "trim") == 0)
+        else if (value && streq (value, "trim"))
           whitespace = ITS_WHITESPACE_TRIM;
-        else if (value && strcmp (value, "paragraph") == 0)
+        else if (value && streq (value, "paragraph"))
           whitespace = ITS_WHITESPACE_NORMALIZE_PARAGRAPH;
         else
           whitespace = ITS_WHITESPACE_NORMALIZE;
@@ -2081,7 +2082,7 @@ _its_copy_node_with_attributes (xmlNode *node)
        attributes = attributes->next)
     {
       const xmlChar *attr_name = attributes->name;
-      if (strcmp ((const char *) attr_name, "id") != 0)
+      if (!streq ((const char *) attr_name, "id"))
         {
           xmlNs *attr_ns = attributes->ns;
           xmlChar *attr_value =
@@ -2829,7 +2830,7 @@ its_merge_context_merge_node (struct its_merge_context_ty *context,
       bool do_escape;
       {
         const char *value = its_value_list_get_value (values, "escape");
-        do_escape = value != NULL && strcmp (value, "yes") == 0;
+        do_escape = value != NULL && streq (value, "yes");
       }
 
       bool do_escape_during_extract = do_escape;
@@ -2843,11 +2844,11 @@ its_merge_context_merge_node (struct its_merge_context_ty *context,
       enum its_whitespace_type_ty whitespace;
       {
         const char *value = its_value_list_get_value (values, "space");
-        if (value && strcmp (value, "preserve") == 0)
+        if (value && streq (value, "preserve"))
           whitespace = ITS_WHITESPACE_PRESERVE;
-        else if (value && strcmp (value, "trim") == 0)
+        else if (value && streq (value, "trim"))
           whitespace = ITS_WHITESPACE_TRIM;
-        else if (value && strcmp (value, "paragraph") == 0)
+        else if (value && streq (value, "paragraph"))
           whitespace = ITS_WHITESPACE_NORMALIZE_PARAGRAPH;
         else
           whitespace = ITS_WHITESPACE_NORMALIZE;
@@ -2945,11 +2946,11 @@ its_merge_context_merge_node (struct its_merge_context_ty *context,
                   bool done_unescape = false;
 
                   if (do_unescape_if != NULL
-                       && ((strcmp (do_unescape_if, "xml") == 0
+                       && ((streq (do_unescape_if, "xml")
                            && _its_is_valid_simple_xml (msgstr))
-                          || (strcmp (do_unescape_if, "xhtml") == 0
+                          || (streq (do_unescape_if, "xhtml")
                               && _its_is_valid_simple_xhtml (msgstr))
-                          || (strcmp (do_unescape_if, "html") == 0
+                          || (streq (do_unescape_if, "html")
                               && _its_is_valid_simple_html (msgstr))))
                     {
                       /* It looks like the translator has provided a syntactically
@@ -2960,8 +2961,8 @@ its_merge_context_merge_node (struct its_merge_context_ty *context,
                          translators most often only preserve the markup that was
                          present in the msgid; if they do this, the result will be
                          valid.  */
-                      if (strcmp (do_unescape_if, "xml") == 0
-                          || strcmp (do_unescape_if, "xhtml") == 0)
+                      if (streq (do_unescape_if, "xml")
+                          || streq (do_unescape_if, "xhtml"))
                         {
                           if (_its_set_simple_xml_content (translated, msgstr))
                             done_unescape = true;
index 99ee9409065691639ee60a99bba1b7b4a77e7756..6137baffa493f14552b8edb55b330aff40492158 100644 (file)
@@ -267,7 +267,7 @@ message_comment_filepos (message_ty *mp,
   for (size_t j = 0; j < mp->filepos_count; j++)
     {
       lex_pos_ty *pp = &mp->filepos[j];
-      if (strcmp (pp->file_name, file_name) == 0
+      if (streq (pp->file_name, file_name)
           && pp->line_number == line_number)
         return;
     }
@@ -583,9 +583,9 @@ message_list_search (const message_list_ty *mlp,
           message_ty *mp = mlp->item[j];
 
           if ((msgctxt != NULL
-               ? mp->msgctxt != NULL && strcmp (msgctxt, mp->msgctxt) == 0
+               ? mp->msgctxt != NULL && streq (msgctxt, mp->msgctxt)
                : mp->msgctxt == NULL)
-              && strcmp (msgid, mp->msgid) == 0)
+              && streq (msgid, mp->msgid))
             return mp;
         }
       return NULL;
@@ -603,7 +603,7 @@ fuzzy_search_goal_function (const message_ty *mp,
      give mp a small advantage if mp is valid regardless of any context or
      has the same context as the one being looked up.  */
   if (mp->msgctxt == NULL
-      || (msgctxt != NULL && strcmp (msgctxt, mp->msgctxt) == 0))
+      || (msgctxt != NULL && streq (msgctxt, mp->msgctxt)))
     {
       bonus = 0.00001;
       /* Since we will consider (weight + bonus) at the end, we are only
@@ -830,7 +830,7 @@ msgdomain_list_sublist (msgdomain_list_ty *mdlp, const char *domain,
                         bool create)
 {
   for (size_t j = 0; j < mdlp->nitems; j++)
-    if (strcmp (mdlp->item[j]->domain, domain) == 0)
+    if (streq (mdlp->item[j]->domain, domain))
       return mdlp->item[j]->messages;
 
   if (create)
index a90ecb6103bb6598aba9af22007e6a4e96a472fe..9a9462a2ddcb4656064a2e3a36b21430e766e668 100644 (file)
@@ -213,7 +213,7 @@ There is NO WARRANTY, to the extent permitted by law.\n\
   /* Read input file.  */
   msgdomain_list_ty *result = read_catalog_file (input_file, input_syntax);
 
-  if (strcmp (sub_name, "0") != 0)
+  if (!streq (sub_name, "0"))
     {
       /* Warn if the current locale is not suitable for this PO file.  */
       compare_po_locale_charsets (result);
@@ -351,7 +351,7 @@ nonintr_close (int fd)
 static void
 process_string (const message_ty *mp, const char *str, size_t len)
 {
-  if (strcmp (sub_name, "0") == 0)
+  if (streq (sub_name, "0"))
     {
       /* Built-in command "0".  */
       if (full_write (STDOUT_FILENO, str, len + 1) < len + 1)
index 94b3dc8d7c5b93b5f89201f4a68f2b9c2be743f8..9ad543595d22e4bb081b1d9776270532c8623ff6 100644 (file)
@@ -315,7 +315,7 @@ There is NO WARRANTY, to the extent permitted by law.\n\
   }
 
   /* Extra checks for sed scripts.  */
-  if (strcmp (sub_name, "sed") == 0)
+  if (streq (sub_name, "sed"))
     {
       if (sub_argc == 1)
         error (EXIT_FAILURE, 0,
@@ -324,16 +324,16 @@ There is NO WARRANTY, to the extent permitted by law.\n\
       /* Replace GNU sed specific options with portable sed options.  */
       for (int i = 1; i < sub_argc; i++)
         {
-          if (strcmp (sub_argv[i], "--expression") == 0)
+          if (streq (sub_argv[i], "--expression"))
             sub_argv[i] = "-e";
-          else if (strcmp (sub_argv[i], "--file") == 0)
+          else if (streq (sub_argv[i], "--file"))
             sub_argv[i] = "-f";
-          else if (strcmp (sub_argv[i], "--quiet") == 0
-                   || strcmp (sub_argv[i], "--silent") == 0)
+          else if (streq (sub_argv[i], "--quiet")
+                   || streq (sub_argv[i], "--silent"))
             sub_argv[i] = "-n";
 
-          if (strcmp (sub_argv[i], "-e") == 0
-              || strcmp (sub_argv[i], "-f") == 0)
+          if (streq (sub_argv[i], "-e")
+              || streq (sub_argv[i], "-f"))
             i++;
         }
     }
@@ -346,7 +346,7 @@ There is NO WARRANTY, to the extent permitted by law.\n\
   msgdomain_list_ty *result = read_catalog_file (input_file, input_syntax);
 
   /* Recognize special programs as built-ins.  */
-  if (strcmp (sub_name, "recode-sr-latin") == 0 && sub_argc == 1)
+  if (streq (sub_name, "recode-sr-latin") && sub_argc == 1)
     {
       filter = serbian_to_latin;
 
@@ -354,7 +354,7 @@ There is NO WARRANTY, to the extent permitted by law.\n\
       result = iconv_msgdomain_list (result, po_charset_utf8, true, input_file,
                                      textmode_xerror_handler);
     }
-  else if (strcmp (sub_name, "quot") == 0 && sub_argc == 1)
+  else if (streq (sub_name, "quot") && sub_argc == 1)
     {
       filter = ascii_quote_to_unicode;
 
@@ -362,7 +362,7 @@ There is NO WARRANTY, to the extent permitted by law.\n\
       result = iconv_msgdomain_list (result, po_charset_utf8, true, input_file,
                                      textmode_xerror_handler);
     }
-  else if (strcmp (sub_name, "boldquot") == 0 && sub_argc == 1)
+  else if (streq (sub_name, "boldquot") && sub_argc == 1)
     {
       filter = ascii_quote_to_unicode_bold;
 
index 6ddd1c923cbb235f75f6a61e335ca1cc02e303c7..a8348f957f3977eaeb59e8ec157c33be4e485aed 100644 (file)
@@ -408,9 +408,9 @@ main (int argc, char *argv[])
         case CHAR_MAX + 13: /* --endianness={big|little} */
           {
             int endianness;
-            if (strcmp (optarg, "big") == 0)
+            if (streq (optarg, "big"))
               endianness = 1;
-            else if (strcmp (optarg, "little") == 0)
+            else if (streq (optarg, "little"))
               endianness = 0;
             else
               error (EXIT_FAILURE, 0, _("invalid endianness: %s"), optarg);
@@ -1151,7 +1151,7 @@ new_domain (const char *name, const char *file_name)
 {
   struct msg_domain **p_dom = &domain_list;
 
-  while (*p_dom != NULL && strcmp (name, (*p_dom)->domain_name) != 0)
+  while (*p_dom != NULL && !streq (name, (*p_dom)->domain_name))
     p_dom = &(*p_dom)->next;
 
   if (*p_dom == NULL)
index f2ff85c376932f557ae48a9dbec36ed90a922343..78c88e671ff510c311c42013b6d09cd3e8d1c21c 100644 (file)
@@ -284,7 +284,7 @@ There is NO WARRANTY, to the extent permitted by law.\n\
   if (locale == NULL)
     {
       locale = gl_locale_name (LC_MESSAGES, "LC_MESSAGES");
-      if (strcmp (locale, "C") == 0)
+      if (streq (locale, "C"))
         {
           const char *doc_url =
             "https://www.gnu.org/software/gettext/manual/html_node/Setting-the-POSIX-Locale.html";
@@ -311,7 +311,7 @@ This is necessary so you can test your translations.\n"),
     output_file = xasprintf ("%s.po", catalogname);
 
   msgdomain_list_ty *result;
-  if (strcmp (output_file, "-") != 0
+  if (!streq (output_file, "-")
       && access (output_file, F_OK) == 0)
     {
       /* The output PO file already exists.  Assume the translator wants to
@@ -357,7 +357,7 @@ This is necessary so you can test your translations.\n"),
       result = fill_header (result, true);
 
       /* Initialize translations.  */
-      if (strcmp (language, "en") == 0)
+      if (streq (language, "en"))
         result = msgdomain_list_english (result);
       else
         result = update_msgstr_plurals (result);
@@ -759,7 +759,7 @@ catalogname_for_locale (const char *locale)
 
   /* If the territory is the language's principal territory, drop it.  */
   for (size_t i = 0; i < SIZEOF (locales_with_principal_territory); i++)
-    if (strcmp (locale, locales_with_principal_territory[i]) == 0)
+    if (streq (locale, locales_with_principal_territory[i]))
       {
         const char *language_end = strchr (locale, '_');
         if (language_end == NULL)
@@ -848,7 +848,7 @@ static const char *
 englishname_of_language ()
 {
   for (size_t i = 0; i < language_table_size; i++)
-    if (strcmp (language_table[i].code, language) == 0)
+    if (streq (language_table[i].code, language))
       return language_table[i].english;
 
   return xasprintf ("Language %s", language);
@@ -863,7 +863,7 @@ project_id (const char *header)
      it was already filled in by xgettext.  */
   {
     const char *old_field = get_field (header, "Project-Id-Version");
-    if (old_field != NULL && strcmp (old_field, "PACKAGE VERSION") != 0)
+    if (old_field != NULL && !streq (old_field, "PACKAGE VERSION"))
       {
         /* Remove the last word from old_field.  */
         const char *last_space = strrchr (old_field, ' ');
@@ -958,7 +958,7 @@ project_id_version (const char *header)
      xgettext.  */
   {
     const char *old_field = get_field (header, "Project-Id-Version");
-    if (old_field != NULL && strcmp (old_field, "PACKAGE VERSION") != 0)
+    if (old_field != NULL && !streq (old_field, "PACKAGE VERSION"))
       return old_field;
   }
 
@@ -1222,7 +1222,7 @@ language_team_englishname ()
 {
   /* Search for a name depending on the catalogname.  */
   for (size_t i = 0; i < language_variant_table_size; i++)
-    if (strcmp (language_variant_table[i].code, catalogname) == 0)
+    if (streq (language_variant_table[i].code, catalogname))
       return language_variant_table[i].english;
 
   /* Search for a name depending on the language only.  */
@@ -1365,12 +1365,12 @@ plural_forms ()
 {
   /* Search for a formula depending on the catalogname.  */
   for (size_t i = 0; i < plural_table_size; i++)
-    if (strcmp (plural_table[i].lang, catalogname) == 0)
+    if (streq (plural_table[i].lang, catalogname))
       return plural_table[i].value;
 
   /* Search for a formula depending on the language only.  */
   for (size_t i = 0; i < plural_table_size; i++)
-    if (strcmp (plural_table[i].lang, language) == 0)
+    if (streq (plural_table[i].lang, language))
       return plural_table[i].value;
 
   const char *gettextcldrdir = getenv ("GETTEXTCLDRDIR");
@@ -1645,7 +1645,7 @@ get_title ()
          *not* "Traduzioni inglesi ...".  */
       const char *msgid = N_("English translations for %s package");
       result = gettext (msgid);
-      if (result != msgid && strcmp (result, msgid) != 0)
+      if (result != msgid && !streq (result, msgid))
         /* Use the English and the foreign title.  */
         result = xasprintf ("%s\n%s", english,
                             xstr_iconv (result, locale_charset (),
index afd76b75d87d3c1b1e4c6f198a50d5849062b616..c98886d90bbd84e3401c50a5ba4b759df0f01893 100644 (file)
@@ -160,7 +160,7 @@ catenate_msgdomain_list (string_list_ty *file_list,
                                 const char *filename = files[n];
                                 size_t filenamelen = strlen (filename);
 
-                                if (strcmp (charset, "CHARSET") == 0
+                                if (streq (charset, "CHARSET")
                                     && ((filenamelen >= 4
                                          && memeq (filename + filenamelen - 4,
                                                    ".pot", 4))
@@ -395,7 +395,7 @@ catenate_msgdomain_list (string_list_ty *file_list,
          with spaces are present in the target encoding.  */
       if (has_filenames_with_spaces
           && !(canon_to_code == po_charset_utf8
-               || strcmp (canon_to_code, "GB18030") == 0))
+               || streq (canon_to_code, "GB18030")))
         error (EXIT_FAILURE, 0,
                _("Cannot write the control characters that protect file names with spaces in the %s encoding"),
                canon_to_code);
@@ -427,7 +427,7 @@ catenate_msgdomain_list (string_list_ty *file_list,
                     else if (canon_charsets[n][k] != first && second == NULL)
                       second = canon_charsets[n][k];
 
-                    if (strcmp (canon_charsets[n][k], "UTF-8") == 0)
+                    if (streq (canon_charsets[n][k], "UTF-8"))
                       with_UTF8 = true;
 
                     if (!po_charset_ascii_compatible (canon_charsets[n][k]))
@@ -467,7 +467,7 @@ To select a different output encoding, use the --to-code option.\n\
           /* A conversion is needed.  Warn the user since he hasn't asked
              for it and might be surprised.  */
           if (first != NULL
-              && (first == po_charset_utf8 || strcmp (first, "GB18030") == 0))
+              && (first == po_charset_utf8 || streq (first, "GB18030")))
             canon_to_code = first;
           else
             canon_to_code = po_charset_utf8;
index b53fc2ab552f2eddd162772c76b1951284878abe..bae81bb940a4f9ab95af9896253462189e2bcfe7 100644 (file)
@@ -79,7 +79,7 @@ check_pot_charset (const msgdomain_list_ty *mdlp, const char *filename)
 
                     /* "CHARSET" is often used as a placeholder, equivalent
                        to "any" or "ASCII".  */
-                    if (!(strcmp (charset, "CHARSET") == 0)
+                    if (!streq (charset, "CHARSET")
                         && canon_charset == NULL)
                       error (EXIT_FAILURE, 0,
                              _("%s: The present charset \"%s\" is not a portable encoding name."),
@@ -156,9 +156,9 @@ Possible workarounds are:\n\
   then apply '%s',\n\
   then convert back to %s using 'msgconv'.\n\
 "), canon_locale_code, last_component (program_name), canon_charset));
-                        if (strcmp (canon_charset, "UTF-8") != 0
+                        if (!streq (canon_charset, "UTF-8")
                             && (canon_locale_code == NULL
-                                || strcmp (canon_locale_code, "UTF-8") != 0))
+                                || !streq (canon_locale_code, "UTF-8")))
                           multiline_append (prefix_width,
                                             xasprintf (_("\
 - Set LC_ALL to a locale with encoding %s,\n\
index b729b707a6d349fe7352e8c7a5a8ccadedf653c3..43c7af6f8162041a830f0cd63c141f8737a35cdb 100644 (file)
@@ -109,7 +109,7 @@ static inline bool
 pos_equal (const lex_pos_ty *pos1, const lex_pos_ty *pos2)
 {
   return ((pos1->file_name == pos2->file_name
-           || strcmp (pos1->file_name, pos2->file_name) == 0)
+           || streq (pos1->file_name, pos2->file_name))
           && pos1->line_number == pos2->line_number);
 }
 
@@ -121,7 +121,7 @@ string_list_equal (const string_list_ty *slp1, const string_list_ty *slp2)
   if (i1 != i2)
     return false;
   for (size_t i = 0; i < i1; i++)
-    if (strcmp (slp1->item[i], slp2->item[i]) != 0)
+    if (!streq (slp1->item[i], slp2->item[i]))
       return false;
   return true;
 }
@@ -131,16 +131,16 @@ message_equal (const message_ty *mp1, const message_ty *mp2,
                bool ignore_potcdate)
 {
   if (!(mp1->msgctxt != NULL
-        ? mp2->msgctxt != NULL && strcmp (mp1->msgctxt, mp2->msgctxt) == 0
+        ? mp2->msgctxt != NULL && streq (mp1->msgctxt, mp2->msgctxt)
         : mp2->msgctxt == NULL))
     return false;
 
-  if (strcmp (mp1->msgid, mp2->msgid) != 0)
+  if (!streq (mp1->msgid, mp2->msgid))
     return false;
 
   if (!(mp1->msgid_plural != NULL
         ? mp2->msgid_plural != NULL
-          && strcmp (mp1->msgid_plural, mp2->msgid_plural) == 0
+          && streq (mp1->msgid_plural, mp2->msgid_plural)
         : mp2->msgid_plural == NULL))
     return false;
 
@@ -180,19 +180,19 @@ message_equal (const message_ty *mp1, const message_ty *mp2,
 
   if (!(mp1->prev_msgctxt != NULL
         ? mp2->prev_msgctxt != NULL
-          && strcmp (mp1->prev_msgctxt, mp2->prev_msgctxt) == 0
+          && streq (mp1->prev_msgctxt, mp2->prev_msgctxt)
         : mp2->prev_msgctxt == NULL))
     return false;
 
   if (!(mp1->prev_msgid != NULL
         ? mp2->prev_msgid != NULL
-          && strcmp (mp1->prev_msgid, mp2->prev_msgid) == 0
+          && streq (mp1->prev_msgid, mp2->prev_msgid)
         : mp2->prev_msgid == NULL))
     return false;
 
   if (!(mp1->prev_msgid_plural != NULL
         ? mp2->prev_msgid_plural != NULL
-          && strcmp (mp1->prev_msgid_plural, mp2->prev_msgid_plural) == 0
+          && streq (mp1->prev_msgid_plural, mp2->prev_msgid_plural)
         : mp2->prev_msgid_plural == NULL))
     return false;
 
@@ -220,7 +220,7 @@ static inline bool
 msgdomain_equal (const msgdomain_ty *mdp1, const msgdomain_ty *mdp2,
                  bool ignore_potcdate)
 {
-  return (strcmp (mdp1->domain, mdp2->domain) == 0
+  return (streq (mdp1->domain, mdp2->domain)
           && message_list_equal (mdp1->messages, mdp2->messages,
                                  ignore_potcdate));
 }
index 304ef2ce3d8fdf1decf9c8dad47aef703ae3df5b..3e9241dee31c46cab9f0f8cbca11f859796331d1 100644 (file)
@@ -81,7 +81,7 @@ msgdomain_list_set_header_field (msgdomain_list_ty *mdlp,
   /* Search the field in known_fields[].  */
   int field_index = -1;
   for (size_t k = 0; k < SIZEOF (known_fields); k++)
-    if (strcmp (known_fields[k].name, field) == 0)
+    if (streq (known_fields[k].name, field))
       {
         field_index = k;
         break;
index 5e583f1eb64bb3bf40dc8aa265f2b659d41ac4b7..fcec96ceeffb3b330cb2fb091f88cecdb620f1b3 100644 (file)
@@ -268,7 +268,7 @@ iconv_message_list_internal (message_list_ty *mlp,
                         const char *filename = from_filename;
                         size_t filenamelen;
 
-                        if (strcmp (charset, "CHARSET") == 0
+                        if (streq (charset, "CHARSET")
                             && ((filename != NULL
                                  && (filenamelen = strlen (filename)) >= 4
                                  && memeq (filename + filenamelen - 4, ".pot", 4))
@@ -386,7 +386,7 @@ iconv_msgdomain_list (msgdomain_list_ty *mdlp,
      spaces are present in the target encoding.  */
   if (msgdomain_list_has_filenames_with_spaces (mdlp)
       && !(canon_to_code == po_charset_utf8
-           || strcmp (canon_to_code, "GB18030") == 0))
+           || streq (canon_to_code, "GB18030")))
     xeh->xerror (CAT_SEVERITY_FATAL_ERROR, NULL, NULL, 0, 0, false,
                  xasprintf (_("Cannot write the control characters that protect file names with spaces in the %s encoding"),
                             canon_to_code));
@@ -549,7 +549,7 @@ is_message_list_iconvable (message_list_ty *mlp,
                       {
                         /* Don't give an error for POT files, because POT
                            files usually contain only ASCII msgids.  */
-                        if (strcmp (charset, "CHARSET") == 0)
+                        if (streq (charset, "CHARSET"))
                           canon_charset = po_charset_ascii;
                         else
                           {
index d2261775d7e041c2461963e040bff2e92fb69585..660b0de3846c17e04fa7d2a9e56f546bfc7c8cca 100644 (file)
@@ -673,7 +673,7 @@ message_merge (message_ty *def, message_ty *ref, bool force_fuzzy,
   if (!result->is_fuzzy
       && (ref->msgid_plural != NULL
           ? def->msgid_plural == NULL
-            || strcmp (ref->msgid_plural, def->msgid_plural) != 0
+            || !streq (ref->msgid_plural, def->msgid_plural)
           : def->msgid_plural != NULL))
     result->is_fuzzy = true;
 
index 283ddb125d80c667e5bfbe07d6731a66b06414a4..7400743a9185cbc8743b38289aec836857b13481 100644 (file)
@@ -320,7 +320,7 @@ There is NO WARRANTY, to the extent permitted by law.\n\
     error (EXIT_FAILURE, 0, _("too many arguments"));
 
   /* Check --species option.  */
-  if (strcmp (species, "ollama") != 0)
+  if (!streq (species, "ollama"))
     error (EXIT_FAILURE, 0, _("invalid value for %s option: %s"),
            "--species", species);
 
index 855c86afcad334586cee9bea34ba73c27f741525..d6f114f53b7c7f6bf7fcd18a3c7bc790d5fcd035 100644 (file)
@@ -43,7 +43,7 @@
 static FILE *
 try_open_catalog_file (const char *input_name, char **real_file_name_p)
 {
-  if (strcmp (input_name, "-") == 0 || strcmp (input_name, "/dev/stdin") == 0)
+  if (streq (input_name, "-") || streq (input_name, "/dev/stdin"))
     {
       *real_file_name_p = xstrdup (_("<stdin>"));
       return stdin;
index e7e05c0ff2b86a0c2f4eca1eaaa93286841822a5..b67f214a649ba29cd8c8be75af41d0283f432d0f 100644 (file)
@@ -107,9 +107,9 @@ bool
 po_charset_ascii_compatible (const char *canon_charset)
 {
   /* There are only a few exceptions to ASCII compatibility.  */
-  if (strcmp (canon_charset, "SHIFT_JIS") == 0
-      || strcmp (canon_charset, "JOHAB") == 0
-      || strcmp (canon_charset, "VISCII") == 0)
+  if (streq (canon_charset, "SHIFT_JIS")
+      || streq (canon_charset, "JOHAB")
+      || streq (canon_charset, "VISCII"))
     return false;
   else
     return true;
@@ -130,7 +130,7 @@ bool po_is_charset_weird (const char *canon_charset)
   };
 
   for (size_t i = 0; i < SIZEOF (weird_charsets); i++)
-    if (strcmp (canon_charset, weird_charsets[i]) == 0)
+    if (streq (canon_charset, weird_charsets[i]))
       return true;
   return false;
 }
@@ -152,7 +152,7 @@ bool po_is_charset_weird_cjk (const char *canon_charset)
   };
 
   for (size_t i = 0; i < SIZEOF (weird_cjk_charsets); i++)
-    if (strcmp (canon_charset, weird_cjk_charsets[i]) == 0)
+    if (streq (canon_charset, weird_cjk_charsets[i]))
       return true;
   return false;
 }
@@ -397,24 +397,24 @@ po_charset_character_iterator (const char *canon_charset)
 {
   if (canon_charset == utf8)
     return utf8_character_iterator;
-  if (strcmp (canon_charset, "GB2312") == 0
-      || strcmp (canon_charset, "EUC-KR") == 0)
+  if (streq (canon_charset, "GB2312")
+      || streq (canon_charset, "EUC-KR"))
     return euc_character_iterator;
-  if (strcmp (canon_charset, "EUC-JP") == 0)
+  if (streq (canon_charset, "EUC-JP"))
     return euc_jp_character_iterator;
-  if (strcmp (canon_charset, "EUC-TW") == 0)
+  if (streq (canon_charset, "EUC-TW"))
     return euc_tw_character_iterator;
-  if (strcmp (canon_charset, "BIG5") == 0)
+  if (streq (canon_charset, "BIG5"))
     return big5_character_iterator;
-  if (strcmp (canon_charset, "BIG5-HKSCS") == 0)
+  if (streq (canon_charset, "BIG5-HKSCS"))
     return big5hkscs_character_iterator;
-  if (strcmp (canon_charset, "GBK") == 0)
+  if (streq (canon_charset, "GBK"))
     return gbk_character_iterator;
-  if (strcmp (canon_charset, "GB18030") == 0)
+  if (streq (canon_charset, "GB18030"))
     return gb18030_character_iterator;
-  if (strcmp (canon_charset, "SHIFT_JIS") == 0)
+  if (streq (canon_charset, "SHIFT_JIS"))
     return shift_jis_character_iterator;
-  if (strcmp (canon_charset, "JOHAB") == 0)
+  if (streq (canon_charset, "JOHAB"))
     return johab_character_iterator;
   return char_iterator;
 }
index 7998ac725715d13d5cd5672851eac6b1d175c126..91ec61293c48474d8a8b1a6ba29487323dbdfbc1 100644 (file)
 /* Specification.  */
 #include "read-csharp.h"
 
+#include <errno.h>
 #include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <errno.h>
+#include <string.h>
 
 #include <error.h>
 #include "msgunfmt.h"
@@ -111,17 +112,17 @@ msgdomain_read_csharp (const char *resource_name, const char *locale_name,
     char *p = strchr (culture_name, '@');
     if (p != NULL)
       {
-        if (strcmp (p, "@latin") == 0)
+        if (streq (p, "@latin"))
           strcpy (p, "-Latn");
-        else if (strcmp (p, "@cyrillic") == 0)
+        else if (streq (p, "@cyrillic"))
           strcpy (p, "-Cyrl");
       }
-    if (strcmp (culture_name, "sr-SP") == 0)
+    if (streq (culture_name, "sr-SP"))
       {
         free (culture_name);
         culture_name = xstrdup ("sr-SP-Latn");
       }
-    else if (strcmp (culture_name, "uz-UZ") == 0)
+    else if (streq (culture_name, "uz-UZ"))
       {
         free (culture_name);
         culture_name = xstrdup ("uz-UZ-Latn");
index 6ec881d06ecdfea54c034891701a5b2714693a66..d0eb6176e04d361a899b10c57c40b589a9d2492f 100644 (file)
@@ -238,7 +238,7 @@ read_mo_file (message_list_ty *mlp, const char *filename)
   static lex_pos_ty pos = { __FILE__, __LINE__ };
 
   FILE *fp;
-  if (strcmp (filename, "-") == 0 || strcmp (filename, "/dev/stdin") == 0)
+  if (streq (filename, "-") || streq (filename, "/dev/stdin"))
     {
       fp = stdin;
       SET_BINARY (fileno (fp));
index 326f5e6533b0f6255c3cb618cd5a397ddb514448..0a54eb12c5994b83248436985487eebc2d35aafe 100644 (file)
@@ -155,7 +155,7 @@ po_lex_charset_set (struct po_parser_state *ps,
              only ASCII msgids.  */
           size_t filenamelen = strlen (filename);
 
-          if (!(strcmp (charset, "CHARSET") == 0
+          if (!(streq (charset, "CHARSET")
                 && ((filenamelen >= 4
                      && memeq (filename + filenamelen - 4, ".pot", 4))
                     || is_pot_role)))
@@ -175,12 +175,12 @@ Message conversion to user's charset might not work.\n"),
         {
           ps->po_lex_charset = canon_charset;
 
-          if (strcmp (canon_charset, "UTF-8") == 0)
+          if (streq (canon_charset, "UTF-8"))
             {
               ps->catr->po_lex_isolate_start = "\xE2\x81\xA8";
               ps->catr->po_lex_isolate_end = "\xE2\x81\xA9";
             }
-          else if (strcmp (canon_charset, "GB18030") == 0)
+          else if (streq (canon_charset, "GB18030"))
             {
               ps->catr->po_lex_isolate_start = "\x81\x36\xAC\x34";
               ps->catr->po_lex_isolate_end = "\x81\x36\xAC\x35";
@@ -928,25 +928,25 @@ keyword_p (struct po_parser_state *ps, const char *s)
 {
   if (!ps->po_lex_previous)
     {
-      if (!strcmp (s, "domain"))
+      if (streq (s, "domain"))
         return DOMAIN;
-      if (!strcmp (s, "msgid"))
+      if (streq (s, "msgid"))
         return MSGID;
-      if (!strcmp (s, "msgid_plural"))
+      if (streq (s, "msgid_plural"))
         return MSGID_PLURAL;
-      if (!strcmp (s, "msgstr"))
+      if (streq (s, "msgstr"))
         return MSGSTR;
-      if (!strcmp (s, "msgctxt"))
+      if (streq (s, "msgctxt"))
         return MSGCTXT;
     }
   else
     {
       /* Inside a "#|" context, the keywords have a different meaning.  */
-      if (!strcmp (s, "msgid"))
+      if (streq (s, "msgid"))
         return PREV_MSGID;
-      if (!strcmp (s, "msgid_plural"))
+      if (streq (s, "msgid_plural"))
         return PREV_MSGID_PLURAL;
-      if (!strcmp (s, "msgctxt"))
+      if (streq (s, "msgctxt"))
         return PREV_MSGCTXT;
     }
   po_gram_error_at_line (ps->catr, &ps->gram_pos,
index b2a9ff149700ce6be2db040df369881ce23a3ac9..5d452752368fce6cfd28b404cad727b73748f8ca 100644 (file)
@@ -523,12 +523,12 @@ comment_line_end (abstract_catalog_reader_ty *catr,
 
   char *line = conv_from_ucs4 (buffer, buflen);
 
-  if (strcmp (line, "Flag: untranslated") == 0)
+  if (streq (line, "Flag: untranslated"))
     {
       special_comment_add ("fuzzy");
       next_is_fuzzy = true;
     }
-  else if (strcmp (line, "Flag: unmatched") == 0)
+  else if (streq (line, "Flag: unmatched"))
     next_is_obsolete = true;
   else if (strlen (line) >= 6 && memeq (line, "Flag: ", 6))
     special_comment_add (line + 6);
@@ -907,7 +907,7 @@ stringtable_parse (abstract_catalog_reader_ty *catr, FILE *file,
                   phase4_ungetc (c);
                   expect_fuzzy_msgstr_as_cxx_comment = false;
                 }
-              if (fuzzy_msgstr != NULL && strcmp (msgstr, msgid) == 0)
+              if (fuzzy_msgstr != NULL && streq (msgstr, msgid))
                 msgstr = fuzzy_msgstr;
 
               /* A key/value pair.  */
index c6ff95bdcab69fd0d3b29ee65bdcd8a6b70b8dfd..b804fec26268b98bfd1136994d0f52ad37a932b9 100644 (file)
@@ -69,7 +69,7 @@ static const char *
 englishname_of_language (const char *language)
 {
   for (size_t i = 0; i < language_table_size; i++)
-    if (strcmp (language_table[i].code, language) == 0)
+    if (streq (language_table[i].code, language))
       return language_table[i].english;
 
   return NULL;
@@ -81,7 +81,7 @@ static const char *
 englishname_of_country (const char *country)
 {
   for (size_t i = 0; i < country_table_size; i++)
-    if (strcmp (country_table[i].code, country) == 0)
+    if (streq (country_table[i].code, country))
       return country_table[i].english;
 
   return NULL;
@@ -96,7 +96,7 @@ language_in_english (const char *catalogname)
     {
       /* Treat a few cases specially.  */
       for (size_t i = 0; i < language_variant_table_size; i++)
-        if (strcmp (language_variant_table[i].code, catalogname) == 0)
+        if (streq (language_variant_table[i].code, catalogname))
           return language_variant_table[i].english;
 
       /* Decompose "ll_CC" into "ll" and "CC".  */
@@ -563,7 +563,7 @@ There is NO WARRANTY, to the extent permitted by law.\n\
     error (EXIT_FAILURE, 0, _("too many arguments"));
 
   /* Check --species option.  */
-  if (strcmp (species, "ollama") != 0)
+  if (!streq (species, "ollama"))
     error (EXIT_FAILURE, 0, _("invalid value for %s option: %s"),
            "--species", species);
 
index 278c56120f3713dd0d7f4c8dde64c6f25b8379ad..cf92ad047be4ca36573b0ec8d026b350bf84e77b 100644 (file)
@@ -95,7 +95,7 @@ string_list_append_unique (string_list_ty *slp, const char *s)
 {
   /* Do nothing if the string is already in the list.  */
   for (size_t j = 0; j < slp->nitems; ++j)
-    if (strcmp (slp->item[j], s) == 0)
+    if (streq (slp->item[j], s))
       return;
 
   /* Grow the list.  */
@@ -271,7 +271,7 @@ bool
 string_list_member (const string_list_ty *slp, const char *s)
 {
   for (size_t j = 0; j < slp->nitems; ++j)
-    if (strcmp (slp->item[j], s) == 0)
+    if (streq (slp->item[j], s))
       return true;
   return false;
 }
@@ -292,7 +292,7 @@ const char *
 string_list_remove (string_list_ty *slp, const char *s)
 {
   for (size_t j = 0; j < slp->nitems; ++j)
-    if (strcmp (slp->item[j], s) == 0)
+    if (streq (slp->item[j], s))
       {
         const char *found = slp->item[j];
         if (slp->nitems > j + 1)
index 7690e806eb57234beb112dd9f4332e6d496335f9..a6e8bc51761fbfc177b761b1948bc35300fa86fe 100644 (file)
@@ -186,8 +186,8 @@ msgdomain_list_print (msgdomain_list_ty *mdlp, const char *filename,
         }
     }
 
-  bool to_stdout = (filename == NULL || strcmp (filename, "-") == 0
-                    || strcmp (filename, "/dev/stdout") == 0);
+  bool to_stdout = (filename == NULL || streq (filename, "-")
+                    || streq (filename, "/dev/stdout"));
 
 #if ENABLE_COLOR
   if (output_syntax->supports_color
index f6a4504e604b6e82de8af47387ad7ba796f94b13..87c10e3a7bb69d05e872d35d4d789fa1510fac88 100644 (file)
@@ -619,17 +619,17 @@ msgdomain_write_csharp (message_list_ty *mlp, const char *canon_encoding,
     p = strchr (culture_name, '@');
     if (p != NULL)
       {
-        if (strcmp (p, "@latin") == 0)
+        if (streq (p, "@latin"))
           strcpy (p, "-Latn");
-        else if (strcmp (p, "@cyrillic") == 0)
+        else if (streq (p, "@cyrillic"))
           strcpy (p, "-Cyrl");
       }
-    if (strcmp (culture_name, "sr-SP") == 0)
+    if (streq (culture_name, "sr-SP"))
       {
         free (culture_name);
         culture_name = xstrdup ("sr-SP-Latn");
       }
-    else if (strcmp (culture_name, "uz-UZ") == 0)
+    else if (streq (culture_name, "uz-UZ"))
       {
         free (culture_name);
         culture_name = xstrdup ("uz-UZ-Latn");
index 0a25e983000815579a96fbb90142afc8dcae4917..4c9affed48809423592dd9d919047c6851e16cf4 100644 (file)
@@ -26,6 +26,7 @@
 #include <stdint.h>
 #include <stdlib.h>
 #include <stdio.h>
+#include <string.h>
 
 #include <error.h>
 #include "msgl-iconv.h"
@@ -148,7 +149,7 @@ msgdomain_write_desktop_bulk (msgfmt_operand_list_ty *operands,
   msgfmt_reader->operands = operands;
   msgfmt_reader->keywords = keywords;
 
-  if (strcmp (file_name, "-") == 0)
+  if (streq (file_name, "-"))
     msgfmt_reader->output_file = stdout;
   else
     {
index 93811e7029240b2b6d4ce52af695633575ff7071..c7bd294bfcf51b8da3ea13e9f97e5be1f8623115 100644 (file)
@@ -1113,7 +1113,7 @@ msgdomain_write_mo (message_list_ty *mlp,
          between builds in the same conditions.  */
       message_list_delete_header_field (mlp, "POT-Creation-Date:");
 
-      if (strcmp (domain_name, "-") == 0)
+      if (streq (domain_name, "-"))
         {
           FILE *output_file = stdout;
           SET_BINARY (fileno (output_file));
index cc51804831e88256f2e343eadb705211ee403c35..1f817df51c44a4e527759d828f85b93243f14073 100644 (file)
@@ -327,7 +327,7 @@ message_print_comment_filepos (const message_ty *mp, ostream_t stream,
 
               size_t j;
               for (j = 0; j < filepos_count; j++)
-                if (strcmp (filepos[j].file_name, pp->file_name) == 0)
+                if (streq (filepos[j].file_name, pp->file_name))
                   break;
 
               if (j == filepos_count)
@@ -411,7 +411,7 @@ message_print_comment_filepos (const message_ty *mp, ostream_t stream,
                       ostream_write_str (stream, "\xE2\x81\xA9"); /* U+2069 */
                     }
                   else if (canon_charset != NULL
-                           && strcmp (canon_charset, "GB18030") == 0)
+                           && streq (canon_charset, "GB18030"))
                     {
                       ostream_write_str (stream, "\x81\x36\xAC\x34"); /* U+2068 */
                       ostream_write_str (stream, cp);
@@ -571,11 +571,11 @@ handle_filepos_comment_option (const char *option)
 {
   if (option != NULL)
     {
-      if (strcmp (option, "never") == 0 || strcmp (option, "no") == 0)
+      if (streq (option, "never") || streq (option, "no"))
         message_print_style_filepos (filepos_comment_none);
-      else if (strcmp (option, "full") == 0 || strcmp (option, "yes") == 0)
+      else if (streq (option, "full") || streq (option, "yes"))
         message_print_style_filepos (filepos_comment_full);
-      else if (strcmp (option, "file") == 0)
+      else if (streq (option, "file"))
         message_print_style_filepos (filepos_comment_file);
       else
         {
@@ -1540,7 +1540,7 @@ msgdomain_list_print_po (msgdomain_list_ty *mdlp, ostream_t stream,
       /* If the first domain is the default, don't bother emitting
          the domain name, because it is the default.  */
       if (!(k == 0
-            && strcmp (mdlp->item[k]->domain, MESSAGE_DOMAIN_DEFAULT) == 0))
+            && streq (mdlp->item[k]->domain, MESSAGE_DOMAIN_DEFAULT)))
         {
           if (blank_line)
             print_blank_line (stream);
@@ -1589,7 +1589,7 @@ msgdomain_list_print_po (msgdomain_list_ty *mdlp, ostream_t stream,
               charset = allocated_charset;
 
               /* Treat the dummy default value as if it were absent.  */
-              if (strcmp (charset, "CHARSET") == 0)
+              if (streq (charset, "CHARSET"))
                 charset = "ASCII";
             }
         }
index 97960a2a61959132990ff8690621c4ac5067186b..d9ef1ea6779771c0bedd0dcc357e64f7bf974559 100644 (file)
@@ -702,7 +702,7 @@ strings, not in the untranslated strings\n")));
       message_list_delete_header_field (mlp, "POT-Creation-Date:");
 
       FILE *output_file;
-      if (strcmp (domain_name, "-") == 0)
+      if (streq (domain_name, "-"))
         {
           output_file = stdout;
           SET_BINARY (fileno (output_file));
index b787c5e8c3edd689940c173d23e55532957c54df..51e000eaceab2d0e725a2be7accf5da37a4bf84c 100644 (file)
@@ -25,6 +25,7 @@
 #include <errno.h>
 #include <stdlib.h>
 #include <stdio.h>
+#include <string.h>
 
 #include <error.h>
 #include "msgl-iconv.h"
@@ -47,7 +48,7 @@ msgdomain_write_xml_bulk (msgfmt_operand_list_ty *operands,
                           const char *file_name)
 {
   FILE *fp;
-  if (strcmp (file_name, "-") == 0)
+  if (streq (file_name, "-"))
     fp = stdout;
   else
     {
index 075b7c8dc391b6cfcf3c8aac948f2f96b9fbbe7a..c9848154fb0fa6a0758ade79b47ddfc841b08e49 100644 (file)
@@ -488,11 +488,11 @@ phase3_get (token_ty *tp)
                     echo; echo $k; awk "function foo () { $k / 10 }" < /dev/null
                   done
              */
-            if (strcmp (tp->string, "do") == 0
-                || strcmp (tp->string, "exit") == 0
-                || strcmp (tp->string, "print") == 0
-                || strcmp (tp->string, "printf") == 0
-                || strcmp (tp->string, "return") == 0)
+            if (streq (tp->string, "do")
+                || streq (tp->string, "exit")
+                || streq (tp->string, "print")
+                || streq (tp->string, "printf")
+                || streq (tp->string, "return"))
               prefer_division_over_regexp = false;
             else
               prefer_division_over_regexp = true;
@@ -780,8 +780,8 @@ extract_parenthesized (message_list_ty *mlp,
               state = 0;
           }
           next_is_argument =
-            (strcmp (token.string, "print") == 0
-             || strcmp (token.string, "printf") == 0);
+            (streq (token.string, "print")
+             || streq (token.string, "printf"));
           next_context_iter =
             flag_context_list_iterator (
               flag_context_list_table_lookup (
index f7c118e78d7c1e45a22ff8cf8e2ecb7e7c9af3f5..00ecd939f2fe3b069f4762a902fd8bbe4fd88ebd 100644 (file)
@@ -1892,7 +1892,7 @@ phase6_get (token_ty *tp)
                  normal input.  */
               if (bufpos == 0
                   && tp->type == token_type_name
-                  && strcmp (tp->string, "define") == 0)
+                  && streq (tp->string, "define"))
                 return;
 
               /* Accumulate.  */
@@ -1908,7 +1908,7 @@ phase6_get (token_ty *tp)
       /* If it is a #line directive, with no macros to expand, act on
          it.  Ignore all other directives.  */
       if (bufpos >= 3 && buf[0].type == token_type_name
-          && strcmp (buf[0].string, "line") == 0
+          && streq (buf[0].string, "line")
           && buf[1].type == token_type_number
           && buf[2].type == token_type_string_literal)
         {
index 582276c0a4cb376019357ac67445d65c86c4944c..5145db57c7ca549a828bcde000730f42f2905521 100644 (file)
@@ -1257,7 +1257,7 @@ scan_import_spec (TSNode import_spec_node)
       /* A package is imported without a name.
          The package_shortname is the last element of the path, except in
          special cases.  */
-      if (strcmp (path, SNAPCORE_PACKAGE_FULLNAME) == 0)
+      if (streq (path, SNAPCORE_PACKAGE_FULLNAME))
         shortname = sd_from_c (SNAPCORE_PACKAGE_SHORTNAME);
       else
         {
@@ -1423,7 +1423,7 @@ get_type_from_type_name (string_desc_t type_name, type_env_t tenv, bool use_indi
       for (size_t i = 0; i < unqualified_packages.nitems; i++)
         {
           const char *unqualified_package = unqualified_packages.item[i];
-          if (strcmp (unqualified_package, GOTEXT_PACKAGE_FULLNAME) == 0)
+          if (streq (unqualified_package, GOTEXT_PACKAGE_FULLNAME))
             {
               if (hash_find_entry (&gotext_package.defined_types,
                                    sd_data (type_name), sd_length (type_name),
@@ -1431,7 +1431,7 @@ get_type_from_type_name (string_desc_t type_name, type_env_t tenv, bool use_indi
                   == 0)
                 return (go_type_t *) found_type;
             }
-          else if (strcmp (unqualified_package, SNAPCORE_PACKAGE_FULLNAME) == 0)
+          else if (streq (unqualified_package, SNAPCORE_PACKAGE_FULLNAME))
             {
               if (hash_find_entry (&snapcore_package.defined_types,
                                    sd_data (type_name), sd_length (type_name),
@@ -1539,7 +1539,7 @@ get_type_from_type_node (TSNode type_node, type_env_t tenv, bool use_indirection
                            &found_package)
           == 0)
         {
-          if (strcmp ((const char *) found_package, GOTEXT_PACKAGE_FULLNAME) == 0)
+          if (streq ((const char *) found_package, GOTEXT_PACKAGE_FULLNAME))
             {
               /* Look up the type.  */
               TSNode name_node = ts_node_child_by_field_id (type_node, ts_field_name);
@@ -1553,7 +1553,7 @@ get_type_from_type_node (TSNode type_node, type_env_t tenv, bool use_indirection
                   == 0)
                 return (go_type_t *) found_type;
             }
-          else if (strcmp ((const char *) found_package, SNAPCORE_PACKAGE_FULLNAME) == 0)
+          else if (streq ((const char *) found_package, SNAPCORE_PACKAGE_FULLNAME))
             {
               /* Look up the type.  */
               TSNode name_node = ts_node_child_by_field_id (type_node, ts_field_name);
@@ -1996,7 +1996,7 @@ variable_env_lookup (string_desc_t var_name, variable_env_t venv)
     for (size_t i = 0; i < unqualified_packages.nitems; i++)
       {
         const char *unqualified_package = unqualified_packages.item[i];
-        if (strcmp (unqualified_package, GOTEXT_PACKAGE_FULLNAME) == 0)
+        if (streq (unqualified_package, GOTEXT_PACKAGE_FULLNAME))
           {
             if (hash_find_entry (&gotext_package.globals,
                                  sd_data (var_name), sd_length (var_name),
@@ -2004,7 +2004,7 @@ variable_env_lookup (string_desc_t var_name, variable_env_t venv)
                 == 0)
               return (go_type_t *) found_type;
           }
-        else if (strcmp (unqualified_package, SNAPCORE_PACKAGE_FULLNAME) == 0)
+        else if (streq (unqualified_package, SNAPCORE_PACKAGE_FULLNAME))
           {
             if (hash_find_entry (&snapcore_package.globals,
                                  sd_data (var_name), sd_length (var_name),
@@ -2059,8 +2059,8 @@ type_equals (go_type_t *type1, go_type_t *type2, unsigned int maxdepth)
               {
                 unsigned int n = type1->u.struct_def.n_members;
                 for (unsigned int i = 0; i < n; i++)
-                  if (strcmp (type1->u.struct_def.members[i].name,
-                              type2->u.struct_def.members[i].name) != 0)
+                  if (!streq (type1->u.struct_def.members[i].name,
+                              type2->u.struct_def.members[i].name))
                     return false;
                 for (unsigned int i = 0; i < n; i++)
                   if (!type_equals (type1->u.struct_def.members[i].type,
@@ -2071,8 +2071,8 @@ type_equals (go_type_t *type1, go_type_t *type2, unsigned int maxdepth)
               {
                 unsigned int n = type1->u.struct_def.n_methods;
                 for (unsigned int i = 0; i < n; i++)
-                  if (strcmp (type1->u.struct_def.methods[i].name,
-                              type2->u.struct_def.methods[i].name) != 0)
+                  if (!streq (type1->u.struct_def.methods[i].name,
+                              type2->u.struct_def.methods[i].name))
                     return false;
                 for (unsigned int i = 0; i < n; i++)
                   if (!type_equals (type1->u.struct_def.methods[i].type,
@@ -2090,8 +2090,8 @@ type_equals (go_type_t *type1, go_type_t *type2, unsigned int maxdepth)
               {
                 unsigned int n = type1->u.interface_def.n_methods;
                 for (unsigned int i = 0; i < n; i++)
-                  if (strcmp (type1->u.interface_def.methods[i].name,
-                              type2->u.interface_def.methods[i].name) != 0)
+                  if (!streq (type1->u.interface_def.methods[i].name,
+                              type2->u.interface_def.methods[i].name))
                     return false;
                 for (unsigned int i = 0; i < n; i++)
                   if (!type_equals (type1->u.interface_def.methods[i].type,
@@ -2249,7 +2249,7 @@ get_mvtypes_of_expression (unsigned int mvcount, go_type_t **result,
               == 0)
             {
               /* The operand is a package name.  */
-              if (strcmp ((const char *) found_package, GOTEXT_PACKAGE_FULLNAME) == 0)
+              if (streq ((const char *) found_package, GOTEXT_PACKAGE_FULLNAME))
                 {
                   /* Look up the entity in the package.  */
                   void *found_type;
@@ -2259,7 +2259,7 @@ get_mvtypes_of_expression (unsigned int mvcount, go_type_t **result,
                       == 0)
                     return1 ((go_type_t *) found_type);
                 }
-              else if (strcmp ((const char *) found_package, SNAPCORE_PACKAGE_FULLNAME) == 0)
+              else if (streq ((const char *) found_package, SNAPCORE_PACKAGE_FULLNAME))
                 {
                   /* Look up the entity in the package.  */
                   void *found_type;
@@ -3072,7 +3072,7 @@ extract_from_function_call (TSNode callee_node,
             {
               qualified_identifier = true;
               /* The operand is a package name.  */
-              if (strcmp ((const char *) found_package, GOTEXT_PACKAGE_FULLNAME) == 0)
+              if (streq ((const char *) found_package, GOTEXT_PACKAGE_FULLNAME))
                 {
                   /* Look in the gotext_keywords table.  */
                   void *keyword_value;
@@ -3082,7 +3082,7 @@ extract_from_function_call (TSNode callee_node,
                       == 0)
                     next_shapes = (const struct callshapes *) keyword_value;
                 }
-              else if (strcmp ((const char *) found_package, SNAPCORE_PACKAGE_FULLNAME) == 0)
+              else if (streq ((const char *) found_package, SNAPCORE_PACKAGE_FULLNAME))
                 {
                   /* Look in the snapcore_keywords table.  */
                   void *keyword_value;
index 4f88e378252a9973307a2da45988722e98af5b55..8bb265f4b627758e9487b1eb44fc55447deecc91 100644 (file)
@@ -1737,7 +1737,7 @@ extract_parenthesized (message_list_ty *mlp, token_type_ty terminator,
                java-printf-format, whereas in
                  foobar (EXPR).formatted()
                they should not.  */
-            if (strcmp (sum, "return") != 0)
+            if (!streq (sum, "return"))
               {
                 for (const char *dottedname = sum;;)
                   {
@@ -1806,7 +1806,7 @@ extract_parenthesized (message_list_ty *mlp, token_type_ty terminator,
                 token_ty token3;
                 x_java_lex (&token3);
                 if (token3.type == token_type_symbol
-                    && strcmp (token3.string, "formatted") == 0)
+                    && streq (token3.string, "formatted"))
                   {
                     /* Mark the messages found in the region as java-printf-format
                        a posteriori.  */
index ae48cb789b621dc19842eda98980795e2fb78b86..08338a82711fc61bd786dc96d83e02f750818ca5 100644 (file)
@@ -204,7 +204,7 @@ gnome_step1 (string_list_ty *parts)
 static tag_step1_fn
 get_tag_step1_fn (const char *format)
 {
-  if (strcmp (format, "javascript-gnome-format") == 0)
+  if (streq (format, "javascript-gnome-format"))
     return gnome_step1;
   /* ... More formats can be added here ...  */
   return NULL;
@@ -1386,8 +1386,8 @@ phase5_get (token_ty *tp)
                 break;
               }
             tp->string = sb_xdupfree_c (&buffer);
-            if (strcmp (tp->string, "return") == 0
-                || strcmp (tp->string, "else") == 0)
+            if (streq (tp->string, "return")
+                || streq (tp->string, "else"))
               tp->type = last_token_type = token_type_keyword;
             else
               tp->type = last_token_type = token_type_symbol;
index fdec2e6581a73f8c4f21555f8f60e350b2d5b412..7cea7688b9d46277fac37f481d64909f58cf4583 100644 (file)
@@ -25,6 +25,7 @@
 #include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 
 #define SB_NO_APPENDF
 #include <error.h>
@@ -818,17 +819,17 @@ phase3_get (token_ty *tp)
               phase1_ungetc (c);
 
               const char *contents = sb_xcontents_c (&buffer);
-              if (strcmp (contents, "not") == 0)
+              if (streq (contents, "not"))
                 {
                   sb_free (&buffer);
                   tp->type = token_type_operator1;
                 }
-              else if (strcmp (contents, "and") == 0)
+              else if (streq (contents, "and"))
                 {
                   sb_free (&buffer);
                   tp->type = token_type_operator2;
                 }
-              else if (strcmp (contents, "or") == 0)
+              else if (streq (contents, "or"))
                 {
                   sb_free (&buffer);
                   tp->type = token_type_operator2;
index 7fcc3627bdb2cd4c77b935fa46000674138568a3..937021cef263945b0221843c6410faf7e794460a 100644 (file)
@@ -495,7 +495,7 @@ get_here_document (struct perl_extractor *xp, const char *delimiter)
         }
 
       /* See whether this line terminates the here document.  */
-      if (strcmp (my_linebuf, delimiter) == 0)
+      if (streq (my_linebuf, delimiter))
         break;
 
       /* Add back the trailing newline to my_linebuf.  */
@@ -2383,36 +2383,36 @@ x_perl_prelex (struct perl_extractor *xp, token_ty *tp)
               }
             const char *contents = sb_xcontents_c (&buffer);
 
-            if (strcmp (contents, "__END__") == 0
-                || strcmp (contents, "__DATA__") == 0)
+            if (streq (contents, "__END__")
+                || streq (contents, "__DATA__"))
               {
                 sb_free (&buffer);
                 xp->end_of_file = true;
                 tp->type = token_type_eof;
                 return;
               }
-            else if (strcmp (contents, "and") == 0
-                     || strcmp (contents, "cmp") == 0
-                     || strcmp (contents, "eq") == 0
-                     || strcmp (contents, "if") == 0
-                     || strcmp (contents, "ge") == 0
-                     || strcmp (contents, "gt") == 0
-                     || strcmp (contents, "le") == 0
-                     || strcmp (contents, "lt") == 0
-                     || strcmp (contents, "ne") == 0
-                     || strcmp (contents, "not") == 0
-                     || strcmp (contents, "or") == 0
-                     || strcmp (contents, "unless") == 0
-                     || strcmp (contents, "while") == 0
-                     || strcmp (contents, "xor") == 0)
+            else if (streq (contents, "and")
+                     || streq (contents, "cmp")
+                     || streq (contents, "eq")
+                     || streq (contents, "if")
+                     || streq (contents, "ge")
+                     || streq (contents, "gt")
+                     || streq (contents, "le")
+                     || streq (contents, "lt")
+                     || streq (contents, "ne")
+                     || streq (contents, "not")
+                     || streq (contents, "or")
+                     || streq (contents, "unless")
+                     || streq (contents, "while")
+                     || streq (contents, "xor"))
               {
                 tp->type = token_type_named_op;
                 tp->string = sb_xdupfree_c (&buffer);
                 return;
               }
-            else if (strcmp (contents, "s") == 0
-                   || strcmp (contents, "y") == 0
-                   || strcmp (contents, "tr") == 0)
+            else if (streq (contents, "s")
+                   || streq (contents, "y")
+                   || streq (contents, "tr"))
               {
                 int delim = phase1_getc (xp);
 
@@ -2447,7 +2447,7 @@ x_perl_prelex (struct perl_extractor *xp, token_ty *tp)
                 phase1_ungetc (xp, c);
                 return;
               }
-            else if (strcmp (contents, "m") == 0)
+            else if (streq (contents, "m"))
               {
                 int delim = phase1_getc (xp);
 
@@ -2487,11 +2487,11 @@ x_perl_prelex (struct perl_extractor *xp, token_ty *tp)
                 phase1_ungetc (xp, c);
                 return;
               }
-            else if (strcmp (contents, "qq") == 0
-                     || strcmp (contents, "q") == 0
-                     || strcmp (contents, "qx") == 0
-                     || strcmp (contents, "qw") == 0
-                     || strcmp (contents, "qr") == 0)
+            else if (streq (contents, "qq")
+                     || streq (contents, "q")
+                     || streq (contents, "qx")
+                     || streq (contents, "qw")
+                     || streq (contents, "qr"))
               {
                 /* The qw (...) construct is not really a string but we
                    can treat in the same manner and then pretend it is
@@ -2560,7 +2560,7 @@ x_perl_prelex (struct perl_extractor *xp, token_ty *tp)
                 return;
               }
             tp->type = token_type_symbol;
-            tp->sub_type = (strcmp (contents, "sub") == 0
+            tp->sub_type = (streq (contents, "sub")
                             ? symbol_type_sub
                             : symbol_type_none);
             tp->string = sb_xdupfree_c (&buffer);
@@ -2914,28 +2914,28 @@ x_perl_lex (struct perl_extractor *xp)
               /* Instance method, not chained.  */
               xp->last_token_type = token_type_variable;
             }
-          else if (strcmp (tp->string, "wantarray") == 0
-                   || strcmp (tp->string, "fork") == 0
-                   || strcmp (tp->string, "getlogin") == 0
-                   || strcmp (tp->string, "getppid") == 0
-                   || strcmp (tp->string, "getpwent") == 0
-                   || strcmp (tp->string, "getgrent") == 0
-                   || strcmp (tp->string, "gethostent") == 0
-                   || strcmp (tp->string, "getnetent") == 0
-                   || strcmp (tp->string, "getprotoent") == 0
-                   || strcmp (tp->string, "getservent") == 0
-                   || strcmp (tp->string, "setpwent") == 0
-                   || strcmp (tp->string, "setgrent") == 0
-                   || strcmp (tp->string, "endpwent") == 0
-                   || strcmp (tp->string, "endgrent") == 0
-                   || strcmp (tp->string, "endhostent") == 0
-                   || strcmp (tp->string, "endnetent") == 0
-                   || strcmp (tp->string, "endprotoent") == 0
-                   || strcmp (tp->string, "endservent") == 0
-                   || strcmp (tp->string, "time") == 0
-                   || strcmp (tp->string, "times") == 0
-                   || strcmp (tp->string, "wait") == 0
-                   || strcmp (tp->string, "wantarray") == 0)
+          else if (streq (tp->string, "wantarray")
+                   || streq (tp->string, "fork")
+                   || streq (tp->string, "getlogin")
+                   || streq (tp->string, "getppid")
+                   || streq (tp->string, "getpwent")
+                   || streq (tp->string, "getgrent")
+                   || streq (tp->string, "gethostent")
+                   || streq (tp->string, "getnetent")
+                   || streq (tp->string, "getprotoent")
+                   || streq (tp->string, "getservent")
+                   || streq (tp->string, "setpwent")
+                   || streq (tp->string, "setgrent")
+                   || streq (tp->string, "endpwent")
+                   || streq (tp->string, "endgrent")
+                   || streq (tp->string, "endhostent")
+                   || streq (tp->string, "endnetent")
+                   || streq (tp->string, "endprotoent")
+                   || streq (tp->string, "endservent")
+                   || streq (tp->string, "time")
+                   || streq (tp->string, "times")
+                   || streq (tp->string, "wait")
+                   || streq (tp->string, "wantarray"))
             {
               /* A Perl built-in function that does not accept arguments.  */
               xp->last_token_type = token_type_variable;
index 24f23ed874135945386fa85ca4f2e9c9f28290ba..7e273302bfb2f59bd076b7f0a7734c478c3be588 100644 (file)
@@ -26,6 +26,7 @@
 #include <stdio.h>
 #include <stddef.h>
 #include <stdlib.h>
+#include <string.h>
 
 #define SB_NO_APPENDF
 #include <error.h>
@@ -483,7 +484,7 @@ extract_rsj (FILE *f,
             if (c != ':')
               goto invalid_json;
 
-            if (strcmp (s1, "version") == 0)
+            if (streq (s1, "version"))
               {
                 /* Parse an integer.  */
                 if (parse_integer () != pr_parsed)
@@ -491,14 +492,14 @@ extract_rsj (FILE *f,
                     sb_free (&buffer);
                     goto invalid_rsj;
                   }
-                if (strcmp (sb_xcontents_c (&buffer), "1") != 0)
+                if (!streq (sb_xcontents_c (&buffer), "1"))
                   {
                     sb_free (&buffer);
                     goto invalid_rsj_version;
                   }
                 sb_free (&buffer);
               }
-            else if (strcmp (s1, "strings") == 0)
+            else if (streq (s1, "strings"))
               {
                 /* Parse an array.  */
                 c = phase2_getc ();
@@ -537,7 +538,7 @@ extract_rsj (FILE *f,
                                 if (c != ':')
                                   goto invalid_json;
 
-                                if (strcmp (s2, "hash") == 0)
+                                if (streq (s2, "hash"))
                                   {
                                     /* Parse an integer.  */
                                     if (parse_integer () != pr_parsed)
@@ -547,7 +548,7 @@ extract_rsj (FILE *f,
                                       }
                                     sb_free (&buffer);
                                   }
-                                else if (strcmp (s2, "name") == 0)
+                                else if (streq (s2, "name"))
                                   {
                                     /* Parse a string.  */
                                     enum parse_result r = parse_string ();
@@ -559,7 +560,7 @@ extract_rsj (FILE *f,
                                       mixed_string_contents_free1 (
                                         mixed_string_buffer_result (&stringbuf));
                                   }
-                                else if (strcmp (s2, "sourcebytes") == 0)
+                                else if (streq (s2, "sourcebytes"))
                                   {
                                     /* Parse an array.  */
                                     c = phase2_getc ();
@@ -589,7 +590,7 @@ extract_rsj (FILE *f,
                                           }
                                       }
                                   }
-                                else if (strcmp (s2, "value") == 0)
+                                else if (streq (s2, "value"))
                                   {
                                     /* Parse a string.  */
                                     enum parse_result r = parse_string ();
index fc8e3052f6f92f1296ea2bdcafcf39d6be7ead19..48fb15e30968c10feb4726c7c37857349e1a6626 100644 (file)
@@ -1349,7 +1349,7 @@ read_command (int looking_for, flag_region_ty *outer_region)
                     mixed_string_contents_free1 (
                       mixed_string_buffer_cloned_result (inner.token));
 
-                  if (strcmp (function_name, "env") == 0)
+                  if (streq (function_name, "env"))
                     {
                       /* The 'env' command just introduces more assignments.
                          Ignore it.  */
index 15da1b2d83b74a4e57b8157563ed5560d3e95b1f..4f5520060d79326bb62bb5a486bae458e4a2b5a7 100644 (file)
@@ -24,6 +24,7 @@
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 
 #define SB_NO_APPENDF
 #include <error.h>
@@ -521,7 +522,7 @@ phase4_get (token_ty *tp)
           phase3_get (&token2);
 
           if (token2.type == token_type_symbol
-              && strcmp (token2.string, ",") == 0)
+              && streq (token2.string, ","))
             {
               token_ty token3;
               phase3_get (&token3);
@@ -613,10 +614,10 @@ extract_smalltalk (FILE *f,
         switch (token.type)
           {
           case token_type_symbol:
-            state = (strcmp (token.string, "NLS") == 0 ? 1 :
-                     strcmp (token.string, "?") == 0 && state == 1 ? 2 :
-                     strcmp (token.string, "at:") == 0 && state == 1 ? 3 :
-                     strcmp (token.string, "plural:") == 0 && state == 4 ? 5 :
+            state = (streq (token.string, "NLS") ? 1 :
+                     streq (token.string, "?") && state == 1 ? 2 :
+                     streq (token.string, "at:") && state == 1 ? 3 :
+                     streq (token.string, "plural:") && state == 4 ? 5 :
                      0);
             free_token (&token);
             break;
@@ -645,7 +646,7 @@ extract_smalltalk (FILE *f,
                 plural_mp =
                   remember_a_message (mlp, NULL, token.string, false,
                                       token2.type == token_type_symbol
-                                      && strcmp (token.string, "plural:") == 0,
+                                      && streq (token.string, "plural:"),
                                       null_context_region (), &pos,
                                       NULL, token.comment, false);
 
index cbc1bf52d1fadae72e1627c2160911e3e3870e3b..14046c2eaa3a1899fcce4f1211a7bf904d9c8741 100644 (file)
@@ -781,7 +781,7 @@ phase3_get (token_ty *tp)
                 break;
             }
             const char *contents = sb_xcontents_c (&buffer);
-            if (strcmp (contents, "return") == 0)
+            if (streq (contents, "return"))
               {
                 sb_free (&buffer);
                 tp->type = last_token_type = token_type_return;
@@ -1420,13 +1420,13 @@ extract_balanced (message_list_ty *mlp, token_type_ty delim,
             token_ty token2;
             x_vala_lex (&token2);
             if (token2.type == token_type_symbol
-                && strcmp (token2.string, ".") == 0)
+                && streq (token2.string, "."))
               {
                 token_ty token3;
                 x_vala_lex (&token3);
                 if (token3.type == token_type_symbol
-                    && (strcmp (token3.string, "printf") == 0
-                        || strcmp (token3.string, "vprintf") == 0))
+                    && (streq (token3.string, "printf")
+                        || streq (token3.string, "vprintf")))
                   {
                     /* Mark the messages found in the region as c-format
                        a posteriori.  */
index ca9cc567c6ad749d62d79c95ddd959854e9e69a0..acf6983ea045f32741e07ac8e48b294d4e339324 100644 (file)
@@ -457,7 +457,7 @@ arglist_parser_done (struct arglist_parser *ap, int argnum)
                     best_msgctxt = ctxt;
                   else
                     {
-                      if (strcmp (ctxt, best_msgctxt) != 0)
+                      if (!streq (ctxt, best_msgctxt))
                         if_error (IF_SEVERITY_WARNING,
                                   best_cp->msgid_plural_pos.file_name,
                                   best_cp->msgid_plural_pos.line_number,
@@ -494,7 +494,7 @@ arglist_parser_done (struct arglist_parser *ap, int argnum)
                   if (mp != NULL && mp->comment_dot != NULL)
                     {
                       for (size_t k = 0; k < mp->comment_dot->nitems; k++)
-                        if (strcmp (xcomment, mp->comment_dot->item[k]) == 0)
+                        if (streq (xcomment, mp->comment_dot->item[k]))
                           {
                             found = true;
                             break;
index 1f8b117b366d3322b7dea9431c737aae826b9fc2..626e4c0762f7cb9942b141a80f747073343859d8 100644 (file)
@@ -22,6 +22,7 @@
 #include "xg-message.h"
 
 #include <stdio.h>
+#include <string.h>
 
 #include "c-strstr.h"
 #include "if-error.h"
@@ -497,8 +498,8 @@ meta information, not the empty string.\n"));
           {
             bool repeated = true;
             for (size_t i = 0; i < added; i++)
-              if (strcmp (mp->comment_dot->item[nitems_before - added + i],
-                          mp->comment_dot->item[nitems_before + i]) != 0)
+              if (!streq (mp->comment_dot->item[nitems_before - added + i],
+                          mp->comment_dot->item[nitems_before + i]))
                 {
                   repeated = false;
                   break;
index d8acd28690c07fca006d7803039009afdd0cd1f7..b9aeec3c125fb47a1a089752d70af7aca3086fc3 100644 (file)
@@ -721,7 +721,7 @@ main (int argc, char *argv[])
             size_t i;
             for (i = 0; i < NSYNTAXCHECKS; i++)
               {
-                if (strcmp (optarg, syntax_check_name[i]) == 0)
+                if (streq (optarg, syntax_check_name[i]))
                   {
                     default_syntax_check[i] = yes;
                     break;
@@ -737,7 +737,7 @@ main (int argc, char *argv[])
             size_t i;
             for (i = 0; i < NSYNTAXCHECKS; i++)
               {
-                if (strcmp (optarg, syntax_check_name[i]) == 0)
+                if (streq (optarg, syntax_check_name[i]))
                   {
                     default_syntax_check[i] = no;
                     break;
@@ -749,9 +749,9 @@ main (int argc, char *argv[])
           break;
 
         case CHAR_MAX + 19: /* --sentence-end */
-          if (strcmp (optarg, "single-space") == 0)
+          if (streq (optarg, "single-space"))
             sentence_end_required_spaces = 1;
-          else if (strcmp (optarg, "double-space") == 0)
+          else if (streq (optarg, "double-space"))
             sentence_end_required_spaces = 2;
           else
             error (EXIT_FAILURE, 0, _("sentence end type '%s' unknown"), optarg);
@@ -826,7 +826,7 @@ There is NO WARRANTY, to the extent permitted by law.\n\
     error (EXIT_FAILURE, 0, _("%s and %s are mutually exclusive"),
            "--kde", "--boost");
 
-  if (join_existing && strcmp (default_domain, "-") == 0)
+  if (join_existing && streq (default_domain, "-"))
     error (EXIT_FAILURE, 0,
            _("--join-existing cannot be used when output is written to stdout"));
 
@@ -885,14 +885,14 @@ xgettext cannot work without keywords to look for"));
        the special name "-" we write to stdout.  */
     if (output_file)
       {
-        if (IS_RELATIVE_FILE_NAME (output_file) && strcmp (output_file, "-") != 0)
+        if (IS_RELATIVE_FILE_NAME (output_file) && !streq (output_file, "-"))
           /* Please do NOT add a .po suffix! */
           file_name =
             xconcatenated_filename (defaulted_output_dir, output_file, NULL);
         else
           file_name = xstrdup (output_file);
       }
-    else if (strcmp (default_domain, "-") == 0)
+    else if (streq (default_domain, "-"))
       file_name = "-";
     else
       file_name =
@@ -903,7 +903,7 @@ xgettext cannot work without keywords to look for"));
   string_list_ty *file_list;
   if (files_from != NULL)
     {
-      if (strcmp (files_from, "-") != 0)
+      if (!streq (files_from, "-"))
         string_list_append (&files_for_vc_mtime, files_from);
       file_list = read_names_from_file (files_from);
     }
@@ -1016,7 +1016,7 @@ xgettext cannot work without keywords to look for"));
           /* If language is not determined from the file name
              extension, check ITS locating rules.  */
           if (language_from_extension == NULL
-              && strcmp (filename, "-") != 0)
+              && !streq (filename, "-"))
             {
               const char *its_basename =
                 locating_rule_list_locate (its_locating_rules,
@@ -1636,14 +1636,14 @@ xgettext_record_flag (const char *optionstring)
                 switch (type)
                   {
                   case format_c:
-                    if (backend == NULL || strcmp (backend, "C") == 0
-                        || strcmp (backend, "C++") == 0)
+                    if (backend == NULL || streq (backend, "C")
+                        || streq (backend, "C++"))
                       {
                         flag_context_list_table_insert (&flag_table_c, XFORMAT_PRIMARY,
                                                         name_start, name_end,
                                                         argnum, value, pass);
                       }
-                    if (backend == NULL || strcmp (backend, "C++") == 0)
+                    if (backend == NULL || streq (backend, "C++"))
                       {
                         flag_context_list_table_insert (&flag_table_cxx_qt, XFORMAT_PRIMARY,
                                                         name_start, name_end,
@@ -1655,19 +1655,19 @@ xgettext_record_flag (const char *optionstring)
                                                         name_start, name_end,
                                                         argnum, value, pass);
                       }
-                    if (backend == NULL || strcmp (backend, "ObjectiveC") == 0)
+                    if (backend == NULL || streq (backend, "ObjectiveC"))
                       {
                         flag_context_list_table_insert (&flag_table_objc, XFORMAT_PRIMARY,
                                                         name_start, name_end,
                                                         argnum, value, pass);
                       }
-                    if (backend == NULL || strcmp (backend, "D") == 0)
+                    if (backend == NULL || streq (backend, "D"))
                       {
                         flag_context_list_table_insert (&flag_table_d, XFORMAT_PRIMARY,
                                                         name_start, name_end,
                                                         argnum, value, pass);
                       }
-                    if (backend == NULL || strcmp (backend, "Vala") == 0)
+                    if (backend == NULL || streq (backend, "Vala"))
                       {
                         flag_context_list_table_insert (&flag_table_vala, XFORMAT_PRIMARY,
                                                         name_start, name_end,
@@ -2038,7 +2038,7 @@ xgettext_open (const char *fn,
   char *logical_file_name;
   char *new_name;
 
-  if (strcmp (fn, "-") == 0)
+  if (streq (fn, "-"))
     {
       new_name = xstrdup (_("standard input"));
       logical_file_name = xstrdup (new_name);
@@ -2549,21 +2549,21 @@ language_to_extractor (const char *name)
         /* Handle --qt.  It's preferrable to handle this facility here rather
            than through an option --language=C++/Qt because the latter would
            conflict with the language "C++" regarding the file extensions.  */
-        if (recognize_format_qt && strcmp (tp->name, "C++") == 0)
+        if (recognize_format_qt && streq (tp->name, "C++"))
           {
             result.flag_table = &flag_table_cxx_qt;
             result.formatstring_parser[XFORMAT_TERTIARY] = &formatstring_qt;
             result.formatstring_parser[XFORMAT_FOURTH]   = &formatstring_qt_plural;
           }
         /* Likewise for --kde.  */
-        if (recognize_format_kde && strcmp (tp->name, "C++") == 0)
+        if (recognize_format_kde && streq (tp->name, "C++"))
           {
             result.flag_table = &flag_table_cxx_kde;
             result.formatstring_parser[XFORMAT_TERTIARY] = &formatstring_kde;
             result.formatstring_parser[XFORMAT_FOURTH]   = &formatstring_kde_kuit;
           }
         /* Likewise for --boost.  */
-        if (recognize_format_boost && strcmp (tp->name, "C++") == 0)
+        if (recognize_format_boost && streq (tp->name, "C++"))
           {
             result.flag_table = &flag_table_cxx_boost;
             result.formatstring_parser[XFORMAT_TERTIARY] = &formatstring_boost;
@@ -2631,7 +2631,7 @@ extension_to_language (const char *extension)
   };
 
   for (table_ty *tp = table; tp < ENDOF(table); ++tp)
-    if (strcmp (extension, tp->extension) == 0)
+    if (streq (extension, tp->extension))
       return tp->language;
   return NULL;
 }