summaryrefslogtreecommitdiffstats
path: root/gettext-tools
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2003-09-24 10:34:30 +0000
committerBruno Haible <bruno@clisp.org>2009-06-23 12:11:01 +0200
commitff75d3f15dec756e0596525b541b50495b75db58 (patch)
treee2a300893f85830ab094b27d3be3029fa6b9abb7 /gettext-tools
parent4e2f4d76f7f6fd6c861231754db74cd313865933 (diff)
downloadexternal_gettext-ff75d3f15dec756e0596525b541b50495b75db58.zip
external_gettext-ff75d3f15dec756e0596525b541b50495b75db58.tar.gz
external_gettext-ff75d3f15dec756e0596525b541b50495b75db58.tar.bz2
Use bool where appropriate.
Diffstat (limited to 'gettext-tools')
-rw-r--r--gettext-tools/tests/ChangeLog7
-rw-r--r--gettext-tools/tests/tstgettext.c33
-rw-r--r--gettext-tools/tests/tstngettext.c8
3 files changed, 28 insertions, 20 deletions
diff --git a/gettext-tools/tests/ChangeLog b/gettext-tools/tests/ChangeLog
index 548b6f0..6b258b9 100644
--- a/gettext-tools/tests/ChangeLog
+++ b/gettext-tools/tests/ChangeLog
@@ -1,3 +1,10 @@
+2003-09-16 Bruno Haible <bruno@clisp.org>
+
+ * tstgettext.c (add_newline, do_expand): Change type to bool. Make
+ static.
+ (main, expand_escape): Use bool.
+ * tstngettext.c (main): Use bool.
+
2003-09-13 Bruno Haible <bruno@clisp.org>
* lang-sh: Source gettext.sh.
diff --git a/gettext-tools/tests/tstgettext.c b/gettext-tools/tests/tstgettext.c
index 3b2d9d2..fefe6fd 100644
--- a/gettext-tools/tests/tstgettext.c
+++ b/gettext-tools/tests/tstgettext.c
@@ -43,12 +43,13 @@
#define _(str) gettext (str)
-/* If nonzero add newline after last string. This makes only sense in
+/* If true, add newline after last string. This makes only sense in
the `echo' emulation mode. */
-int add_newline;
-/* If nonzero expand escape sequences in strings before looking in the
+static bool add_newline;
+
+/* If true, expand escape sequences in strings before looking in the
message catalog. */
-int do_expand;
+static bool do_expand;
/* Long options. */
static const struct option long_options[] =
@@ -76,14 +77,14 @@ main (int argc, char *argv[])
const char *msgid;
/* Default values for command line options. */
- int do_help = 0;
- int do_shell = 0;
- int do_version = 0;
+ bool do_help = false;
+ bool do_shell = false;
+ bool do_version = false;
bool environ_changed = false;
const char *domain = getenv ("TEXTDOMAIN");
const char *domaindir = getenv ("TEXTDOMAINDIR");
- add_newline = 1;
- do_expand = 0;
+ add_newline = true;
+ do_expand = false;
/* Set program name for message texts. */
set_program_name (argv[0]);
@@ -111,22 +112,22 @@ main (int argc, char *argv[])
domain = optarg;
break;
case 'e':
- do_expand = 1;
+ do_expand = true;
break;
case 'E':
/* Ignore. Just for compatibility. */
break;
case 'h':
- do_help = 1;
+ do_help = true;
break;
case 'n':
- add_newline = 0;
+ add_newline = false;
break;
case 's':
- do_shell = 1;
+ do_shell = true;
break;
case 'V':
- do_version = 1;
+ do_version = true;
break;
case '=':
{
@@ -171,7 +172,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
/* We have two major modes: use following Uniforum spec and as
internationalized `echo' program. */
- if (do_shell == 0)
+ if (!do_shell)
{
/* We have to write a single strings translation to stdout. */
@@ -336,7 +337,7 @@ expand_escape (const char *str)
++cp;
break;
case 'c': /* suppress trailing newline */
- add_newline = 0;
+ add_newline = false;
++cp;
break;
case 'f': /* form feed */
diff --git a/gettext-tools/tests/tstngettext.c b/gettext-tools/tests/tstngettext.c
index 0060ae0..b29474d 100644
--- a/gettext-tools/tests/tstngettext.c
+++ b/gettext-tools/tests/tstngettext.c
@@ -68,8 +68,8 @@ main (int argc, char *argv[])
unsigned long n;
/* Default values for command line options. */
- int do_help = 0;
- int do_version = 0;
+ bool do_help = false;
+ bool do_version = false;
bool environ_changed = false;
const char *domain = getenv ("TEXTDOMAIN");
const char *domaindir = getenv ("TEXTDOMAINDIR");
@@ -100,10 +100,10 @@ main (int argc, char *argv[])
domain = optarg;
break;
case 'h':
- do_help = 1;
+ do_help = true;
break;
case 'V':
- do_version = 1;
+ do_version = true;
break;
case '=':
{