[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: 43-gary-use-c99-bool.patch
From: |
Gary V. Vaughan |
Subject: |
FYI: 43-gary-use-c99-bool.patch |
Date: |
Fri, 15 Aug 2003 16:59:19 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030804 |
Applied to HEAD.
--
())_. Gary V. Vaughan gary@(oranda.demon.co.uk|gnu.org)
( '/ Research Scientist http://www.oranda.demon.co.uk ,_())____
/ )= GNU Hacker http://www.gnu.org/software/libtool \' `&
`(_~)_ Tech' Author http://sources.redhat.com/autobook =`---d__/
Index: ChangeLog
from Gary V. Vaughan <address@hidden>
* configure.ac (AC_HEADER_STDBOOL, INCLUDE_STDBOOL_H): Check for
C99 bool.
* system-h.in (m4_boolean): Removed in favour of using C99 bool if
possible or faking one with a typedef. Changed all callers.
2003-08-15 Gary V. Vaughan <address@hidden>
Index: configure.ac
===================================================================
RCS file: /cvsroot/m4/m4/configure.ac,v
retrieving revision 1.9
diff -u -p -u -r1.9 configure.ac
--- configure.ac 14 Aug 2003 15:51:34 -0000 1.9
+++ configure.ac 15 Aug 2003 15:52:07 -0000
@@ -19,7 +19,7 @@
## -------------------------- ##
## We need a modern Autotest. ##
## -------------------------- ##
-AC_PREREQ([2.54])
+AC_PREREQ([2.55])
@@ -157,9 +157,16 @@ AC_PROG_AWK
## ------------------------- ##
## C headers required by M4. ##
## ------------------------- ##
-AC_CHECK_HEADERS(limits.h locale.h memory.h string.h unistd.h errno.h)
AC_HEADER_STDC
+AC_HEADER_STDBOOL
+AC_CHECK_HEADERS(limits.h locale.h memory.h string.h unistd.h errno.h)
+if test $ac_cv_header_stdbool_h = yes; then
+ INCLUDE_STDBOOL_H='#include <stdbool.h>'
+else
+ INCLUDE_STDBOOL_H='typedef enum {false = 0, true = 1} bool'
+fi
+AC_SUBST([INCLUDE_STDBOOL_H])
## --------------------------- ##
Index: config/gnu-obstack.m4
===================================================================
RCS file: /cvsroot/m4/m4/config/gnu-obstack.m4,v
retrieving revision 1.10
diff -u -p -u -r1.10 gnu-obstack.m4
--- config/gnu-obstack.m4 14 Aug 2003 15:51:34 -0000 1.10
+++ config/gnu-obstack.m4 15 Aug 2003 15:52:07 -0000
@@ -49,7 +49,7 @@ rm -f $m4_obstack_h
if test $m4_cv_func_obstack = yes; then
# The system provides obstack.h, `#include <obstack.h>' will work
- INCLUDE_OBSTACK_H='<obstack.h>'
+ INCLUDE_OBSTACK_H='#include <obstack.h>'
AC_DEFINE(HAVE_OBSTACK, 1, [Define if libc includes obstacks.])
else
@@ -60,7 +60,7 @@ else
# provides an implementation: So we ship m4/gnu-obstack.h, and link
# it to m4/obstack.h here (to substitute the missing system supplied
# version). Hence, `#include <m4/obstack.h>' will work.
- INCLUDE_OBSTACK_H='<m4/obstack.h>'
+ INCLUDE_OBSTACK_H='#include <m4/obstack.h>'
AC_CONFIG_LINKS($m4_obstack_h:${top_srcdir}/m4/gnu-obstack.h)
if test x"$ac_cv_header_obstack_h" != xyes; then
Index: m4/debug.c
===================================================================
RCS file: /cvsroot/m4/m4/m4/debug.c,v
retrieving revision 1.17
diff -u -p -u -r1.17 debug.c
--- m4/debug.c 24 Jul 2003 12:16:45 -0000 1.17
+++ m4/debug.c 15 Aug 2003 15:52:07 -0000
@@ -135,9 +135,9 @@ set_debug_file (m4 *context, FILE *fp)
}
/* Change the debug output to file NAME. If NAME is NULL, debug output is
- reverted to stderr, and if empty debug output is discarded. Return TRUE
+ reverted to stderr, and if empty debug output is discarded. Return true
iff the output stream was changed. */
-boolean
+bool
m4_debug_set_output (m4 *context, const char *name)
{
FILE *fp;
@@ -152,11 +152,11 @@ m4_debug_set_output (m4 *context, const
{
fp = fopen (name, "a");
if (fp == NULL)
- return FALSE;
+ return false;
set_debug_file (context, fp);
}
- return TRUE;
+ return true;
}
/* Print the header of a one-line debug message, starting by "m4 debug". */
Index: m4/input.c
===================================================================
RCS file: /cvsroot/m4/m4/m4/input.c,v
retrieving revision 1.35
diff -u -p -u -r1.35 input.c
--- m4/input.c 24 Jul 2003 14:21:02 -0000 1.35
+++ m4/input.c 15 Aug 2003 15:52:07 -0000
@@ -116,7 +116,7 @@ struct input_block
int lineno; /* current line number for do */
/* Yet another attack of "The curse of global variables" (sigh) */
int out_lineno; /* current output line number do */
- boolean advance_line; /* start_of_input_line from next_char () */
+ bool advance_line; /* start_of_input_line from next_char () */
}
u_f;
struct
@@ -126,8 +126,8 @@ struct input_block
int flags; /* flags associated with the builtin. */
m4_hash *arg_signature; /* argument signature for builtin. */
int min_args, max_args; /* argv maxima and minima for the builtin. */
- boolean traced; /* TRUE iff builtin is traced. */
- boolean read; /* TRUE iff block has been read. */
+ bool traced; /* true iff builtin is traced. */
+ bool read; /* true iff block has been read. */
}
u_b;
}
@@ -168,7 +168,7 @@ static input_block *wsp;
static input_block *next;
/* Flag for next_char () to increment m4_current_line. */
-static boolean start_of_input_line;
+static bool start_of_input_line;
@@ -202,7 +202,7 @@ file_read (void)
if (start_of_input_line)
{
- start_of_input_line = FALSE;
+ start_of_input_line = false;
m4_current_line++;
}
@@ -211,7 +211,7 @@ file_read (void)
return CHAR_RETRY;
if (ch == '\n')
- start_of_input_line = TRUE;
+ start_of_input_line = true;
return ch;
}
@@ -221,7 +221,7 @@ file_unget (ch)
{
ungetc (ch, isp->u.u_f.file);
if (ch == '\n')
- start_of_input_line = FALSE;
+ start_of_input_line = false;
}
static void
@@ -282,7 +282,7 @@ m4_push_file (m4 *context, FILE *fp, con
static int
builtin_peek (void)
{
- if (isp->u.u_b.read == TRUE)
+ if (isp->u.u_b.read == true)
return CHAR_RETRY;
return CHAR_BUILTIN;
@@ -291,10 +291,10 @@ builtin_peek (void)
static int
builtin_read (void)
{
- if (isp->u.u_b.read == TRUE)
+ if (isp->u.u_b.read == true)
return CHAR_RETRY;
- isp->u.u_b.read = TRUE;
+ isp->u.u_b.read = true;
return CHAR_BUILTIN;
}
@@ -326,7 +326,7 @@ m4_push_builtin (m4_symbol_value *token)
i->u.u_b.min_args = VALUE_MIN_ARGS (token);
i->u.u_b.max_args = VALUE_MAX_ARGS (token);
i->u.u_b.flags = VALUE_FLAGS (token);
- i->u.u_b.read = FALSE;
+ i->u.u_b.read = false;
i->prev = isp;
isp = i;
@@ -498,18 +498,18 @@ pop_input (m4 *context)
/* To switch input over to the wrapup stack, main () calls pop_wrapup
Since wrapup text can install new wrapup text, pop_wrapup () returns
- FALSE when there is no wrapup text on the stack, and TRUE otherwise. */
-boolean
+ false when there is no wrapup text on the stack, and true otherwise. */
+bool
m4_pop_wrapup (void)
{
if (wsp == NULL)
- return FALSE;
+ return false;
current_input = &wrapup_stack;
isp = wsp;
wsp = NULL;
- return TRUE;
+ return true;
}
/* When a BUILTIN token is seen, m4__next_token () uses init_builtin_token
@@ -696,7 +696,7 @@ m4_input_init (void)
wsp = NULL;
next = NULL;
- start_of_input_line = FALSE;
+ start_of_input_line = false;
}
void
Index: m4/ltdl.c
===================================================================
RCS file: /cvsroot/m4/m4/m4/ltdl.c,v
retrieving revision 1.14
diff -u -p -u -r1.14 ltdl.c
--- m4/ltdl.c 12 Aug 2003 15:33:56 -0000 1.14
+++ m4/ltdl.c 15 Aug 2003 15:52:07 -0000
@@ -454,7 +454,7 @@ opendir (path)
entry = LT_DLMALLOC (DIR,sizeof(DIR));
if (entry != (DIR *) 0)
{
- entry->firsttime = TRUE;
+ entry->firsttime = true;
entry->hSearch = FindFirstFile(file_specification,&entry->Win32FindData);
}
if (entry->hSearch == INVALID_HANDLE_VALUE)
@@ -487,7 +487,7 @@ static struct dirent *readdir(entry)
if (status == 0)
return((struct dirent *) 0);
}
- entry->firsttime = FALSE;
+ entry->firsttime = false;
(void) strncpy(entry->file_info.d_name,entry->Win32FindData.cFileName,
LT_FILENAME_MAX-1);
entry->file_info.d_namlen = strlen(entry->file_info.d_name);
@@ -1587,11 +1587,11 @@ static struct lt_user_dlloader sys_dld =
/* We have to put some stuff here that isn't in older dyld.h files */
#ifndef ENUM_DYLD_BOOL
# define ENUM_DYLD_BOOL
-# undef FALSE
-# undef TRUE
+# undef false
+# undef true
enum DYLD_BOOL {
- FALSE,
- TRUE
+ false,
+ true
};
#endif
#ifndef LC_REQ_DYLD
Index: m4/m4.c
===================================================================
RCS file: /cvsroot/m4/m4/m4/m4.c,v
retrieving revision 1.8
diff -u -p -u -r1.8 m4.c
--- m4/m4.c 29 Jul 2003 16:11:24 -0000 1.8
+++ m4/m4.c 15 Aug 2003 15:52:07 -0000
@@ -112,7 +112,7 @@ m4_context_field_table
#undef M4FIELD
#define M4OPT_BIT(bit, base) \
- boolean CONC(m4_get_, base) (m4 *context) \
+ bool CONC(m4_get_, base) (m4 *context) \
{ \
assert (context); \
return BIT_TEST (context->opt_flags, (bit)); \
@@ -121,7 +121,7 @@ m4_context_opt_bit_table
#undef M4OPT_BIT
#define M4OPT_BIT(bit, base) \
- boolean CONC(m4_set_, base) (m4 *context, boolean value) \
+ bool CONC(m4_set_, base) (m4 *context, bool value) \
{ \
assert (context); \
if (value) \
Index: m4/m4module.h
===================================================================
RCS file: /cvsroot/m4/m4/m4/m4module.h,v
retrieving revision 1.66
diff -u -p -u -r1.66 m4module.h
--- m4/m4module.h 15 Aug 2003 14:06:27 -0000 1.66
+++ m4/m4module.h 15 Aug 2003 15:52:07 -0000
@@ -45,7 +45,7 @@ struct m4_builtin
{
const char * name;
m4_builtin_func * func;
- boolean groks_macro_args, blind_if_no_args;
+ bool groks_macro_args, blind_if_no_args;
int min_args, max_args;
};
@@ -82,13 +82,13 @@ struct m4_macro
#define M4ARG(i) (argc > (i) ? m4_get_symbol_value_text (argv[i]) : "")
-extern boolean m4_bad_argc (m4 *, int, m4_symbol_value **,
+extern bool m4_bad_argc (m4 *, int, m4_symbol_value **,
int, int);
-extern boolean m4_numeric_arg (m4 *, int, m4_symbol_value **,
+extern bool m4_numeric_arg (m4 *, int, m4_symbol_value **,
int, int *);
extern void m4_dump_args (m4 *, m4_obstack *, int,
m4_symbol_value **, const char *,
- boolean);
+ bool);
/* Error handling. */
#define M4ERROR(Arglist) (error Arglist)
@@ -113,7 +113,7 @@ extern void m4_delete (m4 *);
M4FIELD(FILE *, debug_file, debug_file) \
M4FIELD(m4_obstack, trace_messages, trace_messages) \
M4FIELD(int, warning_status_opt, warning_status) \
- M4FIELD(boolean, no_gnu_extensions_opt, no_gnu_extensions) \
+ M4FIELD(bool, no_gnu_extensions_opt, no_gnu_extensions) \
M4FIELD(int, nesting_limit_opt, nesting_limit) \
M4FIELD(int, debug_level_opt, debug_level) \
M4FIELD(int, max_debug_arg_length_opt, max_debug_arg_length)\
@@ -135,8 +135,8 @@ m4_context_field_table
#undef M4FIELD
#define M4OPT_BIT(bit, base) \
- extern boolean CONC(m4_get_, base) (m4 *context); \
- extern boolean CONC(m4_set_, base) (m4 *context, boolean value);
+ extern bool CONC(m4_get_, base) (m4 *context); \
+ extern bool CONC(m4_set_, base) (m4 *context, bool value);
m4_context_opt_bit_table
#undef M4OPT_BIT
@@ -165,7 +165,7 @@ extern const char * m4_get_module_name (
typedef void *m4_symtab_apply_func (m4_symbol_table *symtab, const char *key,
m4_symbol *symbol, void *userdata);
-extern m4_symbol_table *m4_symtab_create (size_t, boolean *);
+extern m4_symbol_table *m4_symtab_create (size_t, bool *);
extern void m4_symtab_delete (m4_symbol_table*);
extern void * m4_symtab_apply (m4_symbol_table*, m4_symtab_apply_func*,
void*);
@@ -183,9 +183,9 @@ extern void m4_symbol_delete (m4_
m4_symbol_popdef ((symtab), (name)); } M4_STMT_END
extern m4_symbol_value *m4_get_symbol_value (m4_symbol*);
-extern boolean m4_get_symbol_traced (m4_symbol*);
-extern boolean m4_set_symbol_traced (m4_symbol*, boolean);
-extern boolean m4_set_symbol_name_traced (m4_symbol_table*,
+extern bool m4_get_symbol_traced (m4_symbol*);
+extern bool m4_set_symbol_traced (m4_symbol*, bool);
+extern bool m4_set_symbol_name_traced (m4_symbol_table*,
const char *);
#define m4_is_symbol_text(symbol) \
@@ -201,9 +201,9 @@ extern m4_symbol_value *m4_symbol_value_
extern void m4_symbol_value_delete (m4_symbol_value *);
extern void m4_symbol_value_copy (m4_symbol_value *,
m4_symbol_value *);
-extern boolean m4_is_symbol_value_text (m4_symbol_value *);
-extern boolean m4_is_symbol_value_func (m4_symbol_value *);
-extern boolean m4_is_symbol_value_void (m4_symbol_value *);
+extern bool m4_is_symbol_value_text (m4_symbol_value *);
+extern bool m4_is_symbol_value_func (m4_symbol_value *);
+extern bool m4_is_symbol_value_void (m4_symbol_value *);
extern char *m4_get_symbol_value_text (m4_symbol_value *);
extern m4_builtin_func *m4_get_symbol_value_func (m4_symbol_value *);
extern void m4_set_symbol_value_text (m4_symbol_value *, char *);
@@ -264,7 +264,7 @@ enum {
#define m4_is_debug_bit(C,B) (BIT_TEST (m4_get_debug_level_opt (C), (B)))
extern int m4_debug_decode (m4 *, const char *);
-extern boolean m4_debug_set_output (m4 *, const char *);
+extern bool m4_debug_set_output (m4 *, const char *);
extern void m4_debug_message_prefix (m4 *);
@@ -280,9 +280,9 @@ extern const char * m4_get_syntax_rquot
extern const char * m4_get_syntax_bcomm (m4_syntax_table *syntax);
extern const char * m4_get_syntax_ecomm (m4_syntax_table *syntax);
-extern boolean m4_is_syntax_single_quotes (m4_syntax_table *);
-extern boolean m4_is_syntax_single_comments (m4_syntax_table *);
-extern boolean m4_is_syntax_macro_escaped (m4_syntax_table *);
+extern bool m4_is_syntax_single_quotes (m4_syntax_table *);
+extern bool m4_is_syntax_single_comments (m4_syntax_table *);
+extern bool m4_is_syntax_macro_escaped (m4_syntax_table *);
/* These are values to be assigned to syntax table entries, although they
are bit masks for fast categorisation in m4__next_token(), only one
@@ -342,7 +342,7 @@ extern void m4_push_builtin (m4_symbol_v
extern m4_obstack *m4_push_string_init (m4 *context);
extern const char *m4_push_string_finish (void);
extern void m4_push_wrapup (const char *);
-extern boolean m4_pop_wrapup (void);
+extern bool m4_pop_wrapup (void);
@@ -356,7 +356,7 @@ extern void m4_output_exit (void);
extern void m4_shipout_text (m4 *, m4_obstack *, const char *, int);
extern void m4_shipout_int (m4_obstack *, int);
extern void m4_shipout_string (m4 *, m4_obstack *, const char *,
- int, boolean);
+ int, bool);
extern void m4_make_diversion (int);
extern void m4_insert_diversion (int);
Index: m4/m4private.h
===================================================================
RCS file: /cvsroot/m4/m4/m4/m4private.h,v
retrieving revision 1.34
diff -u -p -u -r1.34 m4private.h
--- m4/m4private.h 15 Aug 2003 14:06:27 -0000 1.34
+++ m4/m4private.h 15 Aug 2003 15:52:07 -0000
@@ -52,7 +52,7 @@ struct m4 {
/* Option flags (set in src/main.c). */
int warning_status; /* -E */
- boolean no_gnu_extensions; /* -G */
+ bool no_gnu_extensions; /* -G */
int nesting_limit; /* -L */
int debug_level; /* -d */
int max_debug_arg_length; /* -l */
@@ -121,7 +121,7 @@ extern void m4__module_exit (m4 *con
struct m4_symbol
{
- boolean traced;
+ bool traced;
m4_symbol_value * value;
};
@@ -224,14 +224,14 @@ struct m4_syntax_table {
m4_string lquote, rquote;
m4_string bcomm, ecomm;
- /* TRUE iff strlen(rquote) == strlen(lquote) == 1 */
- boolean is_single_quotes;
+ /* true iff strlen(rquote) == strlen(lquote) == 1 */
+ bool is_single_quotes;
- /* TRUE iff strlen(bcomm) == strlen(ecomm) == 1 */
- boolean is_single_comments;
+ /* true iff strlen(bcomm) == strlen(ecomm) == 1 */
+ bool is_single_comments;
- /* TRUE iff some character has M4_SYNTAX_ESCAPE */
- boolean is_macro_escaped;
+ /* true iff some character has M4_SYNTAX_ESCAPE */
+ bool is_macro_escaped;
};
#ifdef NDEBUG
Index: m4/macro.c
===================================================================
RCS file: /cvsroot/m4/m4/m4/macro.c,v
retrieving revision 1.37
diff -u -p -u -r1.37 macro.c
--- m4/macro.c 15 Aug 2003 14:06:27 -0000 1.37
+++ m4/macro.c 15 Aug 2003 15:52:07 -0000
@@ -33,7 +33,7 @@ static void expand_macro (m4 *co
m4_symbol *symbol);
static void expand_token (m4 *context, m4_obstack *obs,
m4__token_type type, m4_symbol_value *token);
-static boolean expand_argument (m4 *context, m4_obstack *obs,
+static bool expand_argument (m4 *context, m4_obstack *obs,
m4_symbol_value *argp);
static void process_macro (m4 *context, m4_symbol *symbol,
@@ -132,7 +132,7 @@ expand_token (m4 *context, m4_obstack *o
parentheses. It returns a flag indicating whether the argument read is
the last for the active macro call. The arguments are built on the
obstack OBS, indirectly through expand_token (). */
-static boolean
+static bool
expand_argument (m4 *context, m4_obstack *obs, m4_symbol_value *argp)
{
m4__token_type type;
@@ -170,7 +170,7 @@ expand_argument (m4 *context, m4_obstack
{
m4_set_symbol_value_text (argp, text);
}
- return (boolean) (m4_has_syntax (M4SYNTAX,
*m4_get_symbol_value_text (&token), M4_SYNTAX_COMMA));
+ return (bool) (m4_has_syntax (M4SYNTAX, *m4_get_symbol_value_text
(&token), M4_SYNTAX_COMMA));
}
if (m4_has_syntax (M4SYNTAX, *text, M4_SYNTAX_OPEN))
@@ -223,7 +223,7 @@ expand_macro (m4 *context, const char *n
int argc;
m4_obstack *expansion;
const char *expanded;
- boolean traced;
+ bool traced;
int my_call_id;
expansion_level++;
@@ -235,7 +235,7 @@ ERROR: Recursion limit of %d exceeded, u
macro_call_id++;
my_call_id = macro_call_id;
- traced = (boolean) (m4_is_debug_bit (context, M4_DEBUG_TRACE_ALL)
+ traced = (bool) (m4_is_debug_bit (context, M4_DEBUG_TRACE_ALL)
|| m4_get_symbol_traced (symbol));
obstack_init (&argptr);
@@ -277,8 +277,8 @@ collect_arguments (m4 *context, const ch
int ch; /* lookahead for ( */
m4_symbol_value token;
m4_symbol_value *tokenp;
- boolean more_args;
- boolean groks_macro_args;
+ bool more_args;
+ bool groks_macro_args;
groks_macro_args = BIT_TEST (SYMBOL_FLAGS (symbol), VALUE_MACRO_ARGS_BIT);
@@ -372,7 +372,7 @@ process_macro (m4 *context, m4_symbol *s
text = endp;
}
if (i < argc)
- m4_shipout_string (context, obs, M4ARG (i), 0, FALSE);
+ m4_shipout_string (context, obs, M4ARG (i), 0, false);
break;
case '#': /* number of arguments */
@@ -413,7 +413,7 @@ process_macro (m4 *context, m4_symbol *s
i = SYMBOL_ARG_INDEX (*arg);
if (i < argc)
- m4_shipout_string (context, obs, M4ARG (i), 0, FALSE);
+ m4_shipout_string (context, obs, M4ARG (i), 0, false);
else
M4ERROR ((EXIT_FAILURE, 0, "\
INTERNAL ERROR: %s: out of range reference `%d' from argument %s",
@@ -462,7 +462,7 @@ trace_format (m4 *context, const char *f
va_start (args, fmt);
- while (TRUE)
+ while (true)
{
while ((ch = *fmt++) != '\0' && ch != '%')
obstack_1grow (&context->trace_messages, ch);
Index: m4/output.c
===================================================================
RCS file: /cvsroot/m4/m4/m4/output.c,v
retrieving revision 1.13
diff -u -p -u -r1.13 output.c
--- m4/output.c 23 Jul 2003 16:20:50 -0000 1.13
+++ m4/output.c 15 Aug 2003 15:52:07 -0000
@@ -395,7 +395,7 @@ void
m4_shipout_text (m4 *context, m4_obstack *obs,
const char *text, int length)
{
- static boolean start_of_output_line = TRUE;
+ static bool start_of_output_line = true;
char line[20];
const char *cursor;
@@ -441,7 +441,7 @@ m4_shipout_text (m4 *context, m4_obstack
{
if (start_of_output_line)
{
- start_of_output_line = FALSE;
+ start_of_output_line = false;
m4_output_current_line++;
#ifdef DEBUG_OUTPUT
@@ -472,7 +472,7 @@ m4_shipout_text (m4 *context, m4_obstack
}
OUTPUT_CHARACTER (*text);
if (*text == '\n')
- start_of_output_line = TRUE;
+ start_of_output_line = true;
}
}
@@ -489,7 +489,7 @@ m4_shipout_int (m4_obstack *obs, int val
void
m4_shipout_string (m4 *context, m4_obstack *obs, const char *s, int len,
- boolean quoted)
+ bool quoted)
{
if (s == NULL)
s = "";
Index: m4/path.c
===================================================================
RCS file: /cvsroot/m4/m4/m4/path.c,v
retrieving revision 1.6
diff -u -p -u -r1.6 path.c
--- m4/path.c 12 Aug 2003 15:33:57 -0000 1.6
+++ m4/path.c 15 Aug 2003 15:52:07 -0000
@@ -40,7 +40,7 @@
#include "m4private.h"
static void search_path_add (m4__search_path_info *, const char *);
-static void search_path_env_init (m4__search_path_info *, char *, boolean);
+static void search_path_env_init (m4__search_path_info *, char *, bool);
/*
@@ -71,7 +71,7 @@ search_path_add (m4__search_path_info *i
}
static void
-search_path_env_init (m4__search_path_info *info, char *path, boolean isabs)
+search_path_env_init (m4__search_path_info *info, char *path, bool isabs)
{
char *path_end;
@@ -100,7 +100,7 @@ m4_include_env_init (m4 *context)
return;
search_path_env_init (m4__get_search_path (context),
- getenv ("M4PATH"), FALSE);
+ getenv ("M4PATH"), false);
}
void
Index: m4/symtab.c
===================================================================
RCS file: /cvsroot/m4/m4/m4/symtab.c,v
retrieving revision 1.43
diff -u -p -u -r1.43 symtab.c
--- m4/symtab.c 12 Aug 2003 15:33:57 -0000 1.43
+++ m4/symtab.c 15 Aug 2003 15:52:07 -0000
@@ -46,7 +46,7 @@
struct m4_symbol_table {
m4_hash *table;
- boolean *nuke_trace_bit; /* default: &(context->no_gnu_ext_opt) */
+ bool *nuke_trace_bit; /* default: &(context->no_gnu_ext_opt) */
};
static m4_symbol *symtab_fetch (m4_symbol_table*, const char *);
@@ -65,7 +65,7 @@ static void * arg_copy_CB (m4_hash *s
These functions are used to manage a symbol table as a whole. */
m4_symbol_table *
-m4_symtab_create (size_t size, boolean *nuke_trace_bit)
+m4_symtab_create (size_t size, bool *nuke_trace_bit)
{
m4_symbol_table *symtab = XMALLOC (m4_symbol_table, 1);
@@ -187,7 +187,7 @@ symbol_destroy_CB (m4_symbol_table *symt
{
char *key = xstrdup ((char *) name);
- m4_set_symbol_traced (symbol, FALSE);
+ m4_set_symbol_traced (symbol, false);
while (key && m4_hash_lookup (symtab->table, key))
m4_symbol_popdef (symtab, key);
@@ -368,7 +368,7 @@ arg_copy_CB (m4_hash *src, const void *n
return NULL;
}
-boolean
+bool
m4_set_symbol_name_traced (m4_symbol_table *symtab, const char *name)
{
m4_symbol *symbol;
@@ -378,7 +378,7 @@ m4_set_symbol_name_traced (m4_symbol_tab
symbol = symtab_fetch (symtab, name);
- return m4_set_symbol_traced (symbol, TRUE);
+ return m4_set_symbol_traced (symbol, true);
}
@@ -395,7 +395,7 @@ m4_symbol_delete (m4_symbol_table *symta
}
#undef m4_get_symbol_traced
-boolean
+bool
m4_get_symbol_traced (m4_symbol *symbol)
{
assert (symbol);
@@ -403,8 +403,8 @@ m4_get_symbol_traced (m4_symbol *symbol)
}
#undef m4_set_symbol_traced
-boolean
-m4_set_symbol_traced (m4_symbol *symbol, boolean value)
+bool
+m4_set_symbol_traced (m4_symbol *symbol, bool value)
{
assert (symbol);
return symbol->traced = value;
@@ -426,7 +426,7 @@ m4_get_symbol_value (m4_symbol *symbol)
}
#undef m4_is_symbol_value_text
-boolean
+bool
m4_is_symbol_value_text (m4_symbol_value *value)
{
assert (value);
@@ -434,7 +434,7 @@ m4_is_symbol_value_text (m4_symbol_value
}
#undef m4_is_symbol_value_func
-boolean
+bool
m4_is_symbol_value_func (m4_symbol_value *value)
{
assert (value);
@@ -442,7 +442,7 @@ m4_is_symbol_value_func (m4_symbol_value
}
#undef m4_is_symbol_value_void
-boolean
+bool
m4_is_symbol_value_void (m4_symbol_value *value)
{
assert (value);
Index: m4/syntax.c
===================================================================
RCS file: /cvsroot/m4/m4/m4/syntax.c,v
retrieving revision 1.6
diff -u -p -u -r1.6 syntax.c
--- m4/syntax.c 17 Jul 2003 19:57:06 -0000 1.6
+++ m4/syntax.c 15 Aug 2003 15:52:07 -0000
@@ -91,7 +91,7 @@
string is parsed equally whether there is a $ or not. The character
$ is used by convention in user macros. */
-static boolean check_is_macro_escaped (m4_syntax_table *syntax);
+static bool check_is_macro_escaped (m4_syntax_table *syntax);
static int add_syntax_attribute (m4_syntax_table *syntax, int ch,
int code);
static int remove_syntax_attribute (m4_syntax_table *syntax, int ch, int code);
@@ -134,9 +134,9 @@ m4_syntax_create (void)
syntax->ecomm.string = xstrdup (DEF_ECOMM);
syntax->ecomm.length = strlen (syntax->ecomm.string);
- syntax->is_single_quotes = TRUE;
- syntax->is_single_comments = TRUE;
- syntax->is_macro_escaped = FALSE;
+ syntax->is_single_quotes = true;
+ syntax->is_single_comments = true;
+ syntax->is_macro_escaped = false;
add_syntax_attribute (syntax, syntax->lquote.string[0], M4_SYNTAX_LQUOTE);
add_syntax_attribute (syntax, syntax->rquote.string[0], M4_SYNTAX_RQUOTE);
@@ -287,21 +287,21 @@ m4_get_syntax_ecomm (m4_syntax_table *sy
return syntax->ecomm.string;
}
-boolean
+bool
m4_is_syntax_single_quotes (m4_syntax_table *syntax)
{
assert (syntax);
return syntax->is_single_quotes;
}
-boolean
+bool
m4_is_syntax_single_comments (m4_syntax_table *syntax)
{
assert (syntax);
return syntax->is_single_comments;
}
-boolean
+bool
m4_is_syntax_macro_escaped (m4_syntax_table *syntax)
{
assert (syntax);
@@ -370,16 +370,16 @@ m4_set_syntax (m4_syntax_table *syntax,
return code;
}
-static boolean
+static bool
check_is_macro_escaped (m4_syntax_table *syntax)
{
int ch;
- syntax->is_macro_escaped = FALSE;
+ syntax->is_macro_escaped = false;
for (ch = 256; --ch >= 0; )
if (m4_has_syntax (syntax, ch, M4_SYNTAX_ESCAPE))
{
- syntax->is_macro_escaped = TRUE;
+ syntax->is_macro_escaped = true;
break;
}
Index: m4/system-h.in
===================================================================
RCS file: /cvsroot/m4/m4/m4/system-h.in,v
retrieving revision 1.2
diff -u -p -u -r1.2 system-h.in
--- m4/system-h.in 6 Jun 2003 16:14:05 -0000 1.2
+++ m4/system-h.in 15 Aug 2003 15:52:07 -0000
@@ -30,7 +30,8 @@
/* I have yet to see a system that doesn't have these... */
#include <stdio.h>
#include <sys/types.h>
-#include @INCLUDE_OBSTACK_H@
address@hidden@
address@hidden@
/* This is okay in an installed file, because it will not change the
behaviour of the including program whether ENABLE_NLS is defined
@@ -147,21 +148,6 @@ BEGIN_C_DECLS
#ifndef EXIT_FAILURE
# define EXIT_SUCCESS 0
# define EXIT_FAILURE 1
-#endif
-
-
-
-/* If FALSE is defined, we presume TRUE is defined too. In this case,
- merely typedef boolean as being int. Or else, define these all. */
-#ifndef FALSE
-/* Do not use `enum boolean': this tag is used in SVR4 <sys/types.h>. */
-typedef enum { FALSE = 0, TRUE = 1 } m4_boolean;
-#else
-typedef int m4_boolean;
-#endif
-/* `boolean' is already a macro on some systems. */
-#ifndef boolean
-# define boolean m4_boolean
#endif
Index: m4/utility.c
===================================================================
RCS file: /cvsroot/m4/m4/m4/utility.c,v
retrieving revision 1.35
diff -u -p -u -r1.35 utility.c
--- m4/utility.c 15 Aug 2003 14:06:27 -0000 1.35
+++ m4/utility.c 15 Aug 2003 15:52:07 -0000
@@ -34,7 +34,7 @@ static const char * skip_space (m4 *, co
MIN is the minimum number of acceptable arguments, negative if not
applicable, MAX is the maximum number, negative if not applicable.
ARGC, MIN, and MAX count ARGV[0], the name of the macro. */
-boolean
+bool
m4_bad_argc (m4 *context, int argc, m4_symbol_value **argv, int min, int max)
{
if (min > 0 && argc < min)
@@ -42,7 +42,7 @@ m4_bad_argc (m4 *context, int argc, m4_s
M4WARN ((m4_get_warning_status_opt (context), 0,
_("Warning: %s: too few arguments: %d < %d"),
M4ARG (0), argc - 1, min - 1));
- return TRUE;
+ return true;
}
if (max > 0 && argc > max)
@@ -50,11 +50,11 @@ m4_bad_argc (m4 *context, int argc, m4_s
M4WARN ((m4_get_warning_status_opt (context), 0,
_("Warning: %s: too many arguments (ignored): %d > %d"),
M4ARG (0), argc - 1, max - 1));
- /* Return FALSE, otherwise it is not exactly `ignored'. */
- return FALSE;
+ /* Return false, otherwise it is not exactly `ignored'. */
+ return false;
}
- return FALSE;
+ return false;
}
static const char *
@@ -67,8 +67,8 @@ skip_space (m4 *context, const char *arg
/* The function m4_numeric_arg () converts ARG to an int pointed to by
VALUEP. If the conversion fails, print error message for macro.
- Return TRUE iff conversion succeeds. */
-boolean
+ Return true iff conversion succeeds. */
+bool
m4_numeric_arg (m4 *context, int argc, m4_symbol_value **argv,
int arg, int *valuep)
{
@@ -81,17 +81,17 @@ m4_numeric_arg (m4 *context, int argc, m
M4WARN ((m4_get_warning_status_opt (context), 0,
_("Warning: %s: argument %d non-numeric: %s"),
M4ARG (0), arg - 1, M4ARG (arg)));
- return FALSE;
+ return false;
}
- return TRUE;
+ return true;
}
/* Print ARGC arguments from the table ARGV to obstack OBS, separated by
- SEP, and quoted by the current quotes, if QUOTED is TRUE. */
+ SEP, and quoted by the current quotes, if QUOTED is true. */
void
m4_dump_args (m4 *context, m4_obstack *obs, int argc,
- m4_symbol_value **argv, const char *sep, boolean quoted)
+ m4_symbol_value **argv, const char *sep, bool quoted)
{
int i;
size_t len = strlen (sep);
Index: modules/gnu.c
===================================================================
RCS file: /cvsroot/m4/m4/modules/gnu.c,v
retrieving revision 1.31
diff -u -p -u -r1.31 gnu.c
--- modules/gnu.c 15 Aug 2003 14:06:27 -0000 1.31
+++ modules/gnu.c 15 Aug 2003 15:52:07 -0000
@@ -72,21 +72,21 @@ int errno;
function macros blind argmin argmax */
#define builtin_functions \
- BUILTIN(__file__, FALSE, FALSE, 1, 1 ) \
- BUILTIN(__line__, FALSE, FALSE, 1, 1 ) \
- BUILTIN(builtin, FALSE, TRUE, 2, -1 ) \
- BUILTIN(changesyntax, FALSE, TRUE, 1, -1 ) \
- BUILTIN(debugmode, FALSE, FALSE, 1, 2 ) \
- BUILTIN(debugfile, FALSE, FALSE, 1, 2 ) \
- BUILTIN(eregexp, FALSE, TRUE, 3, 4 ) \
- BUILTIN(epatsubst, FALSE, TRUE, 3, 4 ) \
- BUILTIN(esyscmd, FALSE, TRUE, 2, 2 ) \
- BUILTIN(format, FALSE, TRUE, 2, -1 ) \
- BUILTIN(indir, FALSE, TRUE, 2, -1 ) \
- BUILTIN(patsubst, FALSE, TRUE, 3, 4 ) \
- BUILTIN(regexp, FALSE, TRUE, 3, 4 ) \
- BUILTIN(symbols, FALSE, FALSE, 0, -1 ) \
- BUILTIN(syncoutput, FALSE, TRUE, 2, 2 ) \
+ BUILTIN(__file__, false, false, 1, 1 ) \
+ BUILTIN(__line__, false, false, 1, 1 ) \
+ BUILTIN(builtin, false, true, 2, -1 ) \
+ BUILTIN(changesyntax, false, true, 1, -1 ) \
+ BUILTIN(debugmode, false, false, 1, 2 ) \
+ BUILTIN(debugfile, false, false, 1, 2 ) \
+ BUILTIN(eregexp, false, true, 3, 4 ) \
+ BUILTIN(epatsubst, false, true, 3, 4 ) \
+ BUILTIN(esyscmd, false, true, 2, 2 ) \
+ BUILTIN(format, false, true, 2, -1 ) \
+ BUILTIN(indir, false, true, 2, -1 ) \
+ BUILTIN(patsubst, false, true, 3, 4 ) \
+ BUILTIN(regexp, false, true, 3, 4 ) \
+ BUILTIN(symbols, false, false, 0, -1 ) \
+ BUILTIN(syncoutput, false, true, 2, 2 ) \
/* Generate prototypes for each builtin handler function. */
@@ -103,7 +103,7 @@ m4_builtin m4_builtin_table[] =
builtin_functions
#undef BUILTIN
- { 0, 0, FALSE, FALSE, 0, 0 },
+ { 0, 0, false, false, 0, 0 },
};
@@ -275,12 +275,12 @@ m4_regexp_compile (m4 *context, const ch
const char *regexp, int syntax)
{
static struct re_pattern_buffer buf; /* compiled regular expression */
- static boolean buf_initialized = FALSE;
+ static bool buf_initialized = false;
const char *msg; /* error message from re_compile_pattern */
if (!buf_initialized)
{
- buf_initialized = TRUE;
+ buf_initialized = true;
buf.buffer = NULL;
buf.allocated = 0;
buf.fastmap = NULL;
@@ -470,11 +470,11 @@ M4BUILTIN_HANDLER (symbols)
obstack_init (&data_obs);
data.obs = &data_obs;
- m4_dump_symbols (context, &data, argc, argv, FALSE);
+ m4_dump_symbols (context, &data, argc, argv, false);
for (; data.size > 0; --data.size, data.base++)
{
- m4_shipout_string (context, obs, data.base[0], 0, TRUE);
+ m4_shipout_string (context, obs, data.base[0], 0, true);
if (data.size > 1)
obstack_1grow (obs, ',');
}
@@ -498,11 +498,11 @@ M4BUILTIN_HANDLER (syncoutput)
if ( M4ARG (1)[0] == '0'
|| M4ARG (1)[0] == 'n'
|| (M4ARG (1)[0] == 'o' && M4ARG (1)[1] == 'f'))
- m4_set_sync_output_opt (context, FALSE);
+ m4_set_sync_output_opt (context, false);
else if ( M4ARG (1)[0] == '1'
|| M4ARG (1)[0] == 'y'
|| (M4ARG (1)[0] == 'o' && M4ARG (1)[1] == 'n'))
- m4_set_sync_output_opt (context, TRUE);
+ m4_set_sync_output_opt (context, true);
}
}
@@ -555,7 +555,7 @@ M4BUILTIN_HANDLER (format)
**/
M4BUILTIN_HANDLER (__file__)
{
- m4_shipout_string (context, obs, m4_current_file, 0, TRUE);
+ m4_shipout_string (context, obs, m4_current_file, 0, true);
}
Index: modules/import.c
===================================================================
RCS file: /cvsroot/m4/m4/modules/import.c,v
retrieving revision 1.1
diff -u -p -u -r1.1 import.c
--- modules/import.c 12 Aug 2003 15:33:57 -0000 1.1
+++ modules/import.c 15 Aug 2003 15:52:07 -0000
@@ -29,9 +29,9 @@
/* function macros blind minargs maxargs */
#define builtin_functions \
- BUILTIN (import, FALSE, FALSE, 1, 2) \
- BUILTIN (symbol_fail, FALSE, FALSE, 1, 2) \
- BUILTIN (module_fail, FALSE, FALSE, 1, 2)
+ BUILTIN (import, false, false, 1, 2) \
+ BUILTIN (symbol_fail, false, false, 1, 2) \
+ BUILTIN (module_fail, false, false, 1, 2)
#define BUILTIN(handler, macros, blind, min, max) M4BUILTIN(handler)
builtin_functions
@@ -45,13 +45,13 @@ m4_builtin m4_builtin_table[] =
builtin_functions
#undef BUILTIN
- { 0, 0, FALSE, FALSE, 0, 0 },
+ { 0, 0, false, false, 0, 0 },
};
-typedef boolean export_test_func (const char *);
-typedef boolean no_such_func (const char *);
+typedef bool export_test_func (const char *);
+typedef bool no_such_func (const char *);
/**
* import()
Index: modules/load.c
===================================================================
RCS file: /cvsroot/m4/m4/modules/load.c,v
retrieving revision 1.12
diff -u -p -u -r1.12 load.c
--- modules/load.c 26 Jun 2003 14:57:32 -0000 1.12
+++ modules/load.c 15 Aug 2003 15:52:07 -0000
@@ -34,9 +34,9 @@
function macros blind minargs maxargs */
#define builtin_functions \
- BUILTIN(modules, FALSE, FALSE, 1, 1 ) \
- BUILTIN(load, FALSE, TRUE, 2, 2 ) \
- BUILTIN(unload, FALSE, TRUE, 2, 2 ) \
+ BUILTIN(modules, false, false, 1, 1 ) \
+ BUILTIN(load, false, true, 2, 2 ) \
+ BUILTIN(unload, false, true, 2, 2 ) \
/* Generate prototypes for each builtin handler function. */
@@ -53,7 +53,7 @@ m4_builtin m4_builtin_table[] =
builtin_functions
#undef BUILTIN
- { 0, 0, FALSE, FALSE, 0, 0 },
+ { 0, 0, false, false, 0, 0 },
};
@@ -98,7 +98,7 @@ M4BUILTIN_HANDLER (modules)
if (handle)
do
{
- m4_shipout_string (context, obs, m4_get_module_name (handle), 0, TRUE);
+ m4_shipout_string (context, obs, m4_get_module_name (handle), 0, true);
if ((handle = lt_dlhandle_next (handle)))
obstack_1grow (obs, ',');
Index: modules/m4.c
===================================================================
RCS file: /cvsroot/m4/m4/modules/m4.c,v
retrieving revision 1.53
diff -u -p -u -r1.53 m4.c
--- modules/m4.c 15 Aug 2003 14:06:27 -0000 1.53
+++ modules/m4.c 15 Aug 2003 15:52:07 -0000
@@ -59,38 +59,38 @@ extern int errno;
function macros blind minargs maxargs */
#define builtin_functions \
- BUILTIN(changecom, FALSE, FALSE, 1, 3 ) \
- BUILTIN(changequote, FALSE, FALSE, 1, 3 ) \
- BUILTIN(decr, FALSE, TRUE, 2, 2 ) \
- BUILTIN(define, TRUE, TRUE, 2, 3 ) \
- BUILTIN(defn, FALSE, TRUE, 0, -1 ) \
- BUILTIN(divert, FALSE, FALSE, 1, 2 ) \
- BUILTIN(divnum, FALSE, FALSE, 1, 1 ) \
- BUILTIN(dnl, FALSE, FALSE, 1, 1 ) \
- BUILTIN(dumpdef, FALSE, FALSE, 0, -1 ) \
- BUILTIN(errprint, FALSE, FALSE, 0, -1 ) \
- BUILTIN(eval, FALSE, TRUE, 2, 4 ) \
- BUILTIN(ifdef, FALSE, TRUE, 3, 4 ) \
- BUILTIN(ifelse, FALSE, TRUE, -1, -1 ) \
- BUILTIN(include, FALSE, TRUE, 2, 2 ) \
- BUILTIN(incr, FALSE, TRUE, 2, 2 ) \
- BUILTIN(index, FALSE, TRUE, 3, 3 ) \
- BUILTIN(len, FALSE, TRUE, 2, 2 ) \
- BUILTIN(m4exit, FALSE, FALSE, 1, 2 ) \
- BUILTIN(m4wrap, FALSE, FALSE, 0, -1 ) \
- BUILTIN(maketemp, FALSE, TRUE, 2, 2 ) \
- BUILTIN(popdef, FALSE, TRUE, 2, 2 ) \
- BUILTIN(pushdef, TRUE, TRUE, 2, 3 ) \
- BUILTIN(shift, FALSE, FALSE, 0, -1 ) \
- BUILTIN(sinclude, FALSE, TRUE, 2, 2 ) \
- BUILTIN(substr, FALSE, TRUE, 3, 4 ) \
- BUILTIN(syscmd, FALSE, TRUE, 2, 2 ) \
- BUILTIN(sysval, FALSE, FALSE, 0, -1 ) \
- BUILTIN(traceoff, FALSE, FALSE, 0, -1 ) \
- BUILTIN(traceon, FALSE, FALSE, 0, -1 ) \
- BUILTIN(translit, FALSE, TRUE, 3, 4 ) \
- BUILTIN(undefine, FALSE, TRUE, 2, 2 ) \
- BUILTIN(undivert, FALSE, FALSE, 0, -1 ) \
+ BUILTIN(changecom, false, false, 1, 3 ) \
+ BUILTIN(changequote, false, false, 1, 3 ) \
+ BUILTIN(decr, false, true, 2, 2 ) \
+ BUILTIN(define, true, true, 2, 3 ) \
+ BUILTIN(defn, false, true, 0, -1 ) \
+ BUILTIN(divert, false, false, 1, 2 ) \
+ BUILTIN(divnum, false, false, 1, 1 ) \
+ BUILTIN(dnl, false, false, 1, 1 ) \
+ BUILTIN(dumpdef, false, false, 0, -1 ) \
+ BUILTIN(errprint, false, false, 0, -1 ) \
+ BUILTIN(eval, false, true, 2, 4 ) \
+ BUILTIN(ifdef, false, true, 3, 4 ) \
+ BUILTIN(ifelse, false, true, -1, -1 ) \
+ BUILTIN(include, false, true, 2, 2 ) \
+ BUILTIN(incr, false, true, 2, 2 ) \
+ BUILTIN(index, false, true, 3, 3 ) \
+ BUILTIN(len, false, true, 2, 2 ) \
+ BUILTIN(m4exit, false, false, 1, 2 ) \
+ BUILTIN(m4wrap, false, false, 0, -1 ) \
+ BUILTIN(maketemp, false, true, 2, 2 ) \
+ BUILTIN(popdef, false, true, 2, 2 ) \
+ BUILTIN(pushdef, true, true, 2, 3 ) \
+ BUILTIN(shift, false, false, 0, -1 ) \
+ BUILTIN(sinclude, false, true, 2, 2 ) \
+ BUILTIN(substr, false, true, 3, 4 ) \
+ BUILTIN(syscmd, false, true, 2, 2 ) \
+ BUILTIN(sysval, false, false, 0, -1 ) \
+ BUILTIN(traceoff, false, false, 0, -1 ) \
+ BUILTIN(traceon, false, false, 0, -1 ) \
+ BUILTIN(translit, false, true, 3, 4 ) \
+ BUILTIN(undefine, false, true, 2, 2 ) \
+ BUILTIN(undivert, false, false, 0, -1 ) \
#if defined(SIZEOF_LONG_LONG_INT) && SIZEOF_LONG_LONG_INT > 0
@@ -103,7 +103,7 @@ typedef unsigned long int unumber;
#endif
static void include (m4 *context, int argc, m4_symbol_value **argv,
- boolean silent);
+ bool silent);
static int dumpdef_cmp_CB (const void *s1, const void *s2);
static void * set_trace_CB (m4_symbol_table *symtab, const char *ignored,
m4_symbol *symbol, void *userdata);
@@ -128,7 +128,7 @@ m4_builtin m4_builtin_table[] =
builtin_functions
#undef BUILTIN
- { 0, 0, FALSE, FALSE, 0, 0 },
+ { 0, 0, false, false, 0, 0 },
};
@@ -310,7 +310,7 @@ dump_symbol_CB (m4_symbol_table *ignored
symbols, otherwise, only the specified symbols. */
void
m4_dump_symbols (m4 *context, m4_dump_symbol_data *data, int argc,
- m4_symbol_value **argv, boolean complain)
+ m4_symbol_value **argv, bool complain)
{
data->base = (const char **) obstack_base (data->obs);
data->size = 0;
@@ -352,7 +352,7 @@ M4BUILTIN_HANDLER (dumpdef)
const m4_builtin *bp;
data.obs = obs;
- m4_dump_symbols (context, &data, argc, argv, TRUE);
+ m4_dump_symbols (context, &data, argc, argv, true);
for (; data.size > 0; --data.size, data.base++)
{
@@ -401,7 +401,7 @@ M4BUILTIN_HANDLER (defn)
_("Warning: %s: undefined name: %s"),
m4_get_symbol_value_text (argv[0]), name));
else if (m4_is_symbol_text (symbol))
- m4_shipout_string (context, obs, m4_get_symbol_text (symbol), 0, TRUE);
+ m4_shipout_string (context, obs, m4_get_symbol_text (symbol), 0, true);
else if (m4_is_symbol_func (symbol))
m4_push_builtin (m4_get_symbol_value (symbol));
else
@@ -535,7 +535,7 @@ M4BUILTIN_HANDLER (dnl)
output argument is quoted with the current quotes. */
M4BUILTIN_HANDLER (shift)
{
- m4_dump_args (context, obs, argc - 1, argv + 1, ",", TRUE);
+ m4_dump_args (context, obs, argc - 1, argv + 1, ",", true);
}
/* Change the current quotes. The function set_quotes () lives in input.c. */
@@ -562,9 +562,9 @@ M4BUILTIN_HANDLER (changecom)
the input is scanned before being copied to the output. */
/* Generic include function. Include the file given by the first argument,
- if it exists. Complain about inaccesible files iff SILENT is FALSE. */
+ if it exists. Complain about inaccesible files iff SILENT is false. */
static void
-include (m4 *context, int argc, m4_symbol_value **argv, boolean silent)
+include (m4 *context, int argc, m4_symbol_value **argv, bool silent)
{
FILE *fp;
char *name = NULL;
@@ -585,13 +585,13 @@ include (m4 *context, int argc, m4_symbo
/* Include a file, complaining in case of errors. */
M4BUILTIN_HANDLER (include)
{
- include (context, argc, argv, FALSE);
+ include (context, argc, argv, false);
}
/* Include a file, ignoring errors. */
M4BUILTIN_HANDLER (sinclude)
{
- include (context, argc, argv, TRUE);
+ include (context, argc, argv, true);
}
@@ -601,13 +601,13 @@ M4BUILTIN_HANDLER (sinclude)
M4BUILTIN_HANDLER (maketemp)
{
mktemp (M4ARG (1));
- m4_shipout_string (context, obs, M4ARG (1), 0, FALSE);
+ m4_shipout_string (context, obs, M4ARG (1), 0, false);
}
/* Print all arguments on standard error. */
M4BUILTIN_HANDLER (errprint)
{
- m4_dump_args (context, obs, argc, argv, " ", FALSE);
+ m4_dump_args (context, obs, argc, argv, " ", false);
obstack_1grow (obs, '\0');
fputs ((char *) obstack_finish (obs), stderr);
fflush (stderr);
@@ -639,9 +639,9 @@ M4BUILTIN_HANDLER (m4exit)
M4BUILTIN_HANDLER (m4wrap)
{
if (m4_get_no_gnu_extensions_opt (context))
- m4_shipout_string (context, obs, M4ARG (1), 0, FALSE);
+ m4_shipout_string (context, obs, M4ARG (1), 0, false);
else
- m4_dump_args (context, obs, argc, argv, " ", FALSE);
+ m4_dump_args (context, obs, argc, argv, " ", false);
obstack_1grow (obs, '\0');
m4_push_wrapup (obstack_finish (obs));
}
@@ -657,7 +657,7 @@ static void *
set_trace_CB (m4_symbol_table *hash, const char *ignored, m4_symbol *symbol,
void *userdata)
{
- m4_set_symbol_traced (symbol, (boolean) (userdata != NULL));
+ m4_set_symbol_traced (symbol, (bool) (userdata != NULL));
return NULL;
}
@@ -908,7 +908,7 @@ ntoa (number value, int radix)
/* Digits for number to ascii conversions. */
static char const ntoa_digits[] = "0123456789abcdefghijklmnopqrstuvwxyz";
- boolean negative;
+ bool negative;
unumber uvalue;
static char str[256];
char *s = &str[sizeof str];
@@ -917,12 +917,12 @@ ntoa (number value, int radix)
if (value < 0)
{
- negative = TRUE;
+ negative = true;
uvalue = (unumber) -value;
}
else
{
- negative = FALSE;
+ negative = false;
uvalue = (unumber) value;
}
Index: modules/m4.h
===================================================================
RCS file: /cvsroot/m4/m4/modules/m4.h,v
retrieving revision 1.3
diff -u -p -u -r1.3 m4.h
--- modules/m4.h 15 Aug 2003 14:06:27 -0000 1.3
+++ modules/m4.h 15 Aug 2003 15:52:07 -0000
@@ -39,7 +39,7 @@ typedef struct
typedef void m4_sysval_flush_func (m4 *context);
typedef void m4_set_sysval_func (int value);
typedef void m4_dump_symbols_func (m4 *context, m4_dump_symbol_data *data,
- int argc, m4_symbol_value **argv, boolean complain);
+ int argc, m4_symbol_value **argv, bool complain);
typedef const char *m4_expand_ranges_func (const char *s, m4_obstack *obs);
END_C_DECLS
Index: modules/modtest.c
===================================================================
RCS file: /cvsroot/m4/m4/modules/modtest.c,v
retrieving revision 1.8
diff -u -p -u -r1.8 modtest.c
--- modules/modtest.c 12 Aug 2003 15:33:57 -0000 1.8
+++ modules/modtest.c 15 Aug 2003 15:52:07 -0000
@@ -33,7 +33,7 @@
/* function macros blind minargs maxargs */
#define builtin_functions \
- BUILTIN (test, FALSE, FALSE, 1, 1)
+ BUILTIN (test, false, false, 1, 1)
#define BUILTIN(handler, macros, blind, min, max) M4BUILTIN(handler)
builtin_functions
@@ -47,7 +47,7 @@ m4_builtin m4_builtin_table[] =
builtin_functions
#undef BUILTIN
- { 0, 0, FALSE, FALSE, 0, 0 },
+ { 0, 0, false, false, 0, 0 },
};
m4_macro m4_macro_table[] =
@@ -100,10 +100,10 @@ M4BUILTIN_HANDLER (test)
/**
* export_test()
**/
-boolean
+bool
export_test (const char *foo)
{
if (foo)
fprintf (stderr, "%s\n", foo);
- return (boolean) (foo != 0);
+ return (bool) (foo != 0);
}
Index: modules/mpeval.c
===================================================================
RCS file: /cvsroot/m4/m4/modules/mpeval.c,v
retrieving revision 1.13
diff -u -p -u -r1.13 mpeval.c
--- modules/mpeval.c 23 Jul 2003 16:20:50 -0000 1.13
+++ modules/mpeval.c 15 Aug 2003 15:52:07 -0000
@@ -38,7 +38,7 @@
function macros blind minargs maxargs */
#define builtin_functions \
- BUILTIN(mpeval, FALSE, TRUE, 2, 4 ) \
+ BUILTIN(mpeval, false, true, 2, 4 ) \
@@ -92,7 +92,7 @@ m4_builtin m4_builtin_table[] =
builtin_functions
#undef BUILTIN
- { 0, 0, FALSE, FALSE, 0, 0 },
+ { 0, 0, false, false, 0, 0 },
};
Index: modules/perl.c
===================================================================
RCS file: /cvsroot/m4/m4/modules/perl.c,v
retrieving revision 1.10
diff -u -p -u -r1.10 perl.c
--- modules/perl.c 26 Jun 2003 14:57:32 -0000 1.10
+++ modules/perl.c 15 Aug 2003 15:52:07 -0000
@@ -32,7 +32,7 @@
/* function macros blind minargs maxargs */
#define builtin_functions \
- BUILTIN (perleval, FALSE, FALSE, 0, -1 ) \
+ BUILTIN (perleval, false, false, 0, -1 ) \
#define BUILTIN(handler, macros, blind, min, max) M4BUILTIN(handler)
@@ -47,7 +47,7 @@ m4_builtin m4_builtin_table[] =
builtin_functions
#undef BUILTIN
- { 0, 0, FALSE, FALSE, 0, 0 },
+ { 0, 0, false, false, 0, 0 },
};
/* A table for mapping m4 symbol names to simple expansion text. */
@@ -111,8 +111,8 @@ M4BUILTIN_HANDLER (perleval)
if (i > 1)
obstack_1grow (obs, ',');
- val = perl_eval_pv(M4ARG(i), TRUE);
+ val = perl_eval_pv(M4ARG(i), true);
- m4_shipout_string(context, obs, SvPV(val,PL_na), 0, FALSE);
+ m4_shipout_string(context, obs, SvPV(val,PL_na), 0, false);
}
}
Index: modules/shadow.c
===================================================================
RCS file: /cvsroot/m4/m4/modules/shadow.c,v
retrieving revision 1.8
diff -u -p -u -r1.8 shadow.c
--- modules/shadow.c 12 Oct 2001 19:57:29 -0000 1.8
+++ modules/shadow.c 15 Aug 2003 15:52:07 -0000
@@ -30,8 +30,8 @@
/* function macros blind minargs maxargs */
#define builtin_functions \
- BUILTIN (shadow, FALSE, FALSE, 0, -1 ) \
- BUILTIN (test, FALSE, FALSE, 0, -1 ) \
+ BUILTIN (shadow, false, false, 0, -1 ) \
+ BUILTIN (test, false, false, 0, -1 ) \
#define BUILTIN(handler, macros, blind, min, max) M4BUILTIN(handler)
@@ -46,7 +46,7 @@ m4_builtin m4_builtin_table[] =
builtin_functions
#undef BUILTIN
- { 0, 0, FALSE, FALSE, 0, 0 },
+ { 0, 0, false, false, 0, 0 },
};
m4_macro m4_macro_table[] =
Index: modules/stdlib.c
===================================================================
RCS file: /cvsroot/m4/m4/modules/stdlib.c,v
retrieving revision 1.10
diff -u -p -u -r1.10 stdlib.c
--- modules/stdlib.c 26 Jun 2003 14:57:32 -0000 1.10
+++ modules/stdlib.c 15 Aug 2003 15:52:07 -0000
@@ -38,20 +38,20 @@
/* function macros blind minargs maxargs */
#define builtin_functions \
- BUILTIN (getcwd, FALSE, FALSE, 1, 1 ) \
- BUILTIN (getenv, FALSE, TRUE, 2, 2 ) \
- BUILTIN (getlogin, FALSE, FALSE, 1, 1 ) \
- BUILTIN (getpid, FALSE, FALSE, 1, 1 ) \
- BUILTIN (getppid, FALSE, FALSE, 1, 1 ) \
- BUILTIN (getuid, FALSE, FALSE, 1, 1 ) \
- BUILTIN (getpwnam, FALSE, TRUE, 2, 2 ) \
- BUILTIN (getpwuid, FALSE, TRUE, 2, 2 ) \
- BUILTIN (hostname, FALSE, FALSE, 1, 1 ) \
- BUILTIN (rand, FALSE, FALSE, 1, 1 ) \
- BUILTIN (srand, FALSE, FALSE, 1, 2 ) \
- BUILTIN (setenv, FALSE, TRUE, 3, 4 ) \
- BUILTIN (unsetenv, FALSE, TRUE, 2, 2 ) \
- BUILTIN (uname, FALSE, FALSE, 1, 1 ) \
+ BUILTIN (getcwd, false, false, 1, 1 ) \
+ BUILTIN (getenv, false, true, 2, 2 ) \
+ BUILTIN (getlogin, false, false, 1, 1 ) \
+ BUILTIN (getpid, false, false, 1, 1 ) \
+ BUILTIN (getppid, false, false, 1, 1 ) \
+ BUILTIN (getuid, false, false, 1, 1 ) \
+ BUILTIN (getpwnam, false, true, 2, 2 ) \
+ BUILTIN (getpwuid, false, true, 2, 2 ) \
+ BUILTIN (hostname, false, false, 1, 1 ) \
+ BUILTIN (rand, false, false, 1, 1 ) \
+ BUILTIN (srand, false, false, 1, 2 ) \
+ BUILTIN (setenv, false, true, 3, 4 ) \
+ BUILTIN (unsetenv, false, true, 2, 2 ) \
+ BUILTIN (uname, false, false, 1, 1 ) \
#define BUILTIN(handler, macros, blind, min, max) M4BUILTIN(handler);
@@ -66,7 +66,7 @@ m4_builtin m4_builtin_table[] =
builtin_functions
#undef BUILTIN
- { 0, 0, FALSE, FALSE, 0, 0 },
+ { 0, 0, false, false, 0, 0 },
};
/**
@@ -80,7 +80,7 @@ M4BUILTIN_HANDLER (getcwd)
bp = getcwd (buf, sizeof buf);
if (bp != NULL) /* in case of error return null string */
- m4_shipout_string (context, obs, buf, 0, FALSE);
+ m4_shipout_string (context, obs, buf, 0, false);
}
/**
@@ -93,7 +93,7 @@ M4BUILTIN_HANDLER (getenv)
env = getenv (M4ARG (1));
if (env != NULL)
- m4_shipout_string (context, obs, env, 0, FALSE);
+ m4_shipout_string (context, obs, env, 0, false);
}
/**
@@ -148,7 +148,7 @@ M4BUILTIN_HANDLER (getlogin)
login = getlogin ();
if (login != NULL)
- m4_shipout_string (context, obs, login, 0, FALSE);
+ m4_shipout_string (context, obs, login, 0, false);
}
/**
@@ -178,19 +178,19 @@ M4BUILTIN_HANDLER (getpwnam)
if (pw != NULL)
{
- m4_shipout_string (context, obs, pw->pw_name, 0, TRUE);
+ m4_shipout_string (context, obs, pw->pw_name, 0, true);
obstack_1grow (obs, ',');
- m4_shipout_string (context, obs, pw->pw_passwd, 0, TRUE);
+ m4_shipout_string (context, obs, pw->pw_passwd, 0, true);
obstack_1grow (obs, ',');
m4_shipout_int (obs, pw->pw_uid);
obstack_1grow (obs, ',');
m4_shipout_int (obs, pw->pw_gid);
obstack_1grow (obs, ',');
- m4_shipout_string (context, obs, pw->pw_gecos, 0, TRUE);
+ m4_shipout_string (context, obs, pw->pw_gecos, 0, true);
obstack_1grow (obs, ',');
- m4_shipout_string (context, obs, pw->pw_dir, 0, TRUE);
+ m4_shipout_string (context, obs, pw->pw_dir, 0, true);
obstack_1grow (obs, ',');
- m4_shipout_string (context, obs, pw->pw_shell, 0, TRUE);
+ m4_shipout_string (context, obs, pw->pw_shell, 0, true);
}
}
@@ -209,19 +209,19 @@ M4BUILTIN_HANDLER (getpwuid)
if (pw != NULL)
{
- m4_shipout_string (context, obs, pw->pw_name, 0, TRUE);
+ m4_shipout_string (context, obs, pw->pw_name, 0, true);
obstack_1grow (obs, ',');
- m4_shipout_string (context, obs, pw->pw_passwd, 0, TRUE);
+ m4_shipout_string (context, obs, pw->pw_passwd, 0, true);
obstack_1grow (obs, ',');
m4_shipout_int (obs, pw->pw_uid);
obstack_1grow (obs, ',');
m4_shipout_int (obs, pw->pw_gid);
obstack_1grow (obs, ',');
- m4_shipout_string (context, obs, pw->pw_gecos, 0, TRUE);
+ m4_shipout_string (context, obs, pw->pw_gecos, 0, true);
obstack_1grow (obs, ',');
- m4_shipout_string (context, obs, pw->pw_dir, 0, TRUE);
+ m4_shipout_string (context, obs, pw->pw_dir, 0, true);
obstack_1grow (obs, ',');
- m4_shipout_string (context, obs, pw->pw_shell, 0, TRUE);
+ m4_shipout_string (context, obs, pw->pw_shell, 0, true);
}
}
@@ -235,7 +235,7 @@ M4BUILTIN_HANDLER (hostname)
if (gethostname (buf, sizeof buf) < 0)
return;
- m4_shipout_string (context, obs, buf, 0, FALSE);
+ m4_shipout_string (context, obs, buf, 0, false);
}
/**
@@ -273,15 +273,15 @@ M4BUILTIN_HANDLER (uname)
if (uname (&ut) == 0)
{
- m4_shipout_string (context, obs, ut.sysname, 0, TRUE);
+ m4_shipout_string (context, obs, ut.sysname, 0, true);
obstack_1grow (obs, ',');
- m4_shipout_string (context, obs, ut.nodename, 0, TRUE);
+ m4_shipout_string (context, obs, ut.nodename, 0, true);
obstack_1grow (obs, ',');
- m4_shipout_string (context, obs, ut.release, 0, TRUE);
+ m4_shipout_string (context, obs, ut.release, 0, true);
obstack_1grow (obs, ',');
- m4_shipout_string (context, obs, ut.version, 0, TRUE);
+ m4_shipout_string (context, obs, ut.version, 0, true);
obstack_1grow (obs, ',');
- m4_shipout_string (context, obs, ut.machine, 0, TRUE);
+ m4_shipout_string (context, obs, ut.machine, 0, true);
}
}
Index: modules/time.c
===================================================================
RCS file: /cvsroot/m4/m4/modules/time.c,v
retrieving revision 1.10
diff -u -p -u -r1.10 time.c
--- modules/time.c 23 Jul 2003 16:20:50 -0000 1.10
+++ modules/time.c 15 Aug 2003 15:52:07 -0000
@@ -35,16 +35,16 @@
/* function macros blind minargs maxargs */
#define builtin_functions \
- BUILTIN (currenttime, FALSE, FALSE, 1, 1 ) \
- BUILTIN (ctime, FALSE, FALSE, 1, 2 ) \
- BUILTIN (gmtime, FALSE, TRUE, 2, 2 ) \
- BUILTIN (localtime, FALSE, TRUE, 2, 2 ) \
+ BUILTIN (currenttime, false, false, 1, 1 ) \
+ BUILTIN (ctime, false, false, 1, 2 ) \
+ BUILTIN (gmtime, false, true, 2, 2 ) \
+ BUILTIN (localtime, false, true, 2, 2 ) \
#define mktime_functions \
- BUILTIN (mktime, FALSE, TRUE, 7, 8 ) \
+ BUILTIN (mktime, false, true, 7, 8 ) \
#define strftime_functions \
- BUILTIN (strftime, FALSE, TRUE, 3, 3 ) \
+ BUILTIN (strftime, false, true, 3, 3 ) \
#define BUILTIN(handler, macros, blind, min, max) M4BUILTIN(handler)
@@ -71,7 +71,7 @@ m4_builtin m4_builtin_table[] =
# endif
#undef BUILTIN
- { 0, 0, FALSE, FALSE },
+ { 0, 0, false, false },
};
/**
Index: src/main.c
===================================================================
RCS file: /cvsroot/m4/m4/src/main.c,v
retrieving revision 1.48
diff -u -p -u -r1.48 main.c
--- src/main.c 29 Jul 2003 15:57:34 -0000 1.48
+++ src/main.c 15 Aug 2003 15:52:07 -0000
@@ -245,10 +245,10 @@ main (int argc, char *const *argv, char
#endif
if (isatty (STDIN_FILENO))
- m4_set_interactive_opt (context, TRUE);
+ m4_set_interactive_opt (context, true);
if (getenv ("POSIXLY_CORRECT"))
- m4_set_posixly_correct_opt (context, TRUE);
+ m4_set_posixly_correct_opt (context, true);
/* First, we decode the arguments, to size up tables and stuff. */
@@ -299,8 +299,8 @@ main (int argc, char *const *argv, char
break;
case 'G':
- m4_set_no_gnu_extensions_opt (context, TRUE);
- m4_set_posixly_correct_opt (context, TRUE);
+ m4_set_no_gnu_extensions_opt (context, true);
+ m4_set_posixly_correct_opt (context, true);
break;
case 'I':
@@ -326,11 +326,11 @@ main (int argc, char *const *argv, char
break;
case 'P':
- m4_set_prefix_builtins_opt (context, TRUE);
+ m4_set_prefix_builtins_opt (context, true);
break;
case 'Q':
- m4_set_suppress_warnings_opt (context, TRUE);
+ m4_set_suppress_warnings_opt (context, true);
break;
case 'R':
@@ -338,11 +338,11 @@ main (int argc, char *const *argv, char
break;
case 'b':
- m4_set_interactive_opt (context, FALSE);
+ m4_set_interactive_opt (context, false);
break;
case 'c':
- m4_set_discard_comments_opt (context, TRUE);
+ m4_set_discard_comments_opt (context, true);
break;
case 'd':
@@ -355,7 +355,7 @@ main (int argc, char *const *argv, char
break;
case 'e':
- m4_set_interactive_opt (context, TRUE);
+ m4_set_interactive_opt (context, true);
break;
case 'l':
@@ -370,7 +370,7 @@ main (int argc, char *const *argv, char
break;
case 's':
- m4_set_sync_output_opt (context, TRUE);
+ m4_set_sync_output_opt (context, true);
break;
}
- FYI: 43-gary-use-c99-bool.patch,
Gary V. Vaughan <=