]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Use 'bool' where appropriate.
authorBruno Haible <bruno@clisp.org>
Mon, 2 Jul 2001 12:58:44 +0000 (12:58 +0000)
committerBruno Haible <bruno@clisp.org>
Mon, 2 Jul 2001 12:58:44 +0000 (12:58 +0000)
40 files changed:
ChangeLog
configure.in
lib/ChangeLog
lib/Makefile.am
lib/progname.c
lib/progname.h
lib/stdbool.h.in [new file with mode: 0644]
m4/ChangeLog
m4/Makefile.am
m4/stdbool.m4 [new file with mode: 0644]
src/ChangeLog
src/message.c
src/message.h
src/msgcat.c
src/msgcmp.c
src/msgcomm.c
src/msgconv.c
src/msgen.c
src/msgfmt.c
src/msggrep.c
src/msgl-charset.c
src/msgl-iconv.c
src/msgmerge.c
src/msgsed.c
src/msgunfmt.c
src/po-gram-gen.c
src/po-gram-gen.h
src/po-gram-gen.y
src/po-lex.c
src/po-lex.h
src/po.c
src/po.h
src/read-po.c
src/str-list.c
src/str-list.h
src/write-po.c
src/write-po.h
src/xget-lex.c
src/xget-lex.h
src/xgettext.c

index 3225a37bd283c5e32eb5909cf8a79df5e542ec10..bf4292198d03c460f5794c2a67f96d6bb611ec95 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2001-06-30  Bruno Haible  <haible@clisp.cons.org>
+
+       * configure.in: Call gt_STDBOOL_H.
+
 2001-06-25  Bruno Haible  <haible@clisp.cons.org>
 
        * configure.in (ACLOCAL_VERSION): Remove.
index 4db37e377addb895b716323e67bf80cf59ec58a9..f57c9085a0e429854e1936833f29c66317d4178a 100644 (file)
@@ -1,6 +1,6 @@
 dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ(2.13)
-AC_REVISION($Revision: 1.34 $)
+AC_REVISION($Revision: 1.35 $)
 AC_INIT(src/msgfmt.c)
 AM_INIT_AUTOMAKE(gettext, 0.11)
 RELEASE_DATE=2001-05-23      dnl in "date +%Y-%m-%d" format
@@ -34,6 +34,7 @@ dnl Checks for libraries.
 dnl Checks for header files.
 AC_HEADER_STDC
 AC_CHECK_HEADERS(limits.h malloc.h string.h unistd.h values.h)
+gt_STDBOOL_H
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
index e945f249acb1b1eec7b71a3fb6b4e2e65c443c89..5c9987906ebb39e9734488ed71ee62d28ee99419 100644 (file)
@@ -1,3 +1,14 @@
+2001-06-30  Bruno Haible  <haible@clisp.cons.org>
+
+       * stdbool.h.in: New file.
+       * Makefile.am (EXTRA_DIST): Add stdbool.h.in.
+       (all-local): Depend on @STDBOOL_H@.
+       (stdbool.h): New rule.
+       (MOSTLYCLEANFILES): New variable.
+       * progname.h: Include stdbool.h.
+       (error_with_progname): Change type to bool.
+       * progname.c (error_with_progname): Likewise.
+
 2001-06-25  Bruno Haible  <haible@clisp.cons.org>
 
        * mbswidth.c (mbsinit): Define to 1 if not defined. For SCO 3.2v5.0.2.
index 84ac17f57499d18cdc4344bb9e8ac29698aea5d9..abaae75a12832c9c28bbe0945877c0aafa71ae4b 100644 (file)
@@ -24,6 +24,7 @@ noinst_LIBRARIES = libnlsut.a
 EXTRA_DIST = alloca.c config.charset error.c getline.c memset.c memmove.c \
 printf-prs.c ref-add.sin ref-del.sin stpcpy.c stpncpy.c strcasecmp.c \
 strcspn.c strncasecmp.c strstr.c strtol.c strtoul.c vasprintf.c \
+stdbool.h.in \
 gen-lbrkprop.c 3level.h
 
 libnlsut_a_SOURCES = basename.c c-ctype.c concatpath.c findprog.c fstrcmp.c \
@@ -42,6 +43,12 @@ DEFS = -DLIBDIR=\"$(libdir)\" @DEFS@
 INCLUDES = -I. -I$(srcdir) -I.. -I../intl
 
 
+all-local: @STDBOOL_H@
+stdbool.h: stdbool.h.in
+       cp $(srcdir)/stdbool.h.in stdbool.h
+MOSTLYCLEANFILES = @STDBOOL_H@
+
+
 # The following is needed in order to install a simple file in $(libdir)
 # which is shared with other installed packages. We use a list of referencing
 # packages so that "make uninstall" will remove the file if and only if it
index 7bf9ff466d590aae1d1616694f1cd57f3baede23..9d3b93d07a75d28879532da794dee08ee1d61f6f 100644 (file)
@@ -45,7 +45,7 @@ set_program_name (argv0)
 
 /* Indicates whether errors and warnings get prefixed with program_name.
    Default is true.  */
-int error_with_progname = 1;
+bool error_with_progname = true;
 
 /* Print program_name prefix on stderr if and only if error_with_progname
    is true.  */
index aaddd88fa6b9f53e13aad8ffecf8c4067078337f..b6883115e758b25a0e831f4752f8cce341d50266 100644 (file)
@@ -19,6 +19,8 @@
 #ifndef _PROGNAME_H
 #define _PROGNAME_H
 
+#include <stdbool.h>
+
 /* This file supports selectively prefixing or nor prefixing error messages
    with the program name.
 
@@ -37,7 +39,7 @@ extern void set_program_name PARAMS ((const char *argv0));
    Default is true.
    A reason to omit the prefix is for better interoperability with Emacs'
    compile.el.  */
-extern int error_with_progname;
+extern bool error_with_progname;
 
 /* Print program_name prefix on stderr if and only if error_with_progname
    is true.  */
diff --git a/lib/stdbool.h.in b/lib/stdbool.h.in
new file mode 100644 (file)
index 0000000..705f93e
--- /dev/null
@@ -0,0 +1,34 @@
+/* Copyright (C) 2001 Free Software Foundation, Inc.
+   Written by Bruno Haible <haible@clisp.cons.org>, 2001.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+
+#ifndef _STDBOOL_H
+#define _STDBOOL_H
+
+/* ISO C 99 <stdbool.h> for platforms that lack it.  */
+
+/* 7.16. Boolean type and values */
+
+/* For the sake of symbolic names in gdb, define _Bool as an enum type.  */
+typedef enum { false = 0, true = 1 } _Bool;
+#define bool _Bool
+
+/* The other macros must be usable in preprocessor directives.  */
+#define false 0
+#define true 1
+#define __bool_true_false_are_defined 1
+
+#endif /* _STDBOOL_H */
index 86a89d951d1def9f04ae2a2d306130cf442eac9d..170f6962a1814141be5f2706fe0a1ad63fb33398 100644 (file)
@@ -1,3 +1,8 @@
+2001-06-30  Bruno Haible  <haible@clisp.cons.org>
+
+       * stdbool.m4: New file.
+       * Makefile.am (EXTRA_DIST): Add it.
+
 2001-06-25  Bruno Haible  <haible@clisp.cons.org>
 
        * mbswidth.m4: Also check for mbsinit. Needed for SCO 3.2v5.0.2.
index ed70d60972e4f26360e7c2aadcf0705102f84a49..aec67a2e07ebf68ea9592a6344e9071e414e0f74 100644 (file)
@@ -9,5 +9,5 @@ aclocal_DATA = codeset.m4 gettext.m4 glibc21.m4 iconv.m4 isc-posix.m4 lcmessage.
 EXTRA_DIST = README \
 c-bs-a.m4 codeset.m4 getline.m4 gettext.m4 glibc21.m4 iconv.m4 \
 inttypes_h.m4 isc-posix.m4 lcmessage.m4 libtool.m4 mbrtowc.m4 mbstate_t.m4 \
-mbswidth.m4 progtest.m4 setlocale.m4 signed.m4 ssize_t.m4 uintmax_t.m4 \
-ulonglong.m4 unionwait.m4
+mbswidth.m4 progtest.m4 setlocale.m4 signed.m4 ssize_t.m4 stdbool.m4 \
+uintmax_t.m4 ulonglong.m4 unionwait.m4
diff --git a/m4/stdbool.m4 b/m4/stdbool.m4
new file mode 100644 (file)
index 0000000..281e8dc
--- /dev/null
@@ -0,0 +1,31 @@
+dnl serial 1
+
+dnl From Bruno Haible.
+dnl Test whether <stdbool.h> is supported or must be substituted.
+
+AC_DEFUN([gt_STDBOOL_H],
+[dnl gcc 2.95.2 has an <stdbool.h> for which both 'true' and 'false' evaluate
+dnl to 0 in preprocessor expressions.
+AC_MSG_CHECKING([for stdbool.h])
+AC_CACHE_VAL(gt_cv_header_stdbool_h, [
+  AC_TRY_COMPILE([#include <stdbool.h>
+#if false
+int A[-1];
+#endif
+#define b -1
+#if true
+#undef b
+#define b 1
+#endif
+int B[b];
+], [], gt_cv_header_stdbool_h=yes, gt_cv_header_stdbool_h=no)])
+AC_MSG_RESULT([$gt_cv_header_stdbool_h])
+if test $gt_cv_header_stdbool_h = yes; then
+  AC_DEFINE(HAVE_STDBOOL_H, 1,
+            [Define if you have a working <stdbool.h> header file.])
+  STDBOOL_H=''
+else
+  STDBOOL_H='stdbool.h'
+fi
+AC_SUBST(STDBOOL_H)
+])
index fb2cc07fc7a69e8d9741b827c9ca1daa8e8c8a73..7738401b07e475c5c5b0d47de652bcc493b01ad5 100644 (file)
@@ -1,3 +1,122 @@
+2001-06-30  Bruno Haible  <haible@clisp.cons.org>
+
+       * message.h: Include stdbool.h.
+       (message_ty): Change type of fields 'is_fuzzy', 'obsolete' to bool.
+       (message_predicate_ty): Change return type to bool.
+       * message.c (message_alloc): Update.
+       * msgcat.c (is_message_selected): Change return type to bool.
+       (is_message_needed): Likewise.
+       (is_message_first_needed): Likewise.
+       (main): Use bool.
+       (catenate_msgdomain_list): Update. Use yes/no for is_c_format and
+       do_wrap.
+       * msgcmp.c (multi_domain_mode): Change type to bool.
+       (compare_directive_message): Change 'obsolete' argument type to bool.
+       (main): Use bool.
+       * msgcomm.c (is_message_selected): Change return type to bool.
+       (extract_directive_message): Change 'obsolete' argument type to bool.
+       (main): Use bool.
+       (struct extract_class_ty): Change type of field 'is_fuzzy' to bool.
+       Change type of field 'filepos_count' to size_t.
+       (extract_constructor): Update.
+       (extract_parse_brief): Update.
+       (extract_comment_special): Update.
+       (read_po_file): Update.
+       * msgconv.c (main): Use bool.
+       * msgen.c (main): Use bool.
+       * msgfmt.c (struct msgfmt_class_ty): Change type of fields 'is_fuzzy',
+       'has_header_entry' to bool.
+       (include_all): Change type to bool.
+       (do_check): Likewise.
+       (long_options): Update.
+       (format_directive_message): Change 'obsolete' argument type to bool.
+       (main): Use bool.
+       (format_constructor): Update.
+       (format_debrief): Update.
+       (format_comment_special): Update.
+       (check_pair): Update.
+       * msggrep.c (is_string_selected): Change return type to bool.
+       (is_message_selected): Likewise.
+       (main): Use bool.
+       * msgl-charset.c (compare_po_locale_charsets): Use bool.
+       * msgl-iconv.c (iconv_message_list): Update.
+       * msgmerge.c (quiet): Change type to bool.
+       (multi_domain_mode): Likewise.
+       (main): Use bool.
+       (match_domain): Update.
+       (merge): Update.
+       * msgsed.c (main): Use bool.
+       * msgunfmt.c (main): Use bool.
+       * po-gram-gen.y (string, stringlist, number, pos, rhs): Change type of
+       'obsolete' field to bool.
+       * po-lex.h: Include stdbool.h.
+       (pass_obsolete_entries): Change type to bool.
+       (po_lex_pass_comments): Change argument type to bool.
+       (po_lex_pass_obsolete_entries): Likewise.
+       (po_gram_error): Update.
+       (po_gram_error_at_line): Update.
+       * po-lex.c (po_lex_obsolete): Change type to bool.
+       (pass_comments): Likewise.
+       (pass_obsolete_entries): Likewise.
+       (lex_open): Update.
+       (lex_close): Update.
+       (po_gram_error): Update.
+       (po_gram_error_at_line): Update.
+       (po_gram_lex): Update.
+       (po_lex_pass_comments): Change argument type to bool.
+       (po_lex_pass_obsolete_entries): Likewise.
+       * po.h (struct po_method_ty): Change 'obsolete' argument type of
+       directive_message to bool.
+       (po_callback_message): Change 'obsolete' argument type to bool.
+       * po.c (po_directive_message): Change 'obsolete' argument type to bool.
+       (po_callback_message): Likewise.
+       * read-po.c (struct readall_class_ty): Change type of field 'is_fuzzy'
+       to bool.
+       (readall_directive_message): Change 'obsolete' argument type to bool.
+       (readall_constructor): Update.
+       (readall_parse_brief): Update.
+       (readall_comment_special): Update.
+       (read_po_file): Update.
+       * str-list.h: Include stdbool.h.
+       (string_list_member): Change return type to bool.
+       * str-list.c (string_list_member): Change return type to bool.
+       * write-po.h (message_print_style_escape, msgdomain_list_print): Change
+       argument type to bool.
+       * write-po.c (make_c_format_description_string) Change argument type
+       to bool.
+       (message_print): Likewise.
+       (message_print_obsolete): Likewise.
+       (indent): Change type to bool.
+       (uniforum): Likewise.
+       (escape): Likewise.
+       (message_print_style_indent): Update.
+       (message_print_style_uniforum): Update.
+       (message_print_style_escape): Change argument type to bool.
+       (wrap): Update.
+       (msgdomain_list_print): Change argument type to bool.
+       * xget-lex.h (xgettext_any_keywords): Change return type to bool.
+       * xget-lex.c (trigraphs): Change type to bool.
+       (default_keywords): Likewise.
+       (phase5_get): Use NULL not 0. Update.
+       (phaseX_get): Use bool.
+       (xgettext_lex): Update.
+       (xgettext_lex_keyword): Update.
+       (xgettext_any_keywords): Change return type to bool.
+       (xgettext_lex_trigraphs): Update.
+       * xgettext.c (add_all_comments): Change type to bool.
+       (extract_all): Likewise.
+       (long_options): Update.
+       (exclude_directive_message): Change 'obsolete' argument type to bool.
+       (extract_directive_message): Likewise.
+       (main): Use bool.
+       (scan_c_file): Update.
+       (struct extract_class_ty): Change type of field 'is_fuzzy' to bool.
+       Change type of field 'filepos_count' to size_t.
+       (extract_constructor): Update.
+       (extract_parse_brief): Update.
+       (extract_comment_special): Update.
+       (construct_header): Update.
+
 2001-06-25  Bruno Haible  <haible@clisp.cons.org>
 
        * msggrep.c (usage): Explain the pattern syntax.
index ff8d0712678362bafa4405a880a26ef1036498b8..96c08f6e1fa6ef575117c0af21d47c4ce3c6fd8c 100644 (file)
@@ -91,11 +91,11 @@ message_alloc (msgid, msgid_plural, msgstr, msgstr_len, pp)
   mp->comment_dot = NULL;
   mp->filepos_count = 0;
   mp->filepos = NULL;
-  mp->is_fuzzy = 0;
+  mp->is_fuzzy = false;
   mp->is_c_format = undecided;
   mp->do_wrap = undecided;
   mp->used = 0;
-  mp->obsolete = 0;
+  mp->obsolete = false;
   return mp;
 }
 
index bee267a9ec2e2ca60fb38b26d1ec082f8f492775..c864951dc91a82bf0728a69f94284b4d01447e16 100644 (file)
@@ -23,6 +23,8 @@
 #include "str-list.h"
 #include "pos.h"
 
+#include <stdbool.h>
+
 /* According to Sun's Uniforum proposal the default message domain is
    named 'messages'.  */
 #define MESSAGE_DOMAIN_DEFAULT "messages"
@@ -90,7 +92,7 @@ struct message_ty
   lex_pos_ty *filepos;
 
   /* Informations from special comments (e.g. generated by msgmerge).  */
-  int is_fuzzy;
+  bool is_fuzzy;
   enum is_c_format is_c_format;
 
   /* Do we want the string to be wrapped in the emitted PO file?  */
@@ -98,7 +100,7 @@ struct message_ty
 
   /* If set the message is obsolete and while writing out it should be
      commented out.  */
-  int obsolete;
+  bool obsolete;
 
   /* Used for checking that messages have been used, in the msgcmp,
      msgmerge, msgcomm and msgcat programs.  */
@@ -146,7 +148,7 @@ extern void
        message_list_prepend PARAMS ((message_list_ty *mlp, message_ty *mp));
 extern void
        message_list_delete_nth PARAMS ((message_list_ty *mlp, size_t n));
-typedef int message_predicate_ty PARAMS ((const message_ty *mp));
+typedef bool message_predicate_ty PARAMS ((const message_ty *mp));
 extern void
        message_list_remove_if_not PARAMS ((message_list_ty *mlp,
                                           message_predicate_ty *predicate));
index 260f59844be400e7bd26313f75ae1fbcd4bb2ff7..5f8d235dd1c7823fb6b56cf682a356cddcc22b3d 100644 (file)
@@ -87,9 +87,9 @@ static const struct option long_options[] =
 /* Prototypes for local functions.  */
 static void usage PARAMS ((int status));
 static string_list_ty *read_name_from_file PARAMS ((const char *file_name));
-static int is_message_selected PARAMS ((const message_ty *tmp));
-static int is_message_needed PARAMS ((const message_ty *tmp));
-static int is_message_first_needed PARAMS ((const message_ty *tmp));
+static bool is_message_selected PARAMS ((const message_ty *tmp));
+static bool is_message_needed PARAMS ((const message_ty *tmp));
+static bool is_message_first_needed PARAMS ((const message_ty *tmp));
 static msgdomain_list_ty *
        catenate_msgdomain_list PARAMS ((string_list_ty *file_list,
                                        const char *to_code));
@@ -102,14 +102,14 @@ main (argc, argv)
 {
   int cnt;
   int optchar;
-  int do_help;
-  int do_version;
+  bool do_help;
+  bool do_version;
   char *output_file;
   const char *files_from;
   string_list_ty *file_list;
   msgdomain_list_ty *result;
-  int sort_by_msgid = 0;
-  int sort_by_filepos = 0;
+  bool sort_by_msgid = false;
+  bool sort_by_filepos = false;
 
   /* Set program name for messages.  */
   program_name = argv[0];
@@ -125,8 +125,8 @@ main (argc, argv)
   textdomain (PACKAGE);
 
   /* Set default values for variables.  */
-  do_help = 0;
-  do_version = 0;
+  do_help = false;
+  do_version = false;
   output_file = NULL;
   files_from = NULL;
 
@@ -162,11 +162,11 @@ main (argc, argv)
        break;
 
       case 'e':
-       message_print_style_escape (0);
+       message_print_style_escape (false);
        break;
 
       case 'E':
-       message_print_style_escape (1);
+       message_print_style_escape (true);
        break;
 
       case 'f':
@@ -174,11 +174,11 @@ main (argc, argv)
        break;
 
       case 'F':
-       sort_by_filepos = 1;
+       sort_by_filepos = true;
         break;
 
       case 'h':
-       do_help = 1;
+       do_help = true;
        break;
 
       case 'i':
@@ -194,7 +194,7 @@ main (argc, argv)
        break;
 
       case 's':
-       sort_by_msgid = 1;
+       sort_by_msgid = true;
        break;
 
       case 'S':
@@ -210,7 +210,7 @@ main (argc, argv)
         break;
 
       case 'V':
-       do_version = 1;
+       do_version = true;
        break;
 
       case 'w':
@@ -282,7 +282,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
     msgdomain_list_sort_by_msgid (result);
 
   /* Write the PO file.  */
-  msgdomain_list_print (result, output_file, force_po, 0);
+  msgdomain_list_print (result, output_file, force_po, false);
 
   exit (EXIT_SUCCESS);
 }
@@ -442,7 +442,7 @@ read_name_from_file (file_name)
 }
 
 
-static int
+static bool
 is_message_selected (tmp)
      const message_ty *tmp;
 {
@@ -453,7 +453,7 @@ is_message_selected (tmp)
 }
 
 
-static int
+static bool
 is_message_needed (mp)
      const message_ty *mp;
 {
@@ -467,17 +467,17 @@ is_message_needed (mp)
 
 
 /* The use_first logic.  */
-static int
+static bool
 is_message_first_needed (mp)
      const message_ty *mp;
 {
   if (mp->tmp->obsolete && is_message_needed (mp))
     {
-      mp->tmp->obsolete = 0;
-      return 1;
+      mp->tmp->obsolete = false;
+      return true;
     }
   else
-    return 0;
+    return false;
 }
 
 
@@ -518,7 +518,7 @@ catenate_msgdomain_list (file_list, to_code)
          if (mlp->nitems > 0)
            {
              for (j = 0; j < mlp->nitems; j++)
-               if (mlp->item[j]->msgid[0] == '\0' && mlp->item[j]->obsolete == 0)
+               if (mlp->item[j]->msgid[0] == '\0' && !mlp->item[j]->obsolete)
                  {
                    const char *header = mlp->item[j]->msgstr;
 
@@ -588,7 +588,7 @@ domain \"%s\" in input file `%s' doesn't contain a header entry with a charset s
          char *project_id = NULL;
 
          for (j = 0; j < mlp->nitems; j++)
-           if (mlp->item[j]->msgid[0] == '\0' && mlp->item[j]->obsolete == 0)
+           if (mlp->item[j]->msgid[0] == '\0' && !mlp->item[j]->obsolete)
              {
                const char *header = mlp->item[j]->msgstr;
 
@@ -658,9 +658,9 @@ domain \"%s\" in input file `%s' doesn't contain a header entry with a charset s
                {
                  tmp = message_alloc (mp->msgid, mp->msgid_plural, NULL, 0,
                                       &mp->pos);
-                 tmp->is_c_format = 0; /* may be set to 1 later */
-                 tmp->do_wrap = 1; /* may be set to 0 later */
-                 tmp->obsolete = 1; /* may be set to 0 later */
+                 tmp->is_c_format = no; /* may be set to yes later */
+                 tmp->do_wrap = yes; /* may be set to no later */
+                 tmp->obsolete = true; /* may be set to false later */
                  message_list_append (total_mlp, tmp);
                }
 
@@ -725,7 +725,7 @@ domain \"%s\" in input file `%s' doesn't contain a header entry with a charset s
         all in a single encoding.  If so, conversion is not needed.  */
       const char *first = NULL;
       const char *second = NULL;
-      int with_UTF8 = 0;
+      bool with_UTF8 = false;
 
       for (n = 0; n < nfiles; n++)
        {
@@ -740,7 +740,7 @@ domain \"%s\" in input file `%s' doesn't contain a header entry with a charset s
                  second = canon_charsets[n][k];
 
                if (strcmp (canon_charsets[n][k], "UTF-8") == 0)
-                 with_UTF8 = 1;
+                 with_UTF8 = true;
              }
        }
 
@@ -888,13 +888,13 @@ To select a different output encoding, use the --to-code option.\n\
                  for (i = 0; i < mp->filepos_count; i++)
                    message_comment_filepos (tmp, mp->filepos[i].file_name,
                                             mp->filepos[i].line_number);
-                 tmp->is_fuzzy = 1;
-                 if (mp->is_c_format)
-                   tmp->is_c_format = 1;
-                 if (!mp->do_wrap)
-                   tmp->do_wrap = 0;
+                 tmp->is_fuzzy = true;
+                 if (mp->is_c_format == yes)
+                   tmp->is_c_format = yes;
+                 if (mp->do_wrap == no)
+                   tmp->do_wrap = no;
                  if (!mp->obsolete)
-                   tmp->obsolete = 0;
+                   tmp->obsolete = false;
                }
            }
        }
index 673c170201ab2e38a219d54dcb2bc9cfc16cc14e..5f2faeb45c40e6110a11c81136136e1d56249ba4 100644 (file)
@@ -39,7 +39,7 @@
 
 
 /* Apply the .pot file to each of the domains in the PO file.  */
-static int multi_domain_mode;
+static bool multi_domain_mode = false;
 
 /* Long options.  */
 static const struct option long_options[] =
@@ -68,7 +68,7 @@ static void compare_directive_message PARAMS ((po_ty *that, char *msgid,
                                               char *msgid_plural,
                                               char *msgstr, size_t msgstr_len,
                                               lex_pos_ty *msgstr_pos,
-                                              int obsolete));
+                                              bool obsolete));
 
 
 int
@@ -77,8 +77,8 @@ main (argc, argv)
      char *argv[];
 {
   int optchar;
-  int do_help;
-  int do_version;
+  bool do_help;
+  bool do_version;
 
   /* Set program name for messages.  */
   set_program_name (argv[0]);
@@ -94,8 +94,8 @@ main (argc, argv)
   bindtextdomain (PACKAGE, LOCALEDIR);
   textdomain (PACKAGE);
 
-  do_help = 0;
-  do_version = 0;
+  do_help = false;
+  do_version = false;
   while ((optchar = getopt_long (argc, argv, "D:hmV", long_options, NULL))
         != EOF)
     switch (optchar)
@@ -108,15 +108,15 @@ main (argc, argv)
        break;
 
       case 'h':
-       do_help = 1;
+       do_help = true;
        break;
 
       case 'm':
-       multi_domain_mode = 1;
+       multi_domain_mode = true;
        break;
 
       case 'V':
-       do_version = 1;
+       do_version = true;
        break;
 
       default:
@@ -403,7 +403,7 @@ compare_directive_message (that, msgid, msgid_pos, msgid_plural,
      char *msgstr;
      size_t msgstr_len;
      lex_pos_ty *msgstr_pos;
-     int obsolete;
+     bool obsolete;
 {
   compare_class_ty *this = (compare_class_ty *) that;
   message_ty *mp;
index 89d2d8aba6f344de745ccb021f6b108363c52215..3c87336657fd215d0d9650f9f4e7bfbea8aef5e6 100644 (file)
@@ -100,7 +100,7 @@ static void usage PARAMS ((int status))
 #endif
 ;
 static string_list_ty *read_name_from_file PARAMS ((const char *file_name));
-static int is_message_selected PARAMS ((const message_ty *mp));
+static bool is_message_selected PARAMS ((const message_ty *mp));
 static void extract_constructor PARAMS ((po_ty *that));
 static void extract_directive_domain PARAMS ((po_ty *that, char *name));
 static void extract_directive_message PARAMS ((po_ty *that, char *msgid,
@@ -108,7 +108,7 @@ static void extract_directive_message PARAMS ((po_ty *that, char *msgid,
                                               char *msgid_plural,
                                               char *msgstr, size_t msgstr_len,
                                               lex_pos_ty *msgstr_pos,
-                                              int obsolete));
+                                              bool obsolete));
 static void extract_parse_brief PARAMS ((po_ty *that));
 static void extract_comment PARAMS ((po_ty *that, const char *s));
 static void extract_comment_dot PARAMS ((po_ty *that, const char *s));
@@ -126,12 +126,12 @@ main (argc, argv)
 {
   int cnt;
   int optchar;
-  int do_help = 0;
-  int do_version = 0;
+  bool do_help = false;
+  bool do_version = false;
   message_list_ty *mlp;
   msgdomain_list_ty *result;
-  int sort_by_msgid = 0;
-  int sort_by_filepos = 0;
+  bool sort_by_msgid = false;
+  bool sort_by_filepos = false;
   const char *files_from = NULL;
   string_list_ty *file_list;
   char *output_file = NULL;
@@ -177,19 +177,19 @@ main (argc, argv)
        dir_list_append (optarg);
        break;
       case 'e':
-       message_print_style_escape (0);
+       message_print_style_escape (false);
        break;
       case 'E':
-       message_print_style_escape (1);
+       message_print_style_escape (true);
        break;
       case 'f':
        files_from = optarg;
        break;
       case 'F':
-       sort_by_filepos = 1;
+       sort_by_filepos = true;
         break;
       case 'h':
-       do_help = 1;
+       do_help = true;
        break;
       case 'i':
        message_print_style_indent ();
@@ -201,7 +201,7 @@ main (argc, argv)
        output_file = optarg;
        break;
       case 's':
-       sort_by_msgid = 1;
+       sort_by_msgid = true;
        break;
       case 'S':
        message_print_style_uniforum ();
@@ -210,7 +210,7 @@ main (argc, argv)
         less_than = 2;
         break;
       case 'V':
-       do_version = 1;
+       do_version = true;
        break;
       case 'w':
        {
@@ -298,7 +298,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
     msgdomain_list_sort_by_msgid (result);
 
   /* Write the PO file.  */
-  msgdomain_list_print (result, output_file, force_po, 0);
+  msgdomain_list_print (result, output_file, force_po, false);
 
   exit (EXIT_SUCCESS);
 }
@@ -455,7 +455,7 @@ read_name_from_file (file_name)
 }
 
 
-static int
+static bool
 is_message_selected (mp)
      const message_ty *mp;
 {
@@ -477,11 +477,11 @@ struct extract_class_ty
   string_list_ty *comment;
   string_list_ty *comment_dot;
 
-  int is_fuzzy;
+  bool is_fuzzy;
   enum is_c_format is_c_format;
   enum is_wrap do_wrap;
 
-  int filepos_count;
+  size_t filepos_count;
   lex_pos_ty *filepos;
 };
 
@@ -495,7 +495,7 @@ extract_constructor (that)
   this->mlp = NULL; /* actually set in read_po_file, below */
   this->comment = NULL;
   this->comment_dot = NULL;
-  this->is_fuzzy = 0;
+  this->is_fuzzy = false;
   this->is_c_format = undecided;
   this->do_wrap = undecided;
   this->filepos_count = 0;
@@ -522,7 +522,7 @@ extract_directive_message (that, msgid, msgid_pos, msgid_plural,
      char *msgstr;
      size_t msgstr_len;
      lex_pos_ty *msgstr_pos;
-     int obsolete;
+     bool obsolete;
 {
   extract_class_ty *this = (extract_class_ty *)that;
   message_ty *mp;
@@ -544,7 +544,7 @@ extract_directive_message (that, msgid, msgid_pos, msgid_plural,
       this->comment_dot = NULL;
       this->filepos_count = 0;
       this->filepos = NULL;
-      this->is_fuzzy = 0;
+      this->is_fuzzy = false;
       this->is_c_format = undecided;
       this->do_wrap = undecided;
       return;
@@ -566,9 +566,9 @@ extract_directive_message (that, msgid, msgid_pos, msgid_plural,
   /* The ``obsolete'' flag is cleared before reading each PO file.
      If thisflag is clear, set it, and increment the ``used'' counter.
      This allows us to count how many of the PO files use the message.  */
-  if (mp->obsolete == 0)
+  if (!mp->obsolete)
     {
-      mp->obsolete = 1;
+      mp->obsolete = true;
       mp->used++;
     }
 
@@ -607,7 +607,7 @@ extract_directive_message (that, msgid, msgid_pos, msgid_plural,
     free (this->filepos);
   this->filepos_count = 0;
   this->filepos = NULL;
-  this->is_fuzzy = 0;
+  this->is_fuzzy = false;
   this->is_c_format = undecided;
   this->do_wrap = undecided;
 }
@@ -617,7 +617,7 @@ static void
 extract_parse_brief (that)
      po_ty *that;
 {
-  po_lex_pass_comments (1);
+  po_lex_pass_comments (true);
 }
 
 
@@ -677,7 +677,7 @@ extract_comment_special (that, s)
   extract_class_ty *this = (extract_class_ty *) that;
 
   if (strstr (s, "fuzzy") != NULL)
-    this->is_fuzzy = 1;
+    this->is_fuzzy = true;
   if (strstr (s, "c-format") != NULL)
     this->is_c_format = yes;
   if (strstr (s, "no-c-format") != NULL)
@@ -730,5 +730,5 @@ read_po_file (file_name, mlp)
      is clear, it is set, and increment the ``used'' counter.  This
      allows us to count how many of the PO files use each message.  */
   for (j = 0; j < mlp->nitems; ++j)
-    mlp->item[j]->obsolete = 0;
+    mlp->item[j]->obsolete = false;
 }
index 4dfb316d31f1aee56eb3c5cc66504c4cf49fd34a..a13def5964e4c52d4b4298d5fd32d3015889b391 100644 (file)
@@ -79,13 +79,13 @@ main (argc, argv)
      char **argv;
 {
   int opt;
-  int do_help;
-  int do_version;
+  bool do_help;
+  bool do_version;
   char *output_file;
   const char *input_file;
   msgdomain_list_ty *result;
-  int sort_by_filepos = 0;
-  int sort_by_msgid = 0;
+  bool sort_by_filepos = false;
+  bool sort_by_msgid = false;
 
   /* Set program name for messages.  */
   program_name = argv[0];
@@ -101,8 +101,8 @@ main (argc, argv)
   textdomain (PACKAGE);
 
   /* Set default values for variables.  */
-  do_help = 0;
-  do_version = 0;
+  do_help = false;
+  do_version = false;
   output_file = NULL;
   input_file = NULL;
 
@@ -118,19 +118,19 @@ main (argc, argv)
        break;
 
       case 'e':
-       message_print_style_escape (0);
+       message_print_style_escape (false);
        break;
 
       case 'E':
-       message_print_style_escape (1);
+       message_print_style_escape (true);
        break;
 
       case 'F':
-       sort_by_filepos = 1;
+       sort_by_filepos = true;
        break;
 
       case 'h':
-       do_help = 1;
+       do_help = true;
        break;
 
       case 'i':
@@ -142,7 +142,7 @@ main (argc, argv)
        break;
 
       case 's':
-       sort_by_msgid = 1;
+       sort_by_msgid = true;
        break;
 
       case 'S':
@@ -154,7 +154,7 @@ main (argc, argv)
        break;
 
       case 'V':
-       do_version = 1;
+       do_version = true;
        break;
 
       case 'w':
@@ -219,7 +219,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
     msgdomain_list_sort_by_msgid (result);
 
   /* Write the merged message list out.  */
-  msgdomain_list_print (result, output_file, force_po, 0);
+  msgdomain_list_print (result, output_file, force_po, false);
 
   exit (EXIT_SUCCESS);
 }
index 75670b77845606c39df339212682a6c3c02d77d5..a555a45c73b74a7bb284b946bec3a7560ca40ac1 100644 (file)
@@ -73,12 +73,12 @@ main (argc, argv)
      char **argv;
 {
   int opt;
-  int do_help;
-  int do_version;
+  bool do_help;
+  bool do_version;
   char *output_file;
   msgdomain_list_ty *result;
-  int sort_by_filepos = 0;
-  int sort_by_msgid = 0;
+  bool sort_by_filepos = false;
+  bool sort_by_msgid = false;
 
   /* Set program name for messages.  */
   program_name = argv[0];
@@ -94,8 +94,8 @@ main (argc, argv)
   textdomain (PACKAGE);
 
   /* Set default values for variables.  */
-  do_help = 0;
-  do_version = 0;
+  do_help = false;
+  do_version = false;
   output_file = NULL;
 
   while ((opt = getopt_long (argc, argv, "D:eEFhio:sVw:", long_options, NULL))
@@ -110,19 +110,19 @@ main (argc, argv)
        break;
 
       case 'e':
-       message_print_style_escape (0);
+       message_print_style_escape (false);
        break;
 
       case 'E':
-       message_print_style_escape (1);
+       message_print_style_escape (true);
        break;
 
       case 'F':
-       sort_by_filepos = 1;
+       sort_by_filepos = true;
        break;
 
       case 'h':
-       do_help = 1;
+       do_help = true;
        break;
 
       case 'i':
@@ -134,7 +134,7 @@ main (argc, argv)
        break;
 
       case 's':
-       sort_by_msgid = 1;
+       sort_by_msgid = true;
        break;
 
       case 'S':
@@ -142,7 +142,7 @@ main (argc, argv)
        break;
 
       case 'V':
-       do_version = 1;
+       do_version = true;
        break;
 
       case 'w':
@@ -204,7 +204,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
     msgdomain_list_sort_by_msgid (result);
 
   /* Write the merged message list out.  */
-  msgdomain_list_print (result, output_file, force_po, 0);
+  msgdomain_list_print (result, output_file, force_po, false);
 
   exit (EXIT_SUCCESS);
 }
index e44bf4165ad8de1cfa816bcae3e27f733d805273..edd7864c8e817827e11430f2541acac618ccf9f9 100644 (file)
@@ -81,11 +81,11 @@ struct msgfmt_class_ty
   /* inherited instance variables, etc */
   PO_BASE_TY
 
-  int is_fuzzy;
+  bool is_fuzzy;
   enum is_c_format is_c_format;
   enum is_wrap do_wrap;
 
-  int has_header_entry;
+  bool has_header_entry;
 };
 
 /* Alignment of strings in resulting .mo file.  */
@@ -94,8 +94,8 @@ static size_t alignment;
 /* Contains exit status for case in which no premature exit occurs.  */
 static int exit_status;
 
-/* If nonzero include even fuzzy translations in output file.  */
-static int include_all;
+/* If true include even fuzzy translations in output file.  */
+static bool include_all = false;
 
 /* Nonzero if no hash table in .mo is wanted.  */
 static int no_hash_table;
@@ -123,9 +123,9 @@ static struct msg_domain *current_domain;
 /* If not zero list duplicate message identifiers.  */
 static int verbose_level;
 
-/* If not zero check strings according to format string rules for the
+/* If true check strings according to format string rules for the
    language.  */
-static int do_check;
+static bool do_check = false;
 
 /* Counters for statistics on translations for the processed files.  */
 static int msgs_translated;
@@ -139,7 +139,7 @@ static int do_statistics;
 static const struct option long_options[] =
 {
   { "alignment", required_argument, NULL, 'a' },
-  { "check", no_argument, &do_check, 1 },
+  { "check", no_argument, NULL, 'c' },
   { "directory", required_argument, NULL, 'D' },
   { "help", no_argument, NULL, 'h' },
   { "no-hash", no_argument, &no_hash_table, 1 },
@@ -177,7 +177,7 @@ static void format_directive_message PARAMS ((po_ty *pop, char *msgid,
                                              char *msgid_plural,
                                              char *msgstr, size_t msgstr_len,
                                              lex_pos_ty *msgstr_pos,
-                                             int obsolete));
+                                             bool obsolete));
 static void format_comment_special PARAMS ((po_ty *pop, const char *s));
 static void format_debrief PARAMS ((po_ty *));
 static struct msg_domain *new_domain PARAMS ((const char *name,
@@ -197,9 +197,9 @@ main (argc, argv)
      char *argv[];
 {
   int opt;
-  int do_help = 0;
-  int do_version = 0;
-  int strict_uniforum = 0;
+  bool do_help = false;
+  bool do_version = false;
+  bool strict_uniforum = false;
   struct msg_domain *domain;
 
   /* Set default value for global variables.  */
@@ -236,28 +236,28 @@ main (argc, argv)
        }
        break;
       case 'c':
-       do_check = 1;
+       do_check = true;
        break;
       case 'D':
        dir_list_append (optarg);
        break;
       case 'f':
-       include_all = 1;
+       include_all = true;
        break;
       case 'h':
-       do_help = 1;
+       do_help = true;
        break;
       case 'o':
        output_file_name = optarg;
        break;
       case 'S':
-       strict_uniforum = 1;
+       strict_uniforum = true;
        break;
       case 'v':
        ++verbose_level;
        break;
       case 'V':
-       do_version = 1;
+       do_version = true;
        break;
       default:
        usage (EXIT_FAILURE);
@@ -299,7 +299,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
 
   /* Prepare PO file reader.  We need to see the comments because inexact
      translations must be reported.  */
-  po_lex_pass_comments (1);
+  po_lex_pass_comments (true);
 
   /* Now write out all domains.  */
   /* Process all given .po files.  */
@@ -481,10 +481,10 @@ format_constructor (that)
 {
   msgfmt_class_ty *this = (msgfmt_class_ty *) that;
 
-  this->is_fuzzy = 0;
+  this->is_fuzzy = false;
   this->is_c_format = undecided;
   this->do_wrap = undecided;
-  this->has_header_entry = 0;
+  this->has_header_entry = false;
 }
 
 
@@ -498,7 +498,7 @@ format_debrief (that)
   /* Test whether header entry was found.
      FIXME: Should do this even if not in verbose mode, because the
      consequences are not harmless.  But it breaks the test suite.  */
-  if (verbose_level > 0 && this->has_header_entry == 0)
+  if (verbose_level > 0 && !this->has_header_entry)
     {
       multiline_error (xasprintf ("%s: ", gram_pos.file_name),
                       xasprintf (_("\
@@ -565,7 +565,7 @@ format_directive_message (that, msgid_string, msgid_pos, msgid_plural,
      char *msgstr_string;
      size_t msgstr_len;
      lex_pos_ty *msgstr_pos;
-     int obsolete;
+     bool obsolete;
 {
   msgfmt_class_ty *this = (msgfmt_class_ty *) that;
   struct hashtable_entry *entry;
@@ -579,12 +579,12 @@ format_directive_message (that, msgid_string, msgid_pos, msgid_plural,
        {
          /* We don't change the exit status here because this is really
             only an information.  */
-         error_with_progname = 0;
+         error_with_progname = false;
          error_at_line (0, 0, msgstr_pos->file_name, msgstr_pos->line_number,
                         (msgstr_string[0] == '\0'
                          ? _("empty `msgstr' entry ignored")
                          : _("fuzzy `msgstr' entry ignored")));
-         error_with_progname = 1;
+         error_with_progname = true;
        }
 
       /* Increment counter for fuzzy/untranslated messages.  */
@@ -601,7 +601,7 @@ format_directive_message (that, msgid_string, msgid_pos, msgid_plural,
       /* Test for header entry.  */
       if (msgid_string[0] == '\0')
        {
-         this->has_header_entry = 1;
+         this->has_header_entry = true;
 
          /* Do some more tests on test contents of the header entry.  */
          if (verbose_level > 0)
@@ -721,7 +721,7 @@ duplicate message definition"));
   free (msgid_string);
 
   /* Prepare for next message.  */
-  this->is_fuzzy = 0;
+  this->is_fuzzy = false;
   this->is_c_format = undecided;
   this->do_wrap = undecided;
 }
@@ -737,17 +737,17 @@ format_comment_special (that, s)
 
   if (strstr (s, "fuzzy") != NULL)
     {
-      static int warned = 0;
+      static bool warned = false;
 
-      if (!include_all && verbose_level > 1 && warned == 0)
+      if (!include_all && verbose_level > 1 && !warned)
        {
-         warned = 1;
+         warned = true;
          error (0, 0, _("\
 %s: warning: source file contains fuzzy translation"),
                 gram_pos.file_name);
        }
 
-      this->is_fuzzy = 1;
+      this->is_fuzzy = true;
     }
   this->is_c_format = parse_c_format_description_string (s);
   this->do_wrap = parse_c_width_description_string (s);
@@ -963,21 +963,21 @@ check_pair (msgid, msgid_pos, msgid_plural, msgstr, msgstr_len, msgstr_pos,
     {
       if (TEST_NEWLINE(msgid_plural) != has_newline)
        {
-         error_with_progname = 0;
+         error_with_progname = false;
          error_at_line (0, 0, msgid_pos->file_name, msgid_pos->line_number,
                         _("\
 `msgid' and `msgid_plural' entries do not both begin with '\\n'"));
-         error_with_progname = 1;
+         error_with_progname = true;
          exit_status = EXIT_FAILURE;
        }
       for (p = msgstr, i = 0; p < msgstr + msgstr_len; p += strlen (p) + 1, i++)
        if (TEST_NEWLINE(p) != has_newline)
          {
-           error_with_progname = 0;
+           error_with_progname = false;
            error_at_line (0, 0, msgid_pos->file_name, msgid_pos->line_number,
                           _("\
 `msgid' and `msgstr[%u]' entries do not both begin with '\\n'"), i);
-           error_with_progname = 1;
+           error_with_progname = true;
            exit_status = EXIT_FAILURE;
          }
     }
@@ -985,11 +985,11 @@ check_pair (msgid, msgid_pos, msgid_plural, msgstr, msgstr_len, msgstr_pos,
     {
       if (TEST_NEWLINE(msgstr) != has_newline)
        {
-         error_with_progname = 0;
+         error_with_progname = false;
          error_at_line (0, 0, msgid_pos->file_name, msgid_pos->line_number,
                         _("\
 `msgid' and `msgstr' entries do not both begin with '\\n'"));
-         error_with_progname = 1;
+         error_with_progname = true;
          exit_status = EXIT_FAILURE;
        }
     }
@@ -1002,21 +1002,21 @@ check_pair (msgid, msgid_pos, msgid_plural, msgstr, msgstr_len, msgstr_pos,
     {
       if (TEST_NEWLINE(msgid_plural) != has_newline)
        {
-         error_with_progname = 0;
+         error_with_progname = false;
          error_at_line (0, 0, msgid_pos->file_name, msgid_pos->line_number,
                         _("\
 `msgid' and `msgid_plural' entries do not both end with '\\n'"));
-         error_with_progname = 1;
+         error_with_progname = true;
          exit_status = EXIT_FAILURE;
        }
       for (p = msgstr, i = 0; p < msgstr + msgstr_len; p += strlen (p) + 1, i++)
        if (TEST_NEWLINE(p) != has_newline)
          {
-           error_with_progname = 0;
+           error_with_progname = false;
            error_at_line (0, 0, msgid_pos->file_name, msgid_pos->line_number,
                           _("\
 `msgid' and `msgstr[%u]' entries do not both end with '\\n'"), i);
-           error_with_progname = 1;
+           error_with_progname = true;
            exit_status = EXIT_FAILURE;
          }
     }
@@ -1024,11 +1024,11 @@ check_pair (msgid, msgid_pos, msgid_plural, msgstr, msgstr_len, msgstr_pos,
     {
       if (TEST_NEWLINE(msgstr) != has_newline)
        {
-         error_with_progname = 0;
+         error_with_progname = false;
          error_at_line (0, 0, msgid_pos->file_name, msgid_pos->line_number,
                         _("\
 `msgid' and `msgstr' entries do not both end with '\\n'"));
-         error_with_progname = 1;
+         error_with_progname = true;
          exit_status = EXIT_FAILURE;
        }
     }
@@ -1042,11 +1042,11 @@ check_pair (msgid, msgid_pos, msgid_plural, msgstr, msgstr_len, msgstr_pos,
       nstrfmts = parse_printf_format (msgstr, 0, NULL);
       if (nidfmts != nstrfmts)
        {
-         error_with_progname = 0;
+         error_with_progname = false;
          error_at_line (0, 0, msgid_pos->file_name, msgid_pos->line_number,
                         _("\
 number of format specifications in `msgid' and `msgstr' does not match"));
-         error_with_progname = 1;
+         error_with_progname = true;
          exit_status = EXIT_FAILURE;
        }
       else
@@ -1061,12 +1061,12 @@ number of format specifications in `msgid' and `msgstr' does not match"));
          for (cnt = 0; cnt < nidfmts; ++cnt)
            if (id_args[cnt] != str_args[cnt])
              {
-               error_with_progname = 0;
+               error_with_progname = false;
                error_at_line (0, 0, msgid_pos->file_name,
                               msgid_pos->line_number, _("\
 format specifications for argument %lu are not the same"),
                               (unsigned long) (cnt + 1));
-               error_with_progname = 1;
+               error_with_progname = true;
                exit_status = EXIT_FAILURE;
              }
        }
index 47b0eefece71b5725c156fda2167951f05c7cc01..0ed0eee2130004b6acd4b9fbfc628369c016ee43 100644 (file)
@@ -108,9 +108,9 @@ static void usage PARAMS ((int status));
 #ifdef EINTR
 static inline int nonintr_close PARAMS ((int fd));
 #endif
-static int is_string_selected PARAMS ((int grep_pass, const char *str,
-                                      size_t len));
-static int is_message_selected PARAMS ((const message_ty *mp));
+static bool is_string_selected PARAMS ((int grep_pass, const char *str,
+                                       size_t len));
+static bool is_message_selected PARAMS ((const message_ty *mp));
 static void process_message_list PARAMS ((const char *domain,
                                          message_list_ty *mlp));
 static msgdomain_list_ty *
@@ -123,14 +123,14 @@ main (argc, argv)
      char **argv;
 {
   int opt;
-  int do_help;
-  int do_version;
+  bool do_help;
+  bool do_version;
   char *output_file;
   const char *input_file;
   int grep_pass;
   msgdomain_list_ty *result;
-  int sort_by_filepos = 0;
-  int sort_by_msgid = 0;
+  bool sort_by_filepos = false;
+  bool sort_by_msgid = false;
   size_t i;
 
   /* Set program name for messages.  */
@@ -147,8 +147,8 @@ main (argc, argv)
   textdomain (PACKAGE);
 
   /* Set default values for variables.  */
-  do_help = 0;
-  do_version = 0;
+  do_help = false;
+  do_version = false;
   output_file = NULL;
   input_file = NULL;
   grep_pass = -1;
@@ -196,7 +196,7 @@ main (argc, argv)
        break;
 
       case 'h':
-       do_help = 1;
+       do_help = true;
        break;
 
       case 'i':
@@ -230,7 +230,7 @@ main (argc, argv)
        break;
 
       case 'V':
-       do_version = 1;
+       do_version = true;
        break;
 
       case 'w':
@@ -244,7 +244,7 @@ main (argc, argv)
        break;
 
       case CHAR_MAX + 1:
-       message_print_style_escape (1);
+       message_print_style_escape (true);
        break;
 
       case CHAR_MAX + 2:
@@ -252,15 +252,15 @@ main (argc, argv)
        break;
 
       case CHAR_MAX + 3:
-       message_print_style_escape (0);
+       message_print_style_escape (false);
        break;
 
       case CHAR_MAX + 4:
-       sort_by_filepos = 1;
+       sort_by_filepos = true;
        break;
 
       case CHAR_MAX + 5:
-       sort_by_msgid = 1;
+       sort_by_msgid = true;
        break;
 
       default:
@@ -340,7 +340,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
     msgdomain_list_sort_by_msgid (result);
 
   /* Write the merged message list out.  */
-  msgdomain_list_print (result, output_file, force_po, 0);
+  msgdomain_list_print (result, output_file, force_po, false);
 
   exit (EXIT_SUCCESS);
 }
@@ -480,9 +480,9 @@ nonintr_close (fd)
 #endif
 
 
-/* Process a string STR of size LEN bytes through grep, and return nonzero
+/* Process a string STR of size LEN bytes through grep, and return true
    if it matches.  */
-static int
+static bool
 is_string_selected (grep_pass, str, len)
      int grep_pass;
      const char *str;
@@ -515,8 +515,8 @@ is_string_selected (grep_pass, str, len)
 }
 
 
-/* Return nonzero if a message matches.  */
-static int
+/* Return true if a message matches.  */
+static bool
 is_message_selected (mp)
      const message_ty *mp;
 {
@@ -527,19 +527,19 @@ is_message_selected (mp)
 
   /* Always keep the header entry.  */
   if (mp->msgid[0] == '\0')
-    return 1;
+    return true;
 
   /* Test whether one of mp->filepos[] is selected.  */
   for (i = 0; i < mp->filepos_count; i++)
     if (string_list_member (location_files, mp->filepos[i].file_name))
-      return 1;
+      return true;
 
   /* Test msgid and msgid_plural using the --msgid arguments.  */
   if (is_string_selected (0, mp->msgid, strlen (mp->msgid)))
-    return 1;
+    return true;
   if (mp->msgid_plural != NULL
       && is_string_selected (0, mp->msgid_plural, strlen (mp->msgid_plural)))
-    return 1;
+    return true;
 
   /* Test msgstr using the --msgstr arguments.  */
   msgstr = mp->msgstr;
@@ -550,12 +550,12 @@ is_message_selected (mp)
       size_t length = strlen (p);
 
       if (is_string_selected (1, p, length))
-       return 1;
+       return true;
 
       p += length + 1;
     }
 
-  return 0;
+  return false;
 }
 
 
index ccc7c840eccbb2cc34ea5d1782792d584fc11339..f7db13cfe368b2f7be183d4b36667feefae89065 100644 (file)
@@ -43,20 +43,20 @@ compare_po_locale_charsets (mdlp)
 {
   const char *locale_code;
   const char *canon_locale_code;
-  int warned;
+  bool warned;
   size_t j, k;
 
   /* Check whether the locale encoding and the PO file's encoding are the
      same.  Otherwise emit a warning.  */
   locale_code = locale_charset ();
   canon_locale_code = po_charset_canonicalize (locale_code);
-  warned = 0;
+  warned = false;
   for (k = 0; k < mdlp->nitems; k++)
     {
       const message_list_ty *mlp = mdlp->item[k]->messages;
 
       for (j = 0; j < mlp->nitems; j++)
-       if (mlp->item[j]->msgid[0] == '\0' && mlp->item[j]->obsolete == 0)
+       if (mlp->item[j]->msgid[0] == '\0' && !mlp->item[j]->obsolete)
          {
            const char *header = mlp->item[j]->msgstr;
 
@@ -112,7 +112,7 @@ Possible workarounds are:\n\
   then apply '%s',\n\
   then convert back to %s using 'msgconv'.\n\
 "), "UTF-8", "UTF-8", basename (program_name), canon_charset));
-                       warned = 1;
+                       warned = true;
                      }
                  }
              }
index 4ac759e6ccd573acec2eb2d14293f0831fa27e29..1d1ec462fabf1c80f6b9ff2cb1b43059595c3071 100644 (file)
@@ -264,7 +264,7 @@ iconv_message_list (mlp, canon_to_code)
   /* Search the header entry, and extract and replace the charset name.  */
   canon_from_code = NULL;
   for (j = 0; j < mlp->nitems; j++)
-    if (mlp->item[j]->msgid[0] == '\0' && mlp->item[j]->obsolete == 0)
+    if (mlp->item[j]->msgid[0] == '\0' && !mlp->item[j]->obsolete)
       {
        const char *header = mlp->item[j]->msgstr;
 
index 58a1d94277e9341eb27ce8dc782f19e3ceead052..79d618d026e5c32197ccb083a38ffe00cee7adeb 100644 (file)
@@ -39,8 +39,8 @@
 #define _(str) gettext (str)
 
 
-/* If non-zero do not print unneeded messages.  */
-static int quiet;
+/* If true do not print unneeded messages.  */
+static bool quiet;
 
 /* Verbosity level.  */
 static int verbosity_level;
@@ -49,7 +49,7 @@ static int verbosity_level;
 static int force_po;
 
 /* Apply the .pot file to each of the domains in the PO file.  */
-static int multi_domain_mode;
+static bool multi_domain_mode = false;
 
 /* List of user-specified compendiums.  */
 static message_list_list_ty *compendiums;
@@ -107,18 +107,18 @@ main (argc, argv)
      char **argv;
 {
   int opt;
-  int do_help;
-  int do_version;
+  bool do_help;
+  bool do_version;
   char *output_file;
   msgdomain_list_ty *result;
-  int sort_by_filepos = 0;
-  int sort_by_msgid = 0;
+  bool sort_by_filepos = false;
+  bool sort_by_msgid = false;
 
   /* Set program name for messages.  */
   set_program_name (argv[0]);
   error_print_progname = maybe_print_progname;
   verbosity_level = 0;
-  quiet = 0;
+  quiet = false;
   gram_max_allowed_errors = UINT_MAX;
 
 #ifdef HAVE_SETLOCALE
@@ -131,8 +131,8 @@ main (argc, argv)
   textdomain (PACKAGE);
 
   /* Set default values for variables.  */
-  do_help = 0;
-  do_version = 0;
+  do_help = false;
+  do_version = false;
   output_file = NULL;
 
   while ((opt
@@ -152,19 +152,19 @@ main (argc, argv)
        break;
 
       case 'e':
-       message_print_style_escape (0);
+       message_print_style_escape (false);
        break;
 
       case 'E':
-       message_print_style_escape (1);
+       message_print_style_escape (true);
        break;
 
       case 'F':
-        sort_by_filepos = 1;
+        sort_by_filepos = true;
         break;
 
       case 'h':
-       do_help = 1;
+       do_help = true;
        break;
 
       case 'i':
@@ -172,7 +172,7 @@ main (argc, argv)
        break;
 
       case 'm':
-       multi_domain_mode = 1;
+       multi_domain_mode = true;
        break;
 
       case 'o':
@@ -180,11 +180,11 @@ main (argc, argv)
        break;
 
       case 'q':
-       quiet = 1;
+       quiet = true;
        break;
 
       case 's':
-        sort_by_msgid = 1;
+        sort_by_msgid = true;
         break;
 
       case 'S':
@@ -196,7 +196,7 @@ main (argc, argv)
        break;
 
       case 'V':
-       do_version = 1;
+       do_version = true;
        break;
 
       case 'w':
@@ -258,7 +258,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
     msgdomain_list_sort_by_msgid (result);
 
   /* Write the merged message list out.  */
-  msgdomain_list_print (result, output_file, force_po, 0);
+  msgdomain_list_print (result, output_file, force_po, false);
 
   exit (EXIT_SUCCESS);
 }
@@ -435,7 +435,7 @@ this message is used but not defined..."));
                 this merged entry to the output message list.  */
              mp = message_merge (defmsg, refmsg);
 
-             mp->is_fuzzy = 1;
+             mp->is_fuzzy = true;
 
              message_list_append (resultmlp, mp);
 
@@ -564,7 +564,7 @@ merge (fn1, fn2)
            {
              /* Remember the old translation although it is not used anymore.
                 But we mark it as obsolete.  */
-             defmsg->obsolete = 1;
+             defmsg->obsolete = true;
 
              message_list_append (msgdomain_list_sublist (result, domain, 1),
                                   defmsg);
index fd612f8bf82c7784ecac5a6eb9155c325fcba872..1d41c255fd965fbafe5ebe723df5bc39a4b495d6 100644 (file)
@@ -128,13 +128,13 @@ main (argc, argv)
      char **argv;
 {
   int opt;
-  int do_help;
-  int do_version;
+  bool do_help;
+  bool do_version;
   char *output_file;
   const char *input_file;
   msgdomain_list_ty *result;
-  int sort_by_filepos = 0;
-  int sort_by_msgid = 0;
+  bool sort_by_filepos = false;
+  bool sort_by_msgid = false;
   size_t i;
 
   /* Set program name for messages.  */
@@ -151,8 +151,8 @@ main (argc, argv)
   textdomain (PACKAGE);
 
   /* Set default values for variables.  */
-  do_help = 0;
-  do_version = 0;
+  do_help = false;
+  do_version = false;
   output_file = NULL;
   input_file = NULL;
   sed_args = string_list_alloc ();
@@ -175,7 +175,7 @@ main (argc, argv)
        break;
 
       case 'E':
-       message_print_style_escape (1);
+       message_print_style_escape (true);
        break;
 
       case 'f':
@@ -184,11 +184,11 @@ main (argc, argv)
        break;
 
       case 'F':
-       sort_by_filepos = 1;
+       sort_by_filepos = true;
        break;
 
       case 'h':
-       do_help = 1;
+       do_help = true;
        break;
 
       case 'i':
@@ -204,7 +204,7 @@ main (argc, argv)
        break;
 
       case 's':
-       sort_by_msgid = 1;
+       sort_by_msgid = true;
        break;
 
       case 'S':
@@ -212,7 +212,7 @@ main (argc, argv)
        break;
 
       case 'V':
-       do_version = 1;
+       do_version = true;
        break;
 
       case 'w':
@@ -226,7 +226,7 @@ main (argc, argv)
        break;
 
       case CHAR_MAX + 1:
-       message_print_style_escape (0);
+       message_print_style_escape (false);
        break;
 
       default:
@@ -298,7 +298,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
     msgdomain_list_sort_by_msgid (result);
 
   /* Write the merged message list out.  */
-  msgdomain_list_print (result, output_file, force_po, 0);
+  msgdomain_list_print (result, output_file, force_po, false);
 
   exit (EXIT_SUCCESS);
 }
index cd52c85aa5921ec423e748e7a7b0f23e23d3d95d..25de802bbb346257b2d102c9db9a116b502121c3 100644 (file)
@@ -91,12 +91,12 @@ main (argc, argv)
      char **argv;
 {
   int optchar;
-  int do_help = 0;
-  int do_version = 0;
+  bool do_help = false;
+  bool do_version = false;
   const char *output_file = "-";
   message_list_ty *mlp;
   msgdomain_list_ty *result;
-  int sort_by_msgid = 0;
+  bool sort_by_msgid = false;
 
   /* Set program name for messages.  */
   set_program_name (argv[0]);
@@ -120,15 +120,15 @@ main (argc, argv)
        break;
 
       case 'e':
-       message_print_style_escape (0);
+       message_print_style_escape (false);
        break;
 
       case 'E':
-       message_print_style_escape (1);
+       message_print_style_escape (true);
        break;
 
       case 'h':
-       do_help = 1;
+       do_help = true;
        break;
 
       case 'i':
@@ -140,7 +140,7 @@ main (argc, argv)
        break;
 
       case 's':
-       sort_by_msgid = 1;
+       sort_by_msgid = true;
        break;
 
       case 'S':
@@ -148,7 +148,7 @@ main (argc, argv)
        break;
 
       case 'V':
-       do_version = 1;
+       do_version = true;
        break;
 
       case 'w':
@@ -203,7 +203,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
     msgdomain_list_sort_by_msgid (result);
 
   /* Write the resulting message list to the given .po file.  */
-  msgdomain_list_print (result, output_file, force_po, 0);
+  msgdomain_list_print (result, output_file, force_po, false);
 
   /* No problems.  */
   exit (EXIT_SUCCESS);
index 66613ec2f08a7e2f939afcff4100d6b255f15c9a..d9ba0876ad592e8d1f0b040acdb73bdfb871ba7d 100644 (file)
@@ -89,11 +89,11 @@ static long plural_counter;
 #line 103 "po-gram-gen.y"
 typedef union
 {
-  struct { char *string; lex_pos_ty pos; int obsolete; } string;
-  struct { string_list_ty stringlist; lex_pos_ty pos; int obsolete; } stringlist;
-  struct { long number; lex_pos_ty pos; int obsolete; } number;
-  struct { lex_pos_ty pos; int obsolete; } pos;
-  struct { struct msgstr_def rhs; lex_pos_ty pos; int obsolete; } rhs;
+  struct { char *string; lex_pos_ty pos; bool obsolete; } string;
+  struct { string_list_ty stringlist; lex_pos_ty pos; bool obsolete; } stringlist;
+  struct { long number; lex_pos_ty pos; bool obsolete; } number;
+  struct { lex_pos_ty pos; bool obsolete; } pos;
+  struct { struct msgstr_def rhs; lex_pos_ty pos; bool obsolete; } rhs;
 } YYSTYPE;
 #include <stdio.h>
 
index 13c74814ce340009468583b4d2d8f7afbb09be74..dd0c6c9c67c30c2aa354cde33d05594c4c39e0ea 100644 (file)
@@ -1,10 +1,10 @@
 typedef union
 {
-  struct { char *string; lex_pos_ty pos; int obsolete; } string;
-  struct { string_list_ty stringlist; lex_pos_ty pos; int obsolete; } stringlist;
-  struct { long number; lex_pos_ty pos; int obsolete; } number;
-  struct { lex_pos_ty pos; int obsolete; } pos;
-  struct { struct msgstr_def rhs; lex_pos_ty pos; int obsolete; } rhs;
+  struct { char *string; lex_pos_ty pos; bool obsolete; } string;
+  struct { string_list_ty stringlist; lex_pos_ty pos; bool obsolete; } stringlist;
+  struct { long number; lex_pos_ty pos; bool obsolete; } number;
+  struct { lex_pos_ty pos; bool obsolete; } pos;
+  struct { struct msgstr_def rhs; lex_pos_ty pos; bool obsolete; } rhs;
 } YYSTYPE;
 #define        COMMENT 257
 #define        DOMAIN  258
index b539b56b6006be19a561ab7f61a2aa6f72075cd2..510cd37a354829b0cd42a40125aa507116c0ad12 100644 (file)
@@ -102,11 +102,11 @@ static long plural_counter;
 
 %union
 {
-  struct { char *string; lex_pos_ty pos; int obsolete; } string;
-  struct { string_list_ty stringlist; lex_pos_ty pos; int obsolete; } stringlist;
-  struct { long number; lex_pos_ty pos; int obsolete; } number;
-  struct { lex_pos_ty pos; int obsolete; } pos;
-  struct { struct msgstr_def rhs; lex_pos_ty pos; int obsolete; } rhs;
+  struct { char *string; lex_pos_ty pos; bool obsolete; } string;
+  struct { string_list_ty stringlist; lex_pos_ty pos; bool obsolete; } stringlist;
+  struct { long number; lex_pos_ty pos; bool obsolete; } number;
+  struct { lex_pos_ty pos; bool obsolete; } pos;
+  struct { struct msgstr_def rhs; lex_pos_ty pos; bool obsolete; } rhs;
 }
 
 %type <string> STRING COMMENT NAME msgid_pluralform
index f94e81b74cd809106b119d4fee60edf3ee290958..25060ecb5e268b66fe14ede594cc0402ba0fab72 100644 (file)
@@ -61,9 +61,9 @@
 static FILE *fp;
 lex_pos_ty gram_pos;
 unsigned int gram_max_allowed_errors = 20;
-static int po_lex_obsolete;
-static int pass_comments = 0;
-int pass_obsolete_entries = 0;
+static bool po_lex_obsolete;
+static bool pass_comments = false;
+bool pass_obsolete_entries = false;
 
 
 /* Prototypes for local functions.  Needed to ensure compiler checking of
@@ -85,7 +85,7 @@ lex_open (fname)
           _("error while opening \"%s\" for reading"), fname);
 
   gram_pos.line_number = 1;
-  po_lex_obsolete = 0;
+  po_lex_obsolete = false;
   po_lex_charset_init ();
 }
 
@@ -103,10 +103,10 @@ lex_close ()
   if (fp != stdin)
     fclose (fp);
   fp = NULL;
-  gram_pos.file_name = 0;
+  gram_pos.file_name = NULL;
   gram_pos.line_number = 0;
   error_message_count = 0;
-  po_lex_obsolete = 0;
+  po_lex_obsolete = false;
   po_lex_charset_close ();
 }
 
@@ -133,14 +133,14 @@ po_gram_error (fmt, va_alist)
 
   vasprintf (&buffer, fmt, ap);
   va_end (ap);
-  error_with_progname = 0;
+  error_with_progname = false;
   error_at_line (0, 0, gram_pos.file_name, gram_pos.line_number, "%s", buffer);
-  error_with_progname = 1;
+  error_with_progname = true;
 # else
-  error_with_progname = 0;
+  error_with_progname = false;
   error_at_line (0, 0, gram_pos.file_name, gram_pos.line_number, fmt,
                 a1, a2, a3, a4, a5, a6, a7, a8);
-  error_with_progname = 1;
+  error_with_progname = true;
 # endif
 
   /* Some messages need more than one line.  Continuation lines are
@@ -175,14 +175,14 @@ po_gram_error_at_line (pp, fmt, va_alist)
 
   vasprintf (&buffer, fmt, ap);
   va_end (ap);
-  error_with_progname = 0;
+  error_with_progname = false;
   error_at_line (0, 0, pp->file_name, pp->line_number, "%s", buffer);
-  error_with_progname = 1;
+  error_with_progname = true;
 # else
-  error_with_progname = 0;
+  error_with_progname = false;
   error_at_line (0, 0, pp->file_name, pp->line_number, fmt,
                 a1, a2, a3, a4, a5, a6, a7, a8);
-  error_with_progname = 1;
+  error_with_progname = true;
 # endif
 
   /* Some messages need more than one line, or more than one location.
@@ -396,7 +396,7 @@ po_gram_lex ()
          return 0;
 
        case '\n':
-         po_lex_obsolete = 0;
+         po_lex_obsolete = false;
          break;
 
        case ' ':
@@ -414,7 +414,7 @@ po_gram_lex ()
               We simply discard the "#~" prefix.  The following
               characters are expected to be well formed.  */
            {
-             po_lex_obsolete = 1;
+             po_lex_obsolete = true;
              break;
            }
 
@@ -442,7 +442,7 @@ po_gram_lex ()
              po_gram_lval.string.string = buf;
              po_gram_lval.string.pos = gram_pos;
              po_gram_lval.string.obsolete = po_lex_obsolete;
-             po_lex_obsolete = 0;
+             po_lex_obsolete = false;
              return COMMENT;
            }
          else
@@ -452,7 +452,7 @@ po_gram_lex ()
                 is not very effective.  */
              while (c != EOF && c != '\n')
                c = lex_getc ();
-             po_lex_obsolete = 0;
+             po_lex_obsolete = false;
            }
          break;
 
@@ -658,9 +658,9 @@ po_gram_lex ()
 /* po_gram_lex() can return comments as COMMENT.  Switch this on or off.  */
 void
 po_lex_pass_comments (flag)
-     int flag;
+     bool flag;
 {
-  pass_comments = (flag != 0);
+  pass_comments = flag;
 }
 
 
@@ -668,7 +668,7 @@ po_lex_pass_comments (flag)
    Switch this on or off.  */
 void
 po_lex_pass_obsolete_entries (flag)
-     int flag;
+     bool flag;
 {
-  pass_obsolete_entries = (flag != 0);
+  pass_obsolete_entries = flag;
 }
index 03332ce17ebc4881a8cc3d160a1da79228d09905..bd1eb48de44b96adad554d180871d5afeb88c8c6 100644 (file)
@@ -21,6 +21,7 @@
 #define _PO_LEX_H
 
 #include <sys/types.h>
+#include <stdbool.h>
 #include "error.h"
 #include "progname.h"
 #include "pos.h"
@@ -37,8 +38,8 @@ extern lex_pos_ty gram_pos;
    terminate.  Cf. error_message_count, declared in <error.h>.  */
 extern unsigned int gram_max_allowed_errors;
 
-/* Nonzero if obsolete entries shall be considered as valid.  */
-extern int pass_obsolete_entries;
+/* True if obsolete entries shall be considered as valid.  */
+extern bool pass_obsolete_entries;
 
 
 /* Open the PO file FNAME and prepare its lexical analysis.  */
@@ -52,11 +53,11 @@ extern void lex_close PARAMS ((void));
 extern int po_gram_lex PARAMS ((void));
 
 /* po_gram_lex() can return comments as COMMENT.  Switch this on or off.  */
-extern void po_lex_pass_comments PARAMS ((int flag));
+extern void po_lex_pass_comments PARAMS ((bool flag));
 
 /* po_gram_lex() can return obsolete entries as if they were normal entries.
    Switch this on or off.  */
-extern void po_lex_pass_obsolete_entries PARAMS ((int flag));
+extern void po_lex_pass_obsolete_entries PARAMS ((bool flag));
 
 
 /* ISO C 99 is smart enough to allow optimizations like this.  */
@@ -67,10 +68,10 @@ extern void po_lex_pass_obsolete_entries PARAMS ((int flag));
 
 # define po_gram_error(fmt, ...)                                           \
   do {                                                                     \
-    error_with_progname = 0;                                               \
+    error_with_progname = false;                                           \
     error_at_line (0, 0, gram_pos.file_name, gram_pos.line_number,         \
                    fmt, __VA_ARGS__);                                      \
-    error_with_progname = 1;                                               \
+    error_with_progname = true;                                                    \
     if (*fmt == '.')                                                       \
       --error_message_count;                                               \
     else if (error_message_count >= gram_max_allowed_errors)               \
@@ -83,10 +84,10 @@ extern void po_lex_pass_obsolete_entries PARAMS ((int flag));
 
 # define po_gram_error_at_line(pos, fmt, ...)                              \
   do {                                                                     \
-    error_with_progname = 0;                                               \
+    error_with_progname = false;                                           \
     error_at_line (0, 0, (pos)->file_name, (pos)->line_number,             \
                    fmt, __VA_ARGS__);                                      \
-    error_with_progname = 1;                                               \
+    error_with_progname = true;                                                    \
     if (*fmt == '.')                                                       \
       --error_message_count;                                               \
     else if (error_message_count >= gram_max_allowed_errors)               \
@@ -101,10 +102,10 @@ extern void po_lex_pass_obsolete_entries PARAMS ((int flag));
 
 # define po_gram_error(fmt, args...)                                       \
   do {                                                                     \
-    error_with_progname = 0;                                               \
+    error_with_progname = false;                                           \
     error_at_line (0, 0, gram_pos.file_name, gram_pos.line_number,         \
                    fmt, ## args);                                          \
-    error_with_progname = 1;                                               \
+    error_with_progname = true;                                                    \
     if (*fmt == '.')                                                       \
       --error_message_count;                                               \
     else if (error_message_count >= gram_max_allowed_errors)               \
@@ -117,10 +118,10 @@ extern void po_lex_pass_obsolete_entries PARAMS ((int flag));
 
 # define po_gram_error_at_line(pos, fmt, args...)                          \
   do {                                                                     \
-    error_with_progname = 0;                                               \
+    error_with_progname = false;                                           \
     error_at_line (0, 0, (pos)->file_name, (pos)->line_number,             \
                    fmt, ## args);                                          \
-    error_with_progname = 1;                                               \
+    error_with_progname = true;                                                    \
     if (*fmt == '.')                                                       \
       --error_message_count;                                               \
     else if (error_message_count >= gram_max_allowed_errors)               \
index 0fac315004cbd2b3d12d2fb8524872b9b8ae22b5..90ac988a09e6bf5ef1df6b6a4861c3446dee6a6a 100644 (file)
--- a/src/po.c
+++ b/src/po.c
@@ -41,7 +41,7 @@ static void po_directive_message PARAMS ((po_ty *pop, char *msgid,
                                          char *msgid_plural,
                                          char *msgstr, size_t msgstr_len,
                                          lex_pos_ty *msgstr_pos,
-                                         int obsolete));
+                                         bool obsolete));
 static void po_comment PARAMS ((po_ty *pop, const char *s));
 static void po_comment_dot PARAMS ((po_ty *pop, const char *s));
 static void po_comment_filepos PARAMS ((po_ty *pop, const char *name,
@@ -146,7 +146,7 @@ po_directive_message (pop, msgid, msgid_pos, msgid_plural,
      char *msgstr;
      size_t msgstr_len;
      lex_pos_ty *msgstr_pos;
-     int obsolete;
+     bool obsolete;
 {
   if (pop->method->directive_message)
     pop->method->directive_message (pop, msgid, msgid_pos, msgid_plural,
@@ -164,7 +164,7 @@ po_callback_message (msgid, msgid_pos, msgid_plural,
      char *msgstr;
      size_t msgstr_len;
      lex_pos_ty *msgstr_pos;
-     int obsolete;
+     bool obsolete;
 {
   /* assert(callback_arg); */
 
index aaa77d345300239a01e42ee38a3e91d9548cf3c7..d3b712ac4127c8e0f066c5ec05a2b011cfb04e32 100644 (file)
--- a/src/po.h
+++ b/src/po.h
@@ -60,7 +60,7 @@ struct po_method_ty
                                     char *msgid_plural,
                                     char *msgstr, size_t msgstr_len,
                                     lex_pos_ty *msgstr_pos,
-                                    int obsolete));
+                                    bool obsolete));
 
   /* This method is invoked before the parse, but after the file is
      opened by the lexer.  */
@@ -135,7 +135,7 @@ extern void po_callback_message PARAMS ((char *msgid, lex_pos_ty *msgid_pos,
                                         char *msgid_plural,
                                         char *msgstr, size_t msgstr_len,
                                         lex_pos_ty *msgstr_pos,
-                                        int obsolete));
+                                        bool obsolete));
 extern void po_callback_comment PARAMS ((const char *s));
 extern void po_callback_comment_dot PARAMS ((const char *s));
 extern void po_callback_comment_filepos PARAMS ((const char *s, int line));
index 4ccd08393e22d027b3fe562542f7dd3bcb8d2fff..505d47ab9c7801a8db6599e05a9049c01cdb285c 100644 (file)
@@ -58,7 +58,7 @@ struct readall_class_ty
   string_list_ty *comment_dot;
 
   /* Flags transported in special comments.  */
-  int is_fuzzy;
+  bool is_fuzzy;
   enum is_c_format is_c_format;
   enum is_wrap do_wrap;
 
@@ -78,7 +78,7 @@ static void readall_directive_message PARAMS ((po_ty *that, char *msgid,
                                               char *msgid_plural,
                                               char *msgstr, size_t msgstr_len,
                                               lex_pos_ty *msgstr_pos,
-                                              int obsolete));
+                                              bool obsolete));
 static void readall_parse_brief PARAMS ((po_ty *that));
 static void readall_comment PARAMS ((po_ty *that, const char *s));
 static void readall_comment_dot PARAMS ((po_ty *that, const char *s));
@@ -100,7 +100,7 @@ readall_constructor (that)
   this->comment_dot = NULL;
   this->filepos_count = 0;
   this->filepos = NULL;
-  this->is_fuzzy = 0;
+  this->is_fuzzy = false;
   this->is_c_format = undecided;
   this->do_wrap = undecided;
 }
@@ -168,7 +168,7 @@ readall_directive_message (that, msgid, msgid_pos, msgid_plural,
      char *msgstr;
      size_t msgstr_len;
      lex_pos_ty *msgstr_pos;
-     int obsolete;
+     bool obsolete;
 {
   readall_class_ty *this = (readall_class_ty *) that;
   message_ty *mp;
@@ -226,7 +226,7 @@ readall_directive_message (that, msgid, msgid_pos, msgid_plural,
     free (this->filepos);
   this->filepos_count = 0;
   this->filepos = NULL;
-  this->is_fuzzy = 0;
+  this->is_fuzzy = false;
   this->is_c_format = undecided;
   this->do_wrap = undecided;
 }
@@ -236,7 +236,7 @@ static void
 readall_parse_brief (that)
      po_ty *that;
 {
-  po_lex_pass_comments (1);
+  po_lex_pass_comments (true);
 }
 
 
@@ -274,7 +274,7 @@ readall_comment_special (that, s)
   readall_class_ty *this = (readall_class_ty *) that;
 
   if (strstr (s, "fuzzy") != NULL)
-    this->is_fuzzy = 1;
+    this->is_fuzzy = true;
 
   this->is_c_format = parse_c_format_description_string (s);
   this->do_wrap = parse_c_width_description_string (s);
@@ -331,7 +331,7 @@ read_po_file (filename)
   msgdomain_list_ty *mdlp;
 
   pop = po_alloc (&readall_methods);
-  po_lex_pass_obsolete_entries (1);
+  po_lex_pass_obsolete_entries (true);
   po_scan (pop, filename);
   mdlp = ((readall_class_ty *) pop)->mdlp;
   po_free (pop);
index a8ab49d5480ed951ba81a4251763bec6740404d3..a961ef3f18aa6bda790829510c0e20ecbfe578a8 100644 (file)
@@ -215,7 +215,7 @@ string_list_join (slp)
 
 
 /* Return 1 if s is contained in the list of strings, 0 otherwise.  */
-int
+bool
 string_list_member (slp, s)
      const string_list_ty *slp;
      const char *s;
@@ -224,6 +224,6 @@ string_list_member (slp, s)
 
   for (j = 0; j < slp->nitems; ++j)
     if (strcmp (slp->item[j], s) == 0)
-      return 1;
-  return 0;
+      return true;
+  return false;
 }
index e31a62429c25ac92ba2d4693df2ef0bc4dae1d06..03b31d24d085b5041d98ec4c23842cf1de59d49a 100644 (file)
@@ -23,6 +23,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /* Get size_t and NULL.  */
 #include <stddef.h>
 
+/* Get bool.  */
+#include <stdbool.h>
+
 /* Type describing list of immutable strings,
    implemented using a dynamic array.  */
 typedef struct string_list_ty string_list_ty;
@@ -66,7 +69,7 @@ extern char *string_list_concat_destroy PARAMS ((string_list_ty *slp));
 extern char *string_list_join PARAMS ((const string_list_ty *slp));
 
 /* Return 1 if s is contained in the list of strings, 0 otherwise.  */
-extern int string_list_member PARAMS ((const string_list_ty *slp,
-                                      const char *s));
+extern bool string_list_member PARAMS ((const string_list_ty *slp,
+                                       const char *s));
 
 #endif /* _STR_LIST_H */
index 89f10fdc1fd6d202e44a3c9fd58bbe2a6c197bc5..0f9af6c32fb6b69c796c6ee244e687bb8043a6ac 100644 (file)
@@ -49,7 +49,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /* Prototypes for local functions.  Needed to ensure compiler checking of
    function argument counts despite of K&R C function definition syntax.  */
 static const char *make_c_format_description_string PARAMS ((enum is_c_format,
-                                                            int debug));
+                                                            bool debug));
 static int significant_c_format_p PARAMS ((enum is_c_format is_c_format));
 static const char *make_c_width_description_string PARAMS ((enum is_c_format));
 static void wrap PARAMS ((FILE *fp, const char *line_prefix, const char *name,
@@ -57,11 +57,11 @@ static void wrap PARAMS ((FILE *fp, const char *line_prefix, const char *name,
                          const char *charset));
 static void print_blank_line PARAMS ((FILE *fp));
 static void message_print PARAMS ((const message_ty *mp, FILE *fp,
-                                  const char *charset, int blank_line,
-                                  int debug));
+                                  const char *charset, bool blank_line,
+                                  bool debug));
 static void message_print_obsolete PARAMS ((const message_ty *mp, FILE *fp,
                                            const char *charset,
-                                           int blank_line));
+                                           bool blank_line));
 static int msgid_cmp PARAMS ((const void *va, const void *vb));
 static int filepos_cmp PARAMS ((const void *va, const void *vb));
 
@@ -90,27 +90,27 @@ message_page_width_set (n)
 
 /* These three variables control the output style of the message_print
    function.  Interface functions for them are to be used.  */
-static int indent;
-static int uniforum;
-static int escape;
+static bool indent = false;
+static bool uniforum = false;
+static bool escape = false;
 
 void
 message_print_style_indent ()
 {
-  indent = 1;
+  indent = true;
 }
 
 void
 message_print_style_uniforum ()
 {
-  uniforum = 1;
+  uniforum = true;
 }
 
 void
 message_print_style_escape (flag)
-     int flag;
+     bool flag;
 {
-  escape = (flag != 0);
+  escape = flag;
 }
 
 
@@ -120,7 +120,7 @@ message_print_style_escape (flag)
 static const char *
 make_c_format_description_string (is_c_format, debug)
      enum is_c_format is_c_format;
-     int debug;
+     bool debug;
 {
   const char *result = NULL;
 
@@ -193,7 +193,7 @@ wrap (fp, line_prefix, name, value, do_wrap, charset)
      const char *charset;
 {
   const char *s;
-  int first_line;
+  bool first_line;
 #if HAVE_ICONV
   const char *envval;
   iconv_t conv;
@@ -223,7 +223,7 @@ wrap (fp, line_prefix, name, value, do_wrap, charset)
 
   /* Loop over the '\n' delimited portions of value.  */
   s = value;
-  first_line = 1;
+  first_line = true;
   do
     {
       /* The \a and \v escapes were added by the ANSI C Standard.
@@ -449,7 +449,7 @@ internationalized messages should not contain the `\\%c' escape sequence"),
            fputs (line_prefix, fp);
          fputs (name, fp);
          fputs (" \"\"\n", fp);
-         first_line = 0;
+         first_line = false;
          /* Recompute startcol and linebreaks.  */
          goto recompute;
        }
@@ -463,7 +463,7 @@ internationalized messages should not contain the `\\%c' escape sequence"),
        {
          fputs (name, fp);
          putc (indent ? '\t' : ' ', fp);
-         first_line = 0;
+         first_line = false;
        }
       else
        {
@@ -520,8 +520,8 @@ message_print (mp, fp, charset, blank_line, debug)
      const message_ty *mp;
      FILE *fp;
      const char *charset;
-     int blank_line;
-     int debug;
+     bool blank_line;
+     bool debug;
 {
   size_t j;
 
@@ -625,7 +625,7 @@ message_print (mp, fp, charset, blank_line, debug)
       || significant_c_format_p (mp->is_c_format)
       || mp->do_wrap == no)
     {
-      int first_flag = 1;
+      bool first_flag = true;
 
       putc ('#', fp);
       putc (',', fp);
@@ -636,7 +636,7 @@ message_print (mp, fp, charset, blank_line, debug)
       if (mp->is_fuzzy && mp->msgstr[0] != '\0')
        {
          fputs (" fuzzy", fp);
-         first_flag = 0;
+         first_flag = false;
        }
 
       if (significant_c_format_p (mp->is_c_format))
@@ -646,7 +646,7 @@ message_print (mp, fp, charset, blank_line, debug)
 
          fputs (make_c_format_description_string (mp->is_c_format, debug),
                 fp);
-         first_flag = 0;
+         first_flag = false;
        }
 
       if (mp->do_wrap == no)
@@ -655,7 +655,7 @@ message_print (mp, fp, charset, blank_line, debug)
            putc (',', fp);
 
          fputs (make_c_width_description_string (mp->do_wrap), fp);
-         first_flag = 0;
+         first_flag = false;
        }
 
       putc ('\n', fp);
@@ -692,7 +692,7 @@ message_print_obsolete (mp, fp, charset, blank_line)
      const message_ty *mp;
      FILE *fp;
      const char *charset;
-     int blank_line;
+     bool blank_line;
 {
   size_t j;
 
@@ -735,7 +735,7 @@ message_print_obsolete (mp, fp, charset, blank_line)
   /* Print flag information in special comment.  */
   if (mp->is_fuzzy)
     {
-      int first = 1;
+      bool first = true;
 
       putc ('#', fp);
       putc (',', fp);
@@ -743,7 +743,7 @@ message_print_obsolete (mp, fp, charset, blank_line)
       if (mp->is_fuzzy)
        {
          fputs (" fuzzy", fp);
-         first = 0;
+         first = false;
        }
 
       putc ('\n', fp);
@@ -778,18 +778,18 @@ void
 msgdomain_list_print (mdlp, filename, force, debug)
      msgdomain_list_ty *mdlp;
      const char *filename;
-     int force;
-     int debug;
+     bool force;
+     bool debug;
 {
   FILE *fp;
   size_t j, k;
-  int blank_line;
+  bool blank_line;
 
   /* We will not write anything if, for every domain, we have no message
      or only the header entry.  */
   if (!force)
     {
-      int found_nonempty = 0;
+      bool found_nonempty = false;
 
       for (k = 0; k < mdlp->nitems; k++)
        {
@@ -798,7 +798,7 @@ msgdomain_list_print (mdlp, filename, force, debug)
          if (!(mlp->nitems == 0
                || (mlp->nitems == 1 && mlp->item[0]->msgid[0] == '\0')))
            {
-             found_nonempty = 1;
+             found_nonempty = true;
              break;
            }
        }
@@ -824,7 +824,7 @@ msgdomain_list_print (mdlp, filename, force, debug)
     }
 
   /* Write out the messages for each domain.  */
-  blank_line = 0;
+  blank_line = false;
   for (k = 0; k < mdlp->nitems; k++)
     {
       message_list_ty *mlp;
@@ -839,7 +839,7 @@ msgdomain_list_print (mdlp, filename, force, debug)
          if (blank_line)
            print_blank_line (fp);
          fprintf (fp, "domain \"%s\"\n", mdlp->item[k]->domain);
-         blank_line = 1;
+         blank_line = true;
        }
 
       mlp = mdlp->item[k]->messages;
@@ -847,7 +847,7 @@ msgdomain_list_print (mdlp, filename, force, debug)
       /* Search the header entry.  */
       header = NULL;
       for (j = 0; j < mlp->nitems; ++j)
-       if (mlp->item[j]->msgid[0] == '\0' && mlp->item[j]->obsolete == 0)
+       if (mlp->item[j]->msgid[0] == '\0' && !mlp->item[j]->obsolete)
          {
            header = mlp->item[j]->msgstr;
            break;
@@ -873,18 +873,18 @@ msgdomain_list_print (mdlp, filename, force, debug)
 
       /* Write out each of the messages for this domain.  */
       for (j = 0; j < mlp->nitems; ++j)
-       if (mlp->item[j]->obsolete == 0)
+       if (!mlp->item[j]->obsolete)
          {
            message_print (mlp->item[j], fp, charset, blank_line, debug);
-           blank_line = 1;
+           blank_line = true;
          }
 
       /* Write out each of the obsolete messages for this domain.  */
       for (j = 0; j < mlp->nitems; ++j)
-       if (mlp->item[j]->obsolete != 0)
+       if (mlp->item[j]->obsolete)
          {
            message_print_obsolete (mlp->item[j], fp, charset, blank_line);
-           blank_line = 1;
+           blank_line = true;
          }
     }
 
index 1523c44100036438a7e890197c99ab24b446b2db..55ef969eb98ed1bbfba1ffca6bd86f566bc5b018 100644 (file)
@@ -30,12 +30,12 @@ extern void
 extern void
        message_print_style_uniforum PARAMS ((void));
 extern void
-       message_print_style_escape PARAMS ((int flag));
+       message_print_style_escape PARAMS ((bool flag));
 
 extern void
        msgdomain_list_print PARAMS ((msgdomain_list_ty *mdlp,
                                     const char *filename,
-                                    int force, int debug));
+                                    bool force, bool debug));
 extern void
        msgdomain_list_sort_by_msgid PARAMS ((msgdomain_list_ty *mdlp));
 extern void
index c69e23027351ac8ce8b1c8a853be54ab6d11fc65..516b9f48d165a28f4c0491dd9bb57c347a1347fb 100644 (file)
@@ -106,10 +106,10 @@ static const char *file_name;
 static char *logical_file_name;
 static int line_number;
 static FILE *fp;
-static int trigraphs;
+static bool trigraphs = false;
 static string_list_ty *comment;
 static hash_table keywords;
-static int default_keywords = 1;
+static bool default_keywords = true;
 
 /* These are for tracking whether comments count as immediately before
    keyword.  */
@@ -697,7 +697,7 @@ phase5_get (tp)
       *tp = phase5_pushback[--phase5_pushback_length];
       return;
     }
-  tp->string = 0;
+  tp->string = NULL;
   tp->number = 0;
   tp->line_number = line_number;
   c = phase4_getc ();
@@ -875,10 +875,10 @@ phase5_get (tp)
          c = phase7_getc ();
          if (c == P7_NEWLINE)
            {
-             error_with_progname = 0;
+             error_with_progname = false;
              error (0, 0, _("%s:%d: warning: unterminated character constant"),
                logical_file_name, line_number - 1);
-             error_with_progname = 1;
+             error_with_progname = true;
              phase7_ungetc ('\n');
              break;
            }
@@ -899,10 +899,10 @@ phase5_get (tp)
          c = phase7_getc ();
          if (c == P7_NEWLINE)
            {
-             error_with_progname = 0;
+             error_with_progname = false;
              error (0, 0, _("%s:%d: warning: unterminated string literal"),
                logical_file_name, line_number - 1);
-             error_with_progname = 1;
+             error_with_progname = true;
              phase7_ungetc ('\n');
              break;
            }
@@ -970,12 +970,12 @@ static void
 phaseX_get (tp)
      token_ty *tp;
 {
-  static int middle;   /* 0 at the beginning of a line, 1 otherwise.  */
+  static bool middle;  /* false at the beginning of a line, true otherwise.  */
 
   phase5_get (tp);
 
   if (tp->type == token_type_eoln || tp->type == token_type_eof)
-    middle = 0;
+    middle = false;
   else
     {
       if (middle)
@@ -999,7 +999,7 @@ phaseX_get (tp)
              else
                phase5_unget (&next);
            }
-         middle = 1;
+         middle = true;
        }
     }
 }
@@ -1202,7 +1202,7 @@ xgettext_lex (tp)
              xgettext_lex_keyword ("dngettext:2,3");
              xgettext_lex_keyword ("dcngettext:2,3");
              xgettext_lex_keyword ("gettext_noop");
-             default_keywords = 0;
+             default_keywords = false;
            }
 
          if (find_entry (&keywords, token.string, strlen (token.string) + 1,
@@ -1262,7 +1262,7 @@ xgettext_lex_keyword (name)
      const char *name;
 {
   if (name == NULL)
-    default_keywords = 0;
+    default_keywords = false;
   else
     {
       int argnum1;
@@ -1310,7 +1310,7 @@ xgettext_lex_keyword (name)
 }
 
 
-int
+bool
 xgettext_any_keywords ()
 {
   return (keywords.filled > 0) || default_keywords;
@@ -1341,5 +1341,5 @@ xgettext_lex_comment_reset ()
 void
 xgettext_lex_trigraphs ()
 {
-  trigraphs = 1;
+  trigraphs = true;
 }
index 1fe4edd8cc6786b0b674d7e19442e856c12450c9..f0e39ec781971b8a3933c4445d8acd9edc0f6353 100644 (file)
@@ -59,7 +59,7 @@ const char *xgettext_lex_comment PARAMS ((size_t n));
 void xgettext_lex_comment_reset PARAMS ((void));
 /* void xgettext_lex_filepos PARAMS ((char **, int *)); FIXME needed?  */
 void xgettext_lex_keyword PARAMS ((const char *name));
-int xgettext_any_keywords PARAMS ((void));
+bool xgettext_any_keywords PARAMS ((void));
 void xgettext_lex_trigraphs PARAMS ((void));
 
 #endif /* _XGET_LEX_H */
index 89619f855224c0deecf1e55d8d49a28d995c647b..712570aa17142778b20b6d6618a920a3b3f40c92 100644 (file)
@@ -63,7 +63,7 @@ struct passwd *getpwuid ();
 
 
 /* If nonzero add all comments immediately preceding one of the keywords. */
-static int add_all_comments;
+static bool add_all_comments = false;
 
 /* If nonzero add comments for file name and line number for each msgid.  */
 static int line_comment;
@@ -81,8 +81,8 @@ static int do_debug;
 /* Content of .po files with symbols to be excluded.  */
 static message_list_ty *exclude;
 
-/* If nonzero extract all strings.  */
-static int extract_all;
+/* If true extract all strings.  */
+static bool extract_all = false;
 
 /* Force output of PO file even if empty.  */
 static int force_po;
@@ -114,7 +114,7 @@ static const struct option long_options[] =
   { "directory", required_argument, NULL, 'D' },
   { "escape", no_argument, NULL, 'E' },
   { "exclude-file", required_argument, NULL, 'x' },
-  { "extract-all", no_argument, &extract_all, 1 },
+  { "extract-all", no_argument, NULL, 'a' },
   { "files-from", required_argument, NULL, 'f' },
   { "force-po", no_argument, &force_po, 1 },
   { "foreign-user", no_argument, &foreign_user, 1 },
@@ -155,7 +155,7 @@ static void exclude_directive_message PARAMS ((po_ty *pop, char *msgid,
                                               char *msgid_plural,
                                               char *msgstr, size_t msgstr_len,
                                               lex_pos_ty *msgstr_pos,
-                                              int obsolete));
+                                              bool obsolete));
 static void read_exclusion_file PARAMS ((char *file_name));
 static message_ty *remember_a_message PARAMS ((message_list_ty *mlp,
                                               xgettext_token_ty *tp));
@@ -170,7 +170,7 @@ static void extract_directive_message PARAMS ((po_ty *that, char *msgid,
                                               char *msgid_plural,
                                               char *msgstr, size_t msgstr_len,
                                               lex_pos_ty *msgstr_pos,
-                                              int obsolete));
+                                              bool obsolete));
 static void extract_parse_brief PARAMS ((po_ty *that));
 static void extract_comment PARAMS ((po_ty *that, const char *s));
 static void extract_comment_dot PARAMS ((po_ty *that, const char *s));
@@ -199,12 +199,12 @@ main (argc, argv)
 {
   int cnt;
   int optchar;
-  int do_help = 0;
-  int do_version = 0;
+  bool do_help = false;
+  bool do_version = false;
   msgdomain_list_ty *mdlp;
-  int join_existing = 0;
-  int sort_by_msgid = 0;
-  int sort_by_filepos = 0;
+  bool join_existing = false;
+  bool sort_by_msgid = false;
+  bool sort_by_filepos = false;
   const char *file_name;
   const char *files_from = NULL;
   string_list_ty *file_list;
@@ -236,17 +236,17 @@ main (argc, argv)
       case '\0':               /* Long option.  */
        break;
       case 'a':
-       extract_all = 1;
+       extract_all = true;
        break;
       case 'c':
        if (optarg == NULL)
          {
-           add_all_comments = 1;
+           add_all_comments = true;
            comment_tag = NULL;
          }
        else
          {
-           add_all_comments = 0;
+           add_all_comments = false;
            comment_tag = optarg;
            /* We ignore leading white space.  */
            while (isspace (*comment_tag))
@@ -263,25 +263,25 @@ main (argc, argv)
        dir_list_append (optarg);
        break;
       case 'e':
-       message_print_style_escape (0);
+       message_print_style_escape (false);
        break;
       case 'E':
-       message_print_style_escape (1);
+       message_print_style_escape (true);
        break;
       case 'f':
        files_from = optarg;
        break;
       case 'F':
-       sort_by_filepos = 1;
+       sort_by_filepos = true;
         break;
       case 'h':
-       do_help = 1;
+       do_help = true;
        break;
       case 'i':
        message_print_style_indent ();
        break;
       case 'j':
-       join_existing = 1;
+       join_existing = true;
        break;
       case 'k':
        if (optarg == NULL || *optarg != '\0')
@@ -327,7 +327,7 @@ main (argc, argv)
        }
        break;
       case 's':
-       sort_by_msgid = 1;
+       sort_by_msgid = true;
        break;
       case 'S':
        message_print_style_uniforum ();
@@ -336,7 +336,7 @@ main (argc, argv)
        xgettext_lex_trigraphs ();
        break;
       case 'V':
-       do_version = 1;
+       do_version = true;
        break;
       case 'w':
        {
@@ -687,7 +687,7 @@ exclude_directive_message (pop, msgid, msgid_pos, msgid_plural,
      char *msgstr;
      size_t msgstr_len;
      lex_pos_ty *msgstr_pos;
-     int obsolete;
+     bool obsolete;
 {
   message_ty *mp;
 
@@ -940,11 +940,11 @@ scan_c_file (filename, mdlp)
           {
             if (commas_to_skip == 0)
               {
-                error_with_progname = 0;
+                error_with_progname = false;
                 error (0, 0,
                        _("%s:%d: warning: keyword nested in keyword arg"),
                        token.file_name, token.line_number);
-                error_with_progname = 1;
+                error_with_progname = true;
                 continue;
               }
 
@@ -952,11 +952,11 @@ scan_c_file (filename, mdlp)
                potentially unbounded stack.  We haven't run across an
                example that needs this functionality yet.  For now,
                we punt and forget the outer keyword.  */
-            error_with_progname = 0;
+            error_with_progname = false;
             error (0, 0,
                    _("%s:%d: warning: keyword between outer keyword and its arg"),
                    token.file_name, token.line_number);
-            error_with_progname = 1;
+            error_with_progname = true;
           }
         commas_to_skip = token.argnum1 - 1;
         plural_commas = (token.argnum2 > token.argnum1
@@ -1059,11 +1059,11 @@ struct extract_class_ty
   string_list_ty *comment;
   string_list_ty *comment_dot;
 
-  int is_fuzzy;
+  bool is_fuzzy;
   enum is_c_format is_c_format;
   enum is_wrap do_wrap;
 
-  int filepos_count;
+  size_t filepos_count;
   lex_pos_ty *filepos;
 };
 
@@ -1077,7 +1077,7 @@ extract_constructor (that)
   this->mlp = NULL; /* actually set in read_po_file, below */
   this->comment = NULL;
   this->comment_dot = NULL;
-  this->is_fuzzy = 0;
+  this->is_fuzzy = false;
   this->is_c_format = undecided;
   this->do_wrap = undecided;
   this->filepos_count = 0;
@@ -1104,7 +1104,7 @@ extract_directive_message (that, msgid, msgid_pos, msgid_plural,
      char *msgstr;
      size_t msgstr_len;
      lex_pos_ty *msgstr_pos;
-     int obsolete;
+     bool obsolete;
 {
   extract_class_ty *this = (extract_class_ty *)that;
   message_ty *mp;
@@ -1131,7 +1131,7 @@ extract_directive_message (that, msgid, msgid_pos, msgid_plural,
       this->comment_dot = NULL;
       this->filepos_count = 0;
       this->filepos = NULL;
-      this->is_fuzzy = 0;
+      this->is_fuzzy = false;
       this->is_c_format = undecided;
       this->do_wrap = undecided;
       return;
@@ -1188,7 +1188,7 @@ extract_directive_message (that, msgid, msgid_pos, msgid_plural,
     free (this->filepos);
   this->filepos_count = 0;
   this->filepos = NULL;
-  this->is_fuzzy = 0;
+  this->is_fuzzy = false;
   this->is_c_format = undecided;
   this->do_wrap = undecided;
 }
@@ -1198,7 +1198,7 @@ static void
 extract_parse_brief (that)
      po_ty *that;
 {
-  po_lex_pass_comments (1);
+  po_lex_pass_comments (true);
 }
 
 
@@ -1258,7 +1258,7 @@ extract_comment_special (that, s)
   extract_class_ty *this = (extract_class_ty *) that;
 
   if (strstr (s, "fuzzy") != NULL)
-    this->is_fuzzy = 1;
+    this->is_fuzzy = true;
   this->is_c_format = parse_c_format_description_string (s);
   this->do_wrap = parse_c_width_description_string (s);
 }
@@ -1379,7 +1379,7 @@ SOME DESCRIPTIVE TITLE.\n\
 Copyright (C) YEAR Free Software Foundation, Inc.\n\
 FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.\n");
 
-  mp->is_fuzzy = 1;
+  mp->is_fuzzy = true;
 
   return mp;
 }