[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: Ansification
From: |
Gary V. Vaughan |
Subject: |
FYI: Ansification |
Date: |
Sun, 26 Aug 2001 15:09:21 +0100 |
User-agent: |
Mutt/1.2.5i |
--
())_. 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__/
diff -rub ../m4/ChangeLog ./ChangeLog
--- ../m4/ChangeLog Mon Aug 20 13:07:59 2001
+++ ./ChangeLog Mon Aug 20 13:03:45 2001
@@ -1,3 +1,25 @@
+2001-08-20 Gary V. Vaughan <address@hidden>
+
+ * m4/system.h: Remove M4_PARAMS macro and all users. Remove
+ VOID macro and all users.
+ * m4/m4module.h: Ansify function prototypes and headers.
+ * m4/builtin.c: Ditto.
+ * m4/evalparse.c: Ditto.
+ * m4/input.c: Ditto.
+ * m4/macro.c: Ditto.
+ * m4/module.c: Ditto.
+ * m4/output.c: Ditto.
+ * m4/path.c: Ditto.
+ * m4/symtab.c: Ditto.
+ * m4/utility.c: Ditto.
+ * modules/format.c: Ditto.
+ * modules/gnu.c: Ditto.
+ * modules/m4.c: Ditto.
+ * modules/mpeval.c: Ditto.
+ * src/freeze.c: Ditto.
+ * src/m4.h: Ditto.
+ * src/main.c: Ditto.
+
2001-08-19 Gary V. Vaughan <address@hidden>
* config/debug.m4 (M4_AC_CHECK_DEBUGGING): Cleaned up. Don't test
diff -rub ../m4/m4/builtin.c ./m4/builtin.c
--- ../m4/m4/builtin.c Sun Aug 19 11:35:58 2001
+++ ./m4/builtin.c Mon Aug 20 11:42:46 2001
@@ -31,9 +31,7 @@
/* Find the builtin, which has NAME. If BP argument is supplied
then search only in table BP. */
const m4_builtin *
-m4_builtin_find_by_name (bp, name)
- const m4_builtin *bp;
- const char *name;
+m4_builtin_find_by_name (const m4_builtin *bp, const char *name)
{
lt_dlhandle handle = NULL;
@@ -53,9 +51,7 @@
}
const m4_builtin *
-m4_builtin_find_by_func (bp, func)
- const m4_builtin *bp;
- m4_builtin_func *func;
+m4_builtin_find_by_func (const m4_builtin *bp, m4_builtin_func *func)
{
lt_dlhandle handle = NULL;
@@ -79,12 +75,9 @@
BP. MODE is SYMBOL_INSERT or SYMBOL_PUSHDEF. TRACED defines whether
NAME is to be traced. */
void
-m4_builtin_define (handle, name, bp, mode, traced)
- const lt_dlhandle handle;
- const char *name;
- const m4_builtin *bp;
- m4_symbol_lookup mode;
- boolean traced;
+m4_builtin_define (const lt_dlhandle handle, const char *name,
+ const m4_builtin *bp, m4_symbol_lookup mode,
+ boolean traced)
{
m4_symbol *symbol;
@@ -104,9 +97,8 @@
}
void
-m4_builtin_table_install (handle, table)
- const lt_dlhandle handle;
- const m4_builtin *table;
+m4_builtin_table_install (const lt_dlhandle handle,
+ const m4_builtin *table)
{
const m4_builtin *bp;
char *string;
@@ -128,11 +120,8 @@
TEXT. MODE destinguishes between the "define" and the "pushdef" case.
It is also used from main (). */
void
-m4_macro_define (handle, name, text, mode)
- const lt_dlhandle handle;
- const char *name;
- const char *text;
- m4_symbol_lookup mode;
+m4_macro_define (const lt_dlhandle handle, const char *name,
+ const char *text, m4_symbol_lookup mode)
{
m4_symbol *symbol;
@@ -154,9 +143,7 @@
}
void
-m4_macro_table_install (handle, table)
- const lt_dlhandle handle;
- const m4_macro *table;
+m4_macro_table_install (const lt_dlhandle handle, const m4_macro *table)
{
const m4_macro *mp;
diff -rub ../m4/m4/evalparse.c ./m4/evalparse.c
--- ../m4/m4/evalparse.c Sun Aug 19 11:35:58 2001
+++ ./m4/evalparse.c Mon Aug 20 11:55:43 2001
@@ -76,21 +76,21 @@
}
eval_error;
-static eval_error logical_or_term M4_PARAMS((eval_token, number *));
-static eval_error logical_and_term M4_PARAMS((eval_token, number *));
-static eval_error or_term M4_PARAMS((eval_token, number *));
-static eval_error xor_term M4_PARAMS((eval_token, number *));
-static eval_error and_term M4_PARAMS((eval_token, number *));
-static eval_error not_term M4_PARAMS((eval_token, number *));
-static eval_error logical_not_term M4_PARAMS((eval_token, number *));
-static eval_error cmp_term M4_PARAMS((eval_token, number *));
-static eval_error shift_term M4_PARAMS((eval_token, number *));
-static eval_error add_term M4_PARAMS((eval_token, number *));
-static eval_error mult_term M4_PARAMS((eval_token, number *));
-static eval_error exp_term M4_PARAMS((eval_token, number *));
-static eval_error unary_term M4_PARAMS((eval_token, number *));
-static eval_error simple_term M4_PARAMS((eval_token, number *));
-static void numb_pow M4_PARAMS((number *x, const number *y));
+static eval_error logical_or_term (eval_token, number *);
+static eval_error logical_and_term (eval_token, number *);
+static eval_error or_term (eval_token, number *);
+static eval_error xor_term (eval_token, number *);
+static eval_error and_term (eval_token, number *);
+static eval_error not_term (eval_token, number *);
+static eval_error logical_not_term (eval_token, number *);
+static eval_error cmp_term (eval_token, number *);
+static eval_error shift_term (eval_token, number *);
+static eval_error add_term (eval_token, number *);
+static eval_error mult_term (eval_token, number *);
+static eval_error exp_term (eval_token, number *);
+static eval_error unary_term (eval_token, number *);
+static eval_error simple_term (eval_token, number *);
+static void numb_pow (number *x, const number *y);
diff -rub ../m4/m4/input.c ./m4/input.c
--- ../m4/m4/input.c Sun Aug 19 11:35:58 2001
+++ ./m4/input.c Mon Aug 20 12:07:03 2001
@@ -141,32 +141,32 @@
# include "regex.h"
#endif
-static void check_use_macro_escape M4_PARAMS((void));
-static int file_peek M4_PARAMS((void));
-static int file_read M4_PARAMS((void));
-static void file_unget M4_PARAMS((int ch));
-static void file_clean M4_PARAMS((void));
-static void init_macro_token M4_PARAMS((m4_token_data *td));
-static int macro_peek M4_PARAMS((void));
-static int macro_read M4_PARAMS((void));
-static int match_input M4_PARAMS((const unsigned char *s));
-static int next_char M4_PARAMS((void));
-static void pop_input M4_PARAMS((void));
-static void set_syntax_internal M4_PARAMS((int code, int ch));
-static int single_peek M4_PARAMS((void));
-static int single_read M4_PARAMS((void));
-static int string_peek M4_PARAMS((void));
-static int string_read M4_PARAMS((void));
-static void string_unget M4_PARAMS((int ch));
-static void unget_input M4_PARAMS((int ch));
-static void unset_syntax_attribute M4_PARAMS((int code, int ch));
+static void check_use_macro_escape (void);
+static int file_peek (void);
+static int file_read (void);
+static void file_unget (int ch);
+static void file_clean (void);
+static void init_macro_token (m4_token_data *td);
+static int macro_peek (void);
+static int macro_read (void);
+static int match_input (const unsigned char *s);
+static int next_char (void);
+static void pop_input (void);
+static void set_syntax_internal (int code, int ch);
+static int single_peek (void);
+static int single_read (void);
+static int string_peek (void);
+static int string_read (void);
+static void string_unget (int ch);
+static void unget_input (int ch);
+static void unset_syntax_attribute (int code, int ch);
struct input_funcs
{
- int (*peek_func) M4_PARAMS((void)); /* function to peek input */
- int (*read_func) M4_PARAMS((void)); /* function to read input */
- void (*unget_func) M4_PARAMS((int)); /* function to unread input */
- void (*clean_func) M4_PARAMS((void)); /* function to clean up */
+ int (*peek_func) (void); /* function to peek input */
+ int (*read_func) (void); /* function to read input */
+ void (*unget_func) (int); /* function to unread input */
+ void (*clean_func) (void); /* function to clean up */
};
struct input_block
@@ -284,7 +284,7 @@
alone is taken as belonging to the line it ends, and the current
line number is not incremented until the next character is read. */
static int
-file_peek ()
+file_peek (void)
{
int ch;
@@ -297,7 +297,7 @@
}
static int
-file_read ()
+file_read (void)
{
int ch;
@@ -326,7 +326,7 @@
}
static void
-file_clean ()
+file_clean (void)
{
if (debug_level & M4_DEBUG_TRACE_INPUT)
M4_DEBUG_MESSAGE2 (_("Input reverted to %s, line %d"),
@@ -346,9 +346,7 @@
};
void
-m4_push_file (fp, title)
- FILE *fp;
- const char *title;
+m4_push_file (FILE *fp, const char *title);
{
input_block *i;
@@ -383,7 +381,7 @@
next is non-NULL, this push invalidates a call to push_string_init (),
whose storage are consequentely released. */
static int
-macro_peek ()
+macro_peek (void)
{
if (isp->u.u_m.read == TRUE)
return CHAR_RETRY;
@@ -392,7 +390,7 @@
}
static int
-macro_read ()
+macro_read (void)
{
if (isp->u.u_m.read == TRUE)
return CHAR_RETRY;
@@ -406,10 +404,8 @@
};
void
-m4_push_macro (func, handle, traced)
- m4_builtin_func *func;
- lt_dlhandle handle;
- boolean traced;
+m4_push_macro (m4_builtin_func *func, lt_dlhandle handle,
+ boolean traced);
{
input_block *i;
@@ -434,13 +430,13 @@
/* Push a single character on to the input stack. */
static int
-single_peek ()
+single_peek (void)
{
return isp->u.u_c.ch;
}
static int
-single_read ()
+single_read (void)
{
int ch = isp->u.u_c.ch;
@@ -455,8 +451,7 @@
};
void
-m4_push_single (ch)
- int ch;
+m4_push_single (int ch)
{
input_block *i;
@@ -480,7 +475,7 @@
/* First half of push_string (). The pointer next points to the new
input_block. */
static int
-string_peek ()
+string_peek (void)
{
int ch = *isp->u.u_s.current;
@@ -488,7 +483,7 @@
}
static int
-string_read ()
+string_read (void)
{
int ch = *isp->u.u_s.current++;
@@ -497,8 +492,7 @@
}
static void
-string_unget (ch)
- int ch;
+string_unget (int ch)
{
if (isp->u.u_s.current > isp->u.u_s.start)
*--isp->u.u_s.current = ch;
@@ -511,7 +505,7 @@
};
struct obstack *
-m4_push_string_init ()
+m4_push_string_init (void)
{
if (next != NULL)
{
@@ -535,7 +529,7 @@
release the memory used for the object. */
const char *
-m4_push_string_finish ()
+m4_push_string_finish (void)
{
const char *ret = NULL;
@@ -563,8 +557,7 @@
Push_wrapup should be done as push_string (), but this will suffice, as
long as arguments to m4_m4wrap () are moderate in size. */
void
-m4_push_wrapup (s)
- const char *s;
+m4_push_wrapup (const char *s)
{
input_block *i = (input_block *) obstack_alloc (&wrapup_stack,
sizeof (struct input_block));
@@ -584,7 +577,7 @@
reset to the saved values before the memory for the input_block are
released. */
static void
-pop_input ()
+pop_input (void)
{
input_block *tmp = isp->prev;
@@ -616,8 +609,7 @@
/* When a MACRO token is seen, next_token () uses init_macro_token
to retrieve the value of the function pointer. */
static void
-init_macro_token (td)
- m4_token_data *td;
+init_macro_token (m4_token_data *td)
{
if (isp->funcs->read_func != macro_read)
{
@@ -637,10 +629,10 @@
next_char () is used to read and advance the input to the next
character. */
static int
-next_char ()
+next_char (void)
{
int ch;
- int (*f) M4_PARAMS((void));
+ int (*f) (void);
while (1)
{
@@ -672,10 +664,10 @@
the input stream. At any given time, it reads from the input_block
on the top of the current input stack. */
int
-m4_peek_input ()
+m4_peek_input (void)
{
int ch;
- int (*f) M4_PARAMS((void));
+ int (*f) (void);
while (1)
{
@@ -705,8 +697,7 @@
/* The function unget_input () puts back a character on the input
stack, using an existing input_block if possible. */
static void
-unget_input (ch)
- int ch;
+unget_input (int ch)
{
if (isp != NULL && isp->funcs->unget_func != NULL)
(*isp->funcs->unget_func)(ch);
@@ -717,7 +708,7 @@
/* skip_line () simply discards all immediately following characters, upto
the first newline. It is only used from m4_dnl (). */
void
-m4_skip_line ()
+m4_skip_line (void)
{
int ch;
@@ -736,8 +727,7 @@
All strings herein should be unsigned. Otherwise sign-extension
of individual chars might break quotes with 8-bit chars in it. */
static int
-match_input (s)
- const unsigned char *s;
+match_input (const unsigned char *s)
{
int n; /* number of characters matched */
int ch; /* input character */
@@ -779,11 +769,11 @@
/* Inititialise input stacks, and quote/comment characters. */
-static void set_syntax_internal M4_PARAMS((int code, int ch));
-static void unset_syntax_attribute M4_PARAMS((int code, int ch));
+static void set_syntax_internal (int code, int ch);
+static void unset_syntax_attribute (int code, int ch);
void
-m4_input_init ()
+m4_input_init (void)
{
m4_current_file = _("NONE");
m4_current_line = 0;
@@ -826,7 +816,7 @@
}
void
-m4_syntax_init ()
+m4_syntax_init (void)
{
int ch;
@@ -857,8 +847,7 @@
}
int
-m4_syntax_code (ch)
- char ch;
+m4_syntax_code (char ch)
{
int code;
@@ -891,7 +880,7 @@
}
static void
-check_use_macro_escape ()
+check_use_macro_escape (void)
{
int ch;
@@ -907,9 +896,7 @@
m4_changecom () and m4_changequote (). Both functions overrides the
syntax_table to maintain compatibility. */
void
-m4_set_quotes (lq, rq)
- const char *lq;
- const char *rq;
+m4_set_quotes (const char *lq, const char *rq)
{
int ch;
for (ch = 256; --ch >= 0; ) /* changequote overrides syntax_table */
@@ -937,9 +924,7 @@
}
void
-m4_set_comment (bc, ec)
- const char *bc;
- const char *ec;
+m4_set_comment (const char *bc, const char *ec)
{
int ch;
for (ch = 256; --ch >= 0; ) /* changecom overrides syntax_table */
@@ -968,9 +953,7 @@
/* Functions to manipulate the syntax table. */
static void
-set_syntax_internal (code, ch)
- int code;
- int ch;
+set_syntax_internal (int code, int ch)
{
if (code & M4_SYNTAX_MASKS)
m4_syntax_table[ch] |= code;
@@ -985,9 +968,7 @@
}
static void
-unset_syntax_attribute (code, ch)
- int code;
- int ch;
+unset_syntax_attribute (int code, int ch)
{
if (code & M4_SYNTAX_MASKS)
m4_syntax_table[ch] &= ~code;
@@ -1000,9 +981,7 @@
}
void
-m4_set_syntax (key, chars)
- char key;
- const unsigned char *chars;
+m4_set_syntax (char key, const unsigned char *chars)
{
int ch, code;
@@ -1029,8 +1008,7 @@
#ifdef ENABLE_CHANGEWORD
void
-m4_set_word_regexp (regexp)
- const char *regexp;
+m4_set_word_regexp (const char *regexp)
{
int i;
char test[2];
@@ -1084,8 +1062,7 @@
The storage pointed to by the fields in TD is therefore subject to
change the next time next_token () is called. */
m4_token_t
-m4_next_token (td)
- m4_token_data *td;
+m4_next_token (m4_token_data *td)
{
int ch;
int quote_level;
@@ -1343,13 +1320,10 @@
#ifdef DEBUG_INPUT
-static void lex_debug M4_PARAMS((void));
+static void lex_debug (void);
int
-m4_print_token (s, t, td)
- const char *s;
- m4_token_t t;
- m4_token_data *td;
+m4_print_token (const char *s, m4_token_t t, m4_token_data *td)
{
fprintf (stderr, "%s: ", s);
switch (t)
@@ -1386,7 +1360,7 @@
}
static void
-lex_debug ()
+lex_debug (void)
{
m4_token_t t;
m4_token_data td;
diff -rub ../m4/m4/m4module.h ./m4/m4module.h
--- ../m4/m4/m4module.h Sun Aug 19 11:35:58 2001
+++ ./m4/m4module.h Mon Aug 20 11:52:20 2001
@@ -39,9 +39,8 @@
typedef struct m4_module_data m4_module_data;
typedef struct m4_token_data m4_token_data;
-typedef void m4_builtin_func M4_PARAMS((struct obstack *, int,
- struct m4_token_data **));
-typedef VOID *m4_module_func M4_PARAMS((const char *));
+typedef void m4_builtin_func (struct obstack *, int, struct m4_token_data **);
+typedef void *m4_module_func (const char *);
typedef void m4_hack_symbol ();
@@ -74,45 +73,45 @@
} m4_builtin;
-extern void m4_module_init M4_PARAMS((void));
-extern lt_dlhandle m4_module_load M4_PARAMS((const char*, struct obstack*));
-extern void m4_module_unload M4_PARAMS((const char*, struct obstack*));
-extern lt_dlhandle m4_module_open M4_PARAMS((const char*, struct obstack*));
-extern void m4_module_close M4_PARAMS((lt_dlhandle, struct obstack*));
-extern void m4_module_close_all M4_PARAMS((struct obstack*));
-
-extern const char *m4_module_name M4_PARAMS((lt_dlhandle));
-extern m4_builtin *m4_module_builtins M4_PARAMS((lt_dlhandle));
-extern m4_macro *m4_module_macros M4_PARAMS((lt_dlhandle));
-
-extern lt_dlhandle m4_module_find_by_builtin M4_PARAMS((const m4_builtin*));
-
-
-extern void m4_macro_define M4_PARAMS((const lt_dlhandle,
- const char *, const char *, m4_symbol_lookup));
-extern void m4_macro_table_install M4_PARAMS((
- const lt_dlhandle, const m4_macro *));
+extern void m4_module_init (void);
+extern lt_dlhandle m4_module_load (const char*, struct obstack*);
+extern void m4_module_unload (const char*, struct obstack*);
+extern lt_dlhandle m4_module_open (const char*, struct obstack*);
+extern void m4_module_close (lt_dlhandle, struct obstack*);
+extern void m4_module_close_all (struct obstack*);
+
+extern const char *m4_module_name (lt_dlhandle);
+extern m4_builtin *m4_module_builtins (lt_dlhandle);
+extern m4_macro *m4_module_macros (lt_dlhandle);
+
+extern lt_dlhandle m4_module_find_by_builtin (const m4_builtin*);
+
+
+extern void m4_macro_define (const lt_dlhandle,
+ const char *, const char *, m4_symbol_lookup);
+extern void m4_macro_table_install (
+ const lt_dlhandle, const m4_macro *);
-extern void m4_builtin_define M4_PARAMS((const lt_dlhandle,
+extern void m4_builtin_define (const lt_dlhandle,
const char *, const m4_builtin *,
- m4_symbol_lookup, boolean));
-extern void m4_builtin_table_install M4_PARAMS((
- const lt_dlhandle, const m4_builtin *));
-
-extern const m4_builtin *m4_builtin_find_by_name M4_PARAMS((
- const m4_builtin *, const char *));
-extern const m4_builtin *m4_builtin_find_by_func M4_PARAMS((
- const m4_builtin *, m4_builtin_func *));
+ m4_symbol_lookup, boolean);
+extern void m4_builtin_table_install (
+ const lt_dlhandle, const m4_builtin *);
+
+extern const m4_builtin *m4_builtin_find_by_name (
+ const m4_builtin *, const char *);
+extern const m4_builtin *m4_builtin_find_by_func (
+ const m4_builtin *, m4_builtin_func *);
extern m4_symbol **m4_symtab;
-extern void m4_symtab_init M4_PARAMS((void));
-extern m4_symbol *m4_lookup_symbol M4_PARAMS((const char *,
- m4_symbol_lookup));
-extern void m4_hack_all_symbols M4_PARAMS((m4_hack_symbol *,
- const char *));
-extern void m4_remove_table_reference_symbols M4_PARAMS((
- m4_builtin *, m4_macro *));
+extern void m4_symtab_init (void);
+extern m4_symbol *m4_lookup_symbol (const char *,
+ m4_symbol_lookup);
+extern void m4_hack_all_symbols (m4_hack_symbol *,
+ const char *);
+extern void m4_remove_table_reference_symbols (
+ m4_builtin *, m4_macro *);
/* Various different token types. */
@@ -133,21 +132,21 @@
M4_TOKEN_FUNC
} m4_token_data_t;
-typedef void m4_module_init_func M4_PARAMS((lt_dlhandle, struct obstack*));
-typedef void m4_module_finish_func M4_PARAMS((lt_dlhandle, struct obstack*));
+typedef void m4_module_init_func (lt_dlhandle, struct obstack*);
+typedef void m4_module_finish_func (lt_dlhandle, struct obstack*);
-extern m4_token_data_t m4_token_data_type M4_PARAMS((m4_token_data*));
-extern char *m4_token_data_text M4_PARAMS((m4_token_data*));
-extern char *m4_token_data_orig_text M4_PARAMS((m4_token_data*));
-extern m4_builtin_func *m4_token_data_func M4_PARAMS((m4_token_data*));
-extern boolean m4_token_data_func_traced M4_PARAMS((m4_token_data*));
+extern m4_token_data_t m4_token_data_type (m4_token_data*);
+extern char *m4_token_data_text (m4_token_data*);
+extern char *m4_token_data_orig_text (m4_token_data*);
+extern m4_builtin_func *m4_token_data_func (m4_token_data*);
+extern boolean m4_token_data_func_traced (m4_token_data*);
#define M4ARG(i) (argc > (i) ? m4_token_data_text (argv[i]) : "")
#define M4BUILTIN(name) \
static void CONC(builtin_, name) \
- M4_PARAMS((struct obstack *, int , m4_token_data **));
+ (struct obstack *, int , m4_token_data **);
#define M4BUILTIN_HANDLER(name) \
static void CONC(builtin_, name) (obs, argc, argv) \
@@ -195,12 +194,12 @@
#define DEF_BCOMM "#"
#define DEF_ECOMM "\n"
-boolean m4_bad_argc M4_PARAMS((m4_token_data *, int, int, int));
-const char *m4_skip_space M4_PARAMS((const char *));
-boolean m4_numeric_arg M4_PARAMS((m4_token_data *, const char *, int *));
-void m4_shipout_int M4_PARAMS((struct obstack *, int));
-void m4_shipout_string M4_PARAMS((struct obstack*, const char*, int, boolean));
-void m4_dump_args M4_PARAMS((struct obstack *obs, int argc, m4_token_data
**argv, const char *sep, boolean quoted));
+boolean m4_bad_argc (m4_token_data *, int, int, int);
+const char *m4_skip_space (const char *);
+boolean m4_numeric_arg (m4_token_data *, const char *, int *);
+void m4_shipout_int (struct obstack *, int);
+void m4_shipout_string (struct obstack*, const char*, int, boolean);
+void m4_dump_args (struct obstack *obs, int argc, m4_token_data **argv, const
char *sep, boolean quoted);
M4_SCOPE FILE *m4_debug;
@@ -293,25 +292,25 @@
} \
while (0)
-void m4_debug_init M4_PARAMS((void));
-int m4_debug_decode M4_PARAMS((const char *));
-void m4_debug_flush_files M4_PARAMS((void));
-boolean m4_debug_set_output M4_PARAMS((const char *));
-void m4_debug_message_prefix M4_PARAMS((void));
-
-void m4_trace_prepre M4_PARAMS((const char *, int));
-void m4_trace_pre M4_PARAMS((const char *, int, int, m4_token_data **));
-void m4_trace_post M4_PARAMS((const char *, int, int, m4_token_data **,
- const char *));
+void m4_debug_init (void);
+int m4_debug_decode (const char *);
+void m4_debug_flush_files (void);
+boolean m4_debug_set_output (const char *);
+void m4_debug_message_prefix (void);
+
+void m4_trace_prepre (const char *, int);
+void m4_trace_pre (const char *, int, int, m4_token_data **);
+void m4_trace_post (const char *, int, int, m4_token_data **,
+ const char *);
/* Exit code from last "syscmd" command. */
M4_SCOPE int m4_sysval;
M4_SCOPE int m4_expansion_level;
-const char *m4_expand_ranges M4_PARAMS((const char *s, struct obstack *obs));
-void m4_expand_input M4_PARAMS((void));
-void m4_call_macro M4_PARAMS((m4_symbol *, int, m4_token_data **, struct
obstack *));
-void m4_process_macro M4_PARAMS((struct obstack *obs, m4_symbol *symbol, int
argc, m4_token_data **argv));
+const char *m4_expand_ranges (const char *s, struct obstack *obs);
+void m4_expand_input (void);
+void m4_call_macro (m4_symbol *, int, m4_token_data **, struct obstack *);
+void m4_process_macro (struct obstack *obs, m4_symbol *symbol, int argc,
m4_token_data **argv);
@@ -376,45 +375,45 @@
M4_SCOPE const char *m4_current_file;
M4_SCOPE int m4_current_line;
-extern int m4_syntax_code M4_PARAMS((char ch));
-extern void m4_input_init M4_PARAMS((void));
-extern void m4_syntax_init M4_PARAMS((void));
-extern int m4_peek_input M4_PARAMS((void));
-extern m4_token_t m4_next_token M4_PARAMS((m4_token_data *));
-extern void m4_skip_line M4_PARAMS((void));
+extern int m4_syntax_code (char ch);
+extern void m4_input_init (void);
+extern void m4_syntax_init (void);
+extern int m4_peek_input (void);
+extern m4_token_t m4_next_token (m4_token_data *);
+extern void m4_skip_line (void);
/* push back input */
-extern void m4_push_file M4_PARAMS((FILE *, const char *));
-extern void m4_push_single M4_PARAMS((int ch));
-extern void m4_push_macro M4_PARAMS((m4_builtin_func *, lt_dlhandle,
- boolean));
-extern struct obstack *m4_push_string_init M4_PARAMS((void));
-extern const char *m4_push_string_finish M4_PARAMS((void));
-extern void m4_push_wrapup M4_PARAMS((const char *));
-extern boolean m4_pop_wrapup M4_PARAMS((void));
-
-extern void m4_set_quotes M4_PARAMS((const char *, const char *));
-extern void m4_set_comment M4_PARAMS((const char *, const char *));
-extern void m4_set_syntax M4_PARAMS((char, const unsigned char *));
+extern void m4_push_file (FILE *, const char *);
+extern void m4_push_single (int ch);
+extern void m4_push_macro (m4_builtin_func *, lt_dlhandle,
+ boolean);
+extern struct obstack *m4_push_string_init (void);
+extern const char *m4_push_string_finish (void);
+extern void m4_push_wrapup (const char *);
+extern boolean m4_pop_wrapup (void);
+
+extern void m4_set_quotes (const char *, const char *);
+extern void m4_set_comment (const char *, const char *);
+extern void m4_set_syntax (char, const unsigned char *);
#ifdef ENABLE_CHANGEWORD
-extern void m4_set_word_regexp M4_PARAMS((const char *));
+extern void m4_set_word_regexp (const char *);
#endif
M4_SCOPE int m4_current_diversion;
M4_SCOPE int m4_output_current_line;
-extern void m4_output_init M4_PARAMS((void));
-extern void m4_shipout_text M4_PARAMS((struct obstack *, const char *,
int));
-extern void m4_make_diversion M4_PARAMS((int));
-extern void m4_insert_diversion M4_PARAMS((int));
-extern void m4_insert_file M4_PARAMS((FILE *));
-extern void m4_freeze_diversions M4_PARAMS((FILE *));
-extern void m4_undivert_all M4_PARAMS((void));
-
-extern void m4_include_init M4_PARAMS((void));
-extern void m4_include_env_init M4_PARAMS((void));
-extern void m4_add_include_directory M4_PARAMS((const char *));
-extern FILE *m4_path_search M4_PARAMS((const char *, char **));
+extern void m4_output_init (void);
+extern void m4_shipout_text (struct obstack *, const char *, int);
+extern void m4_make_diversion (int);
+extern void m4_insert_diversion (int);
+extern void m4_insert_file (FILE *);
+extern void m4_freeze_diversions (FILE *);
+extern void m4_undivert_all (void);
+
+extern void m4_include_init (void);
+extern void m4_include_env_init (void);
+extern void m4_add_include_directory (const char *);
+extern FILE *m4_path_search (const char *, char **);
/* These are for other search paths */
@@ -434,9 +433,9 @@
int max_length; /* length of longest directory name */
};
-extern struct m4_search_path_info *m4_search_path_info_new M4_PARAMS((void));
-extern void m4_search_path_env_init M4_PARAMS((struct m4_search_path_info
*, char *, boolean));
-extern void m4_search_path_add M4_PARAMS((struct m4_search_path_info *,
const char *));
+extern struct m4_search_path_info *m4_search_path_info_new (void);
+extern void m4_search_path_env_init (struct m4_search_path_info *, char *,
boolean);
+extern void m4_search_path_add (struct m4_search_path_info *, const char *);
/* The structure dump_symbol_data is used to pass the information needed
@@ -449,20 +448,20 @@
int size; /* size of table */
};
-extern void m4_dump_symbol M4_PARAMS((m4_symbol *symbol, struct
m4_dump_symbol_data *data));
-extern void m4_dump_symbols M4_PARAMS((struct m4_dump_symbol_data *data, int
argc, m4_token_data **argv, boolean complain));
+extern void m4_dump_symbol (m4_symbol *symbol, struct m4_dump_symbol_data
*data);
+extern void m4_dump_symbols (struct m4_dump_symbol_data *data, int argc,
m4_token_data **argv, boolean complain);
/* --- EXPRESSION EVALUATION --- */
-typedef boolean (*m4_eval_func) M4_PARAMS((struct obstack *obs,
- const char *expr, const int radix, int min));
+typedef boolean (*m4_eval_func) (struct obstack *obs,
+ const char *expr, const int radix, int min);
-extern boolean m4_evaluate M4_PARAMS((struct obstack *obs,
- const char *, const int radix, int min));
-extern void m4_do_eval M4_PARAMS((struct obstack *obs, int argc, m4_token_data
**argv, m4_eval_func func));
+extern boolean m4_evaluate (struct obstack *obs,
+ const char *, const int radix, int min);
+extern void m4_do_eval (struct obstack *obs, int argc, m4_token_data **argv,
m4_eval_func func);
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free xfree
diff -rub ../m4/m4/macro.c ./m4/macro.c
--- ../m4/m4/macro.c Sun Aug 19 11:35:58 2001
+++ ./m4/macro.c Mon Aug 20 15:02:23 2001
@@ -23,8 +23,8 @@
#include "m4.h"
#include "m4private.h"
-static void expand_macro M4_PARAMS((m4_symbol *));
-static void expand_token M4_PARAMS((struct obstack *, m4_token_t,
m4_token_data *));
+static void expand_macro (m4_symbol *);
+static void expand_token (struct obstack *, m4_token_t, m4_token_data *);
/* Current recursion level in expand_macro (). */
M4_GLOBAL_DATA int m4_expansion_level = 0;
@@ -197,8 +197,8 @@
M4_TOKEN_DATA_TYPE (&td) = M4_TOKEN_TEXT;
M4_TOKEN_DATA_TEXT (&td) = SYMBOL_NAME (symbol);
- tdp = (m4_token_data *) obstack_copy (arguments, (VOID *) &td, sizeof (td));
- obstack_grow (argptr, (VOID *) &tdp, sizeof (tdp));
+ tdp = (m4_token_data *) obstack_copy (arguments, (void *) &td, sizeof (td));
+ obstack_grow (argptr, (void *) &tdp, sizeof (tdp));
ch = m4_peek_input ();
if (M4_IS_OPEN(ch))
@@ -214,8 +214,8 @@
M4_TOKEN_DATA_TEXT (&td) = "";
}
tdp = (m4_token_data *)
- obstack_copy (arguments, (VOID *) &td, sizeof (td));
- obstack_grow (argptr, (VOID *) &tdp, sizeof (tdp));
+ obstack_copy (arguments, (void *) &td, sizeof (td));
+ obstack_grow (argptr, (void *) &tdp, sizeof (tdp));
}
while (more_args);
}
@@ -313,11 +313,8 @@
definition, giving the expansion text. ARGC and ARGV are the arguments,
as usual. */
void
-m4_process_macro (obs, symbol, argc, argv)
- struct obstack *obs;
- m4_symbol *symbol;
- int argc;
- m4_token_data **argv;
+m4_process_macro (struct obstack *obs, m4_symbol *symbol, int argc,
+ m4_token_data **argv)
{
const unsigned char *text;
int i;
diff -rub ../m4/m4/module.c ./m4/module.c
--- ../m4/m4/module.c Fri Aug 17 18:29:48 2001
+++ ./m4/module.c Mon Aug 20 12:10:07 2001
@@ -82,13 +82,12 @@
#define M4_INIT_SYMBOL "m4_init_module"
#define M4_FINISH_SYMBOL "m4_finish_module"
-static const char* m4_module_dlerror M4_PARAMS((void));
+static const char* m4_module_dlerror (void);
static lt_dlcaller_id m4_caller_id = 0;
const char *
-m4_module_name (handle)
- const lt_dlhandle handle;
+m4_module_name (lt_dlhandle handle);
{
const lt_dlinfo *info;
@@ -100,8 +99,7 @@
}
m4_builtin *
-m4_module_builtins (handle)
- const lt_dlhandle handle;
+m4_module_builtins (lt_dlhandle handle)
{
m4_module_data *data;
@@ -113,8 +111,7 @@
}
m4_macro *
-m4_module_macros (handle)
- const lt_dlhandle handle;
+m4_module_macros (lt_dlhandle handle)
{
m4_module_data *data;
@@ -126,8 +123,7 @@
}
lt_dlhandle
-m4_module_find_by_builtin (match)
- const m4_builtin *match;
+m4_module_find_by_builtin (const m4_builtin *match)
{
lt_dlhandle handle = 0;
@@ -153,7 +149,7 @@
const char *
-m4_module_dlerror ()
+m4_module_dlerror (void)
{
const char *dlerror = lt_dlerror ();
@@ -168,7 +164,7 @@
prevent the path search of the dlopen library from finding wrong
files. */
void
-m4_module_init ()
+m4_module_init (void)
{
int errors = 0;
@@ -235,9 +231,7 @@
it is searched for in the module path. The module is unloaded in
case of error. */
const lt_dlhandle
-m4_module_open (name, obs)
- const char *name;
- struct obstack *obs;
+m4_module_open (const char *name, struct obstack *obs)
{
lt_dlhandle handle = 0;
m4_module_init_func *init_func = 0;
@@ -326,9 +320,7 @@
}
void
-m4_module_close (handle, obs)
- lt_dlhandle handle;
- struct obstack *obs;
+m4_module_close (lt_dlhandle handle, struct obstack *obs)
{
m4_module_finish_func *finish_func = 0;
const char *name = 0;
@@ -382,8 +374,7 @@
}
void
-m4_module_close_all (obs)
- struct obstack *obs;
+m4_module_close_all (struct obstack *obs)
{
lt_dlhandle handle = lt_dlhandle_next (0);
@@ -405,9 +396,7 @@
}
lt_dlhandle
-m4_module_load (name, obs)
- const char *name;
- struct obstack *obs;
+m4_module_load (const char *name, struct obstack *obs)
{
const lt_dlhandle handle = m4_module_open (name, obs);
@@ -451,9 +440,7 @@
/* Unload a module. */
void
-m4_module_unload (name, obs)
- const char *name;
- struct obstack *obs;
+m4_module_unload (const char *name, struct obstack *obs)
{
lt_dlhandle handle = 0;
int errors = 0;
diff -rub ../m4/m4/output.c ./m4/output.c
--- ../m4/m4/output.c Sun Aug 19 11:35:58 2001
+++ ./m4/output.c Mon Aug 20 12:13:13 2001
@@ -103,7 +103,7 @@
/* --- OUTPUT INITIALISATION --- */
void
-m4_output_init ()
+m4_output_init (void)
{
diversion_table = (struct diversion *) xmalloc (sizeof (struct diversion));
diversions = 1;
@@ -128,11 +128,8 @@
#include <fcntl.h>
-static int mkstemp M4_PARAMS((const char *tmpl));
-
static int
-mkstemp (tmpl)
- const char *tmpl;
+mkstemp (const char *tmpl)
{
mktemp (tmpl);
return open (tmpl, O_RDWR | O_TRUNC | O_CREAT, 0600);
@@ -149,12 +146,8 @@
*/
#include <fcntl.h>
-char *mktemp M4_PARAMS((char *tmpl));
-int mkstemp M4_PARAMS((char *tmpl));
-
int
-mkstemp (tmpl)
- char *tmpl;
+mkstemp (char *tmpl)
{
char *xes;
pid_t pid;
@@ -191,8 +184,7 @@
}
char *
-mktemp (tmpl)
- char *tmpl;
+mktemp (char *tmpl)
{
int fd;
@@ -212,10 +204,8 @@
/* Implement tmpfile(3) for non-USG systems. */
-static FILE *tmpfile M4_PARAMS((void));
-
static FILE *
-tmpfile ()
+tmpfile (void)
{
char buf[32];
int fd;
@@ -238,8 +228,7 @@
to be flushed to a newly created temporary file. This flushed buffer
might well be the current one. */
static void
-make_room_for (length)
- int length;
+make_room_for (int length)
{
int wanted_size;
@@ -348,8 +337,7 @@
(output_unused--, *output_cursor++ = (Char))
static void
-output_character_helper (character)
- int character;
+output_character_helper (int character)
{
make_room_for (1);
@@ -365,9 +353,7 @@
/* Output one TEXT having LENGTH characters, when it is known that it goes
to a diversion file or an in-memory diversion buffer. */
static void
-output_text (text, length)
- const char *text;
- int length;
+output_text (const char *text, int length)
{
int count;
@@ -398,10 +384,7 @@
sync lines are output whenever a single input lines generates several
output lines, or when several input lines does not generate any output. */
void
-m4_shipout_text (obs, text, length)
- struct obstack *obs;
- const char *text;
- int length;
+m4_shipout_text (struct obstack *obs, const char *text, int length)
{
static boolean start_of_output_line = TRUE;
char line[20];
@@ -483,6 +466,7 @@
start_of_output_line = TRUE;
}
}
+
/* Format an int VAL, and stuff it into an obstack OBS. Used for macros
expanding to numbers. */
void
@@ -495,7 +479,8 @@
}
void
-m4_shipout_string (struct obstack *obs, const char *s, int len, boolean quoted)
+m4_shipout_string (struct obstack *obs, const char *s, int len,
+ boolean quoted)
{
if (s == NULL)
s = "";
diff -rub ../m4/m4/path.c ./m4/path.c
--- ../m4/m4/path.c Tue Aug 7 11:41:11 2001
+++ ./m4/path.c Mon Aug 20 12:14:54 2001
@@ -47,7 +47,7 @@
*/
struct m4_search_path_info *
-m4_search_path_info_new ()
+m4_search_path_info_new (void)
{
struct m4_search_path_info *info;
@@ -61,9 +61,7 @@
}
void
-m4_search_path_add (info, dir)
- struct m4_search_path_info *info;
- const char *dir;
+m4_search_path_add (struct m4_search_path_info *info, const char *dir)
{
m4_search_path *path;
@@ -86,10 +84,8 @@
}
void
-m4_search_path_env_init (info, path, isabs)
- struct m4_search_path_info *info;
- char *path;
- boolean isabs;
+m4_search_path_env_init (struct m4_search_path_info *info, char *path,
+ boolean isabs)
{
char *path_end;
@@ -110,7 +106,7 @@
void
-m4_include_init ()
+m4_include_init (void)
{
dirpath.list = NULL;
dirpath.list_end = NULL;
@@ -121,7 +117,7 @@
/* Functions for normal input path search */
void
-m4_include_env_init ()
+m4_include_env_init (void)
{
if (no_gnu_extensions)
return;
@@ -130,8 +126,7 @@
}
void
-m4_add_include_directory (dir)
- const char *dir;
+m4_add_include_directory (const char *dir)
{
if (no_gnu_extensions)
return;
@@ -144,9 +139,7 @@
}
FILE *
-m4_path_search (dir, expanded_name)
- const char *dir;
- char **expanded_name;
+m4_path_search (const char *dir, char **expanded_name)
{
FILE *fp;
struct m4_search_path *incl;
@@ -196,10 +189,8 @@
#ifdef DEBUG_INCL
-static void include_dump M4_PARAMS((void));
-
static void
-include_dump ()
+include_dump (void)
{
struct m4_search_path *incl;
diff -rub ../m4/m4/symtab.c ./m4/symtab.c
--- ../m4/m4/symtab.c Sun Aug 19 11:35:58 2001
+++ ./m4/symtab.c Mon Aug 20 15:02:33 2001
@@ -39,7 +39,7 @@
m4_symbol **m4_symtab;
void
-m4_symtab_init ()
+m4_symtab_init (void)
{
int i;
m4_symbol **symbol;
@@ -77,7 +77,7 @@
xfree (SYMBOL_NAME (symbol));
if (SYMBOL_TYPE (symbol) == M4_TOKEN_TEXT)
xfree (SYMBOL_TEXT (symbol));
- xfree ((VOID *) symbol);
+ xfree ((void *) symbol);
}
/* Search in, and manipulation of the symbol table, are all done by
@@ -189,9 +189,7 @@
/* The following function removes from the symbol table, every symbol
that references a function in the given builtin table. */
void
-m4_remove_table_reference_symbols (builtins, macros)
- m4_builtin *builtins;
- m4_macro *macros;
+m4_remove_table_reference_symbols (m4_builtin *builtins, m4_macro *macros)
{
/* FIXME: This can be reimplemented to work much faster now that each
symtab entry carries a reference to its defining module. */
@@ -276,9 +274,7 @@
function FUNC for each symbol in the table. FUNC is called with a
pointer to the symbol, and the DATA argument. */
void
-m4_hack_all_symbols (func, data)
- m4_hack_symbol *func;
- const char *data;
+m4_hack_all_symbols (m4_hack_symbol *func, const char *data)
{
int h;
m4_symbol *symbol;
@@ -290,11 +286,8 @@
#ifdef DEBUG_SYM
-static void symtab_debug M4_PARAMS((void));
-static void symtab_print_list M4_PARAMS((int i));
-
static void
-symtab_debug ()
+symtab_debug (void)
{
m4_token_data_t t;
m4_token_data td;
@@ -329,8 +322,7 @@
}
static void
-symtab_print_list (i)
- int i;
+symtab_print_list (int i)
{
m4_symbol *symbol;
diff -rub ../m4/m4/system.h ./m4/system.h
--- ../m4/m4/system.h Thu Aug 16 23:21:30 2001
+++ ./m4/system.h Mon Aug 20 11:50:46 2001
@@ -112,18 +112,6 @@
-/* M4_PARAMS is a macro used to wrap function prototypes, so that compilers
- that don't understand ANSI C prototypes still work, and ANSI C
- compilers can issue warnings about type mismatches. */
-#undef M4_PARAMS
-#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined
(_SYSTYPE_SVR4)) || defined(WIN32) || defined(__cplusplus)
-# define M4_PARAMS(protos) protos
-#else
-# define M4_PARAMS(protos) ()
-#endif
-
-
-
/* M4_STMT_START/END are used to create macros which expand to a
a single compound statement in a portable way, but crucially in
a way sympathetic to the compiler to maximise optimisation. */
@@ -166,39 +154,18 @@
#endif
-
-/* Using ``VOID *'' for untyped pointers prevents pre-ANSI compilers
- from choking. */
-#ifndef VOID
-# if __STDC__
-# define VOID void
-# else
-# define VOID char
-# endif
-#endif
-
-
-
/* Preprocessor token manipulation. */
/* The extra indirection to the _STR and _CONC macros is required so that
if the arguments to STR() (or CONC()) are themselves macros, they will
be expanded before being quoted. */
#ifndef STR
-# if __STDC__
# define _STR(arg) #arg
-# else
-# define _STR(arg) "arg"
-# endif
# define STR(arg) _STR(arg)
#endif
#ifndef CONC
-# if __STDC__
# define _CONC(a, b) a##b
-# else
-# define _CONC(a, b) a/**/b
-# endif
# define CONC(a, b) _CONC(a, b)
#endif
@@ -231,16 +198,14 @@
#define XCALLOC(type, num) ((type *) xcalloc ((num), sizeof(type)))
#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
#define XREALLOC(type, p, num) ((type *) xrealloc ((p), (num) * sizeof(type)))
-#define XFREE(stale) M4_STMT_START { \
- if (stale) { free ((VOID *) stale); stale = 0; } \
- } M4_STMT_END
-
-extern VOID *xcalloc M4_PARAMS((size_t n, size_t s));
-extern VOID *xmalloc M4_PARAMS((size_t n));
-extern VOID *xrealloc M4_PARAMS((VOID *p, size_t n));
-extern void xfree M4_PARAMS((VOID *stale));
+#define XFREE(p) M4_STMT_START { if (p) free (p); (p) = 0; } M4_STMT_END
+
+extern void *xcalloc (size_t n, size_t s);
+extern void *xmalloc (size_t n);
+extern void *xrealloc (void *p, size_t n);
+extern void xfree (void *stale);
-extern char *xstrdup M4_PARAMS((const char *string));
+extern char *xstrdup (const char *string);
END_C_DECLS
diff -rub ../m4/m4/utility.c ./m4/utility.c
--- ../m4/m4/utility.c Sun Aug 19 11:35:58 2001
+++ ./m4/utility.c Mon Aug 20 12:20:35 2001
@@ -24,7 +24,7 @@
#include "m4.h"
#include "m4private.h"
-static int dumpdef_cmp M4_PARAMS((const VOID *s1, const VOID *s2));
+static int dumpdef_cmp (const void *s1, const void *s2);
/* The name this program was run with. */
M4_GLOBAL_DATA const char *program_name;
@@ -80,7 +80,6 @@
M4_GLOBAL_DATA m4_string ecomm;
-
/* Addressable function versions of the macros defined in m4private.h.
Since they are functions the caller does not need access to the
internal data structure, so they are safe to export for use in
@@ -178,12 +177,8 @@
/* Print ARGC arguments from the table ARGV to obstack OBS, separated by
SEP, and quoted by the current quotes, if QUOTED is TRUE. */
void
-m4_dump_args (obs, argc, argv, sep, quoted)
- struct obstack *obs;
- int argc;
- m4_token_data **argv;
- const char *sep;
- boolean quoted;
+m4_dump_args (struct obstack *obs, int argc, m4_token_data **argv,
+ const char *sep, boolean quoted)
{
int i;
size_t len = strlen (sep);
@@ -193,7 +188,7 @@
if (i > 1)
obstack_grow (obs, sep, len);
- m4_shipout_string(obs, M4_TOKEN_DATA_TEXT (argv[i]), 0, quoted);
+ m4_shipout_string (obs, M4_TOKEN_DATA_TEXT (argv[i]), 0, quoted);
}
}
@@ -241,9 +236,7 @@
/* qsort comparison routine, for sorting the table made in m4_dumpdef (). */
static int
-dumpdef_cmp (s1, s2)
- const VOID *s1;
- const VOID *s2;
+dumpdef_cmp (const void *s1, const void *s2)
{
return strcmp (SYMBOL_NAME (* (m4_symbol *const *) s1),
SYMBOL_NAME (* (m4_symbol *const *) s2));
@@ -252,9 +245,7 @@
/* The function dump_symbol () is for use by "dumpdef". It builds up a
table of all defined, un-shadowed, symbols. */
void
-m4_dump_symbol (symbol, data)
- m4_symbol *symbol;
- struct m4_dump_symbol_data *data;
+m4_dump_symbol (m4_symbol *symbol, struct m4_dump_symbol_data *data)
{
if (!SYMBOL_SHADOWED (symbol) && SYMBOL_TYPE (symbol) != M4_TOKEN_VOID)
{
@@ -267,11 +258,8 @@
/* If there are no arguments, build a sorted list of all defined,
un-shadowed, symbols, otherwise, only the specified symbols. */
void
-m4_dump_symbols (data, argc, argv, complain)
- struct m4_dump_symbol_data *data;
- int argc;
- m4_token_data **argv;
- boolean complain;
+m4_dump_symbols (struct m4_dump_symbol_data *data, int argc,
+ m4_token_data **argv, boolean complain)
{
data->base = (m4_symbol **) obstack_base (data->obs);
data->size = 0;
diff -rub ../m4/m4/xmalloc.c ./m4/xmalloc.c
--- ../m4/m4/xmalloc.c Tue Aug 7 11:41:11 2001
+++ ./m4/xmalloc.c Mon Aug 20 15:03:08 2001
@@ -44,14 +44,14 @@
#endif
#ifndef STDC_HEADERS
-VOID *calloc ();
-VOID *malloc ();
-VOID *realloc ();
+void *calloc ();
+void *malloc ();
+void *realloc ();
void free ();
#endif
/* Prototypes for functions defined here. */
-static VOID *fixup_null_alloc (size_t n);
+static void *fixup_null_alloc (size_t n);
/* Exit value when the requested amount of memory is not available.
@@ -67,11 +67,11 @@
extern void error ();
#endif
-static VOID *
+static void *
fixup_null_alloc (n)
size_t n;
{
- VOID *p;
+ void *p;
p = 0;
if (n == 0)
@@ -83,11 +83,11 @@
/* Allocate N bytes of memory dynamically, with error checking. */
-VOID *
+void *
xmalloc (n)
size_t n;
{
- VOID *p;
+ void *p;
p = malloc (n);
if (p == 0)
@@ -97,11 +97,11 @@
/* Allocate memory for N elements of S bytes, with error checking. */
-VOID *
+void *
xcalloc (n, s)
size_t n, s;
{
- VOID *p;
+ void *p;
#if HAVE_CALLOC
p = calloc (n, s);
if (p == 0)
@@ -117,9 +117,9 @@
with error checking.
If P is NULL, run xmalloc. */
-VOID *
+void *
xrealloc (p, n)
- VOID *p;
+ void *p;
size_t n;
{
if (p == 0)
@@ -133,7 +133,7 @@
/* Don't free NULL pointers. */
void
xfree (stale)
- VOID *stale;
+ void *stale;
{
if (stale)
free (stale);
diff -rub ../m4/modules/format.c ./modules/format.c
--- ../m4/modules/format.c Sun Aug 19 11:35:58 2001
+++ ./modules/format.c Mon Aug 20 12:26:11 2001
@@ -110,10 +110,7 @@
void format M4_PARAMS((struct obstack *obs, int argc, m4_token_data **argv));
void
-format (obs, argc, argv)
- struct obstack *obs;
- int argc;
- m4_token_data **argv;
+format (struct obstack *obs, int argc, m4_token_data **argv)
{
#ifdef HAVE_EFGCVT
diff -rub ../m4/modules/gnu.c ./modules/gnu.c
--- ../m4/modules/gnu.c Sun Aug 19 11:35:58 2001
+++ ./modules/gnu.c Mon Aug 20 12:27:59 2001
@@ -101,7 +101,7 @@
{ 0, 0 },
};
-static void substitute M4_PARAMS((struct obstack *obs, const char *victim,
const char *repl, struct re_registers *regs));
+static void substitute (struct obstack *obs, const char *victim, const char
*repl, struct re_registers *regs);
/* The builtin "builtin" allows calls to builtin macros, even if their
diff -rub ../m4/modules/m4.c ./modules/m4.c
--- ../m4/modules/m4.c Sun Aug 19 11:35:58 2001
+++ ./modules/m4.c Mon Aug 20 12:30:38 2001
@@ -132,10 +132,7 @@
symbol table. */
static void
-macro_install (argc, argv, mode)
- int argc;
- m4_token_data **argv;
- m4_symbol_lookup mode;
+macro_install (int argc, m4_token_data **argv, m4_symbol_lookup mode)
{
if (m4_bad_argc (argv[0], argc, 2, 3))
return;
diff -rub ../m4/modules/mpeval.c ./modules/mpeval.c
--- ../m4/modules/mpeval.c Sun Aug 19 11:35:58 2001
+++ ./modules/mpeval.c Mon Aug 20 12:35:01 2001
@@ -108,21 +108,22 @@
/* number should be at least 32 bits. */
typedef mpq_t number;
-extern boolean m4_mp_evaluate M4_PARAMS((struct obstack *obs, const char *,
- const int radix, int min));
-static void numb_initialise M4_PARAMS((void));
-static void numb_obstack M4_PARAMS((struct obstack *obs, const number value,
- const int radix, int min));
-static void mpq2mpz M4_PARAMS((mpz_t z, const number q, const char *noisily));
-static void mpz2mpq M4_PARAMS((number q, const mpz_t z));
-static void numb_divide M4_PARAMS((number *x, const number *y));
-static void numb_modulo M4_PARAMS((number *x, const number *y));
-static void numb_and M4_PARAMS((number *x, const number *y));
-static void numb_ior M4_PARAMS((number *x, const number *y));
-static void numb_eor M4_PARAMS((number *x, const number *y));
-static void numb_not M4_PARAMS((number *x));
-static void numb_lshift M4_PARAMS((number *x, const number *y));
-static void numb_rshift M4_PARAMS((number *x, const number *y));
+extern boolean m4_mp_evaluate (struct obstack *obs, const char *,
+ const int radix, int min);
+static void numb_initialise (void);
+static void numb_obstack (struct obstack *obs, const number value,
+ const int radix, int min);
+static void mpq2mpz (mpz_t z, const number q,
+ const char *noisily);
+static void mpz2mpq (number q, const mpz_t z);
+static void numb_divide (number *x, const number *y);
+static void numb_modulo (number *x, const number *y);
+static void numb_and (number *x, const number *y);
+static void numb_ior (number *x, const number *y);
+static void numb_eor (number *x, const number *y);
+static void numb_not (number *x);
+static void numb_lshift (number *x, const number *y);
+static void numb_rshift (number *x, const number *y);
@@ -141,7 +142,7 @@
static int numb_initialised = 0;
static void
-numb_initialise ()
+numb_initialise (void)
{
if (numb_initialised)
return;
@@ -156,11 +157,8 @@
}
static void
-numb_obstack(obs, value, radix, min)
- struct obstack *obs;
- const number value;
- const int radix;
- int min;
+numb_obstack (struct obstack *obs, const number value, const int radix,
+ int min)
{
const char *s;
@@ -195,10 +193,7 @@
#define QUIET (char *)0
static void
-mpq2mpz (z, q, noisily)
- mpz_t z;
- const number q;
- const char *noisily;
+mpq2mpz (mpz_t z, const number q, const char *noisily)
{
if (noisily && mpz_cmp_si (mpq_denref (q), (long) 1) != 0)
{
@@ -210,18 +205,14 @@
}
static void
-mpz2mpq (q, z)
- number q;
- const mpz_t z;
+mpz2mpq (number q, const mpz_t z)
{
mpq_set_si (q, (long) 0, (unsigned long) 1);
mpq_set_num (q, z);
}
static void
-numb_divide (x, y)
- number *x;
- const number *y;
+numb_divide (number *x, const number *y)
{
mpq_t qres;
mpz_t zres;
@@ -238,9 +229,7 @@
}
static void
-numb_modulo (x, y)
- number *x;
- const number *y;
+numb_modulo (number *x, const number *y)
{
mpz_t xx, yy, res;
@@ -264,9 +253,7 @@
}
static void
-numb_and(x, y)
- number *x;
- const number *y;
+numb_and(number *x, const number *y)
{
mpz_t xx, yy, res;
@@ -290,9 +277,7 @@
}
static void
-numb_ior (x, y)
- number *x;
- const number *y;
+numb_ior (number *x, const number *y)
{
mpz_t xx, yy, res;
@@ -316,9 +301,7 @@
}
static void
-numb_eor (x, y)
- number *x;
- const number *y;
+numb_eor (number *x, const number *y)
{
mpz_t xx, yy, res;
@@ -365,8 +348,7 @@
}
static void
-numb_not (x)
- number *x;
+numb_not (number *x)
{
mpz_t xx, res;
@@ -385,9 +367,7 @@
}
static void
-numb_lshift (x, y)
- number *x;
- const number *y;
+numb_lshift (number *x, const number *y)
{
mpz_t xx, yy, res;
@@ -418,9 +398,7 @@
}
static void
-numb_rshift (x, y)
- number *x;
- const number *y;
+numb_rshift (number *x, const number *y)
{
mpz_t xx, yy, res;
diff -rub ../m4/src/freeze.c ./src/freeze.c
--- ../m4/src/freeze.c Sun Aug 19 11:40:50 2001
+++ ./src/freeze.c Mon Aug 20 12:37:49 2001
@@ -28,20 +28,17 @@
#include "m4.h"
#include "m4private.h"
-static int decode_char M4_PARAMS((FILE *in));
-static void issue_expect_message M4_PARAMS((int expected));
-static int produce_char_dump M4_PARAMS((char *buf, int ch));
-static void produce_syntax_dump M4_PARAMS((FILE *file, char ch, int mask));
-static void produce_module_dump M4_PARAMS((FILE *file, lt_dlhandle handle));
-static void produce_symbol_dump M4_PARAMS((FILE *file,
- const m4_symbol *bucke));
+static int decode_char (FILE *in);
+static void issue_expect_message (int expected);
+static int produce_char_dump (char *buf, int ch);
+static void produce_syntax_dump (FILE *file, char ch, int mask);
+static void produce_module_dump (FILE *file, lt_dlhandle handle);
+static void produce_symbol_dump (FILE *file, const m4_symbol *bucke);
/* Produce a frozen state to the given file NAME. */
static int
-produce_char_dump (buf, ch)
- char *buf;
- int ch;
+produce_char_dump (char *buf, int ch)
{
char *p = buf;
int digit;
@@ -82,10 +79,7 @@
#define MAX_CHAR_LENGTH 4 /* '\377' -> 4 characters */
static void
-produce_syntax_dump (file, ch, mask)
- FILE *file;
- char ch;
- int mask;
+produce_syntax_dump (FILE *file, char ch, int mask)
{
char buf[1+ MAX_CHAR_LENGTH * sizeof (m4_syntax_table)];
int code = m4_syntax_code (ch);
@@ -115,9 +109,7 @@
reloaded from the frozen file. libltdl stores handles in a push
down stack, so we need to dump them in the reverse order to that. */
void
-produce_module_dump (file, handle)
- FILE *file;
- lt_dlhandle handle;
+produce_module_dump (FILE *file, lt_dlhandle handle)
{
lt_dlhandle pending = handle;
const char *name = m4_module_name (pending);
@@ -135,9 +127,7 @@
This order ensures that, at reload time, pushdef's will be
executed with the oldest definitions first. */
void
-produce_symbol_dump (file, bucket)
- FILE *file;
- const m4_symbol *bucket;
+produce_symbol_dump (FILE *file, const m4_symbol *bucket)
{
const m4_symbol *pending = bucket;
lt_dlhandle handle = SYMBOL_HANDLE (pending);
@@ -201,8 +191,7 @@
}
void
-produce_frozen_state (name)
- const char *name;
+produce_frozen_state (const char *name)
{
FILE *file;
int h;
@@ -285,8 +274,7 @@
/* Issue a message saying that some character is an EXPECTED character. */
static void
-issue_expect_message (expected)
- int expected;
+issue_expect_message (int expected)
{
if (expected == '\n')
M4ERROR ((EXIT_FAILURE, 0, _("Expecting line feed in frozen file")));
@@ -302,8 +290,7 @@
of file is reached whilst reading the character. */
static int
-decode_char (in)
- FILE *in;
+decode_char (FILE *in)
{
int ch = fgetc (in);
@@ -340,8 +327,7 @@
/* We are seeking speed, here. */
void
-reload_frozen_state (name)
- const char *name;
+reload_frozen_state (const char *name)
{
FILE *file;
int version;
diff -rub ../m4/src/m4.h ./src/m4.h
--- ../m4/src/m4.h Tue Aug 7 11:41:11 2001
+++ ./src/m4.h Mon Aug 20 12:38:33 2001
@@ -97,14 +97,14 @@
/* Error handling. */
#ifdef USE_STACKOVF
-void setup_stackovf_trap M4_PARAMS((char *const *, char *const *,
- void (*handler) (void)));
+void setup_stackovf_trap (char *const *, char *const *,
+ void (*handler) (void));
#endif
/* File: freeze.c --- frozen state files. */
-void produce_frozen_state M4_PARAMS((const char *));
-void reload_frozen_state M4_PARAMS((const char *));
+void produce_frozen_state (const char *);
+void reload_frozen_state (const char *);
#endif /* M4_H */
diff -rub ../m4/src/main.c ./src/main.c
--- ../m4/src/main.c Sun Aug 19 11:42:07 2001
+++ ./src/main.c Mon Aug 20 15:03:21 2001
@@ -24,7 +24,7 @@
#include "m4private.h"
#include "error.h"
-void print_program_name M4_PARAMS((void));
+void print_program_name (void);
/* Name of frozen file to digest after initialization. */
@@ -488,7 +488,7 @@
}
next = defines->next;
- xfree ((VOID *) defines);
+ xfree ((void *) defines);
defines = next;
}
diff -rub ../m4/src/stackovf.c ./src/stackovf.c
--- ../m4/src/stackovf.c Tue Aug 7 11:41:11 2001
+++ ./src/stackovf.c Mon Aug 20 12:40:26 2001
@@ -109,13 +109,13 @@
#endif
/* Giving a hand to ansi2knr... */
-typedef void (*handler_t) M4_PARAMS((void));
+typedef void (*handler_t) (void);
#if defined(__ultrix) && defined(__vax)
-extern char *sbrk M4_PARAMS((int));
-extern int getrlimit M4_PARAMS((int, struct rlimit *));
-extern int sigstack M4_PARAMS((struct sigstack *, struct sigstack *));
-extern int sigvec M4_PARAMS((int, struct sigvec *, struct sigvec *));
+extern char *sbrk (int);
+extern int getrlimit (int, struct rlimit *);
+extern int sigstack (struct sigstack *, struct sigstack *);
+extern int sigvec (int, struct sigvec *, struct sigvec *);
#endif
static const char *stackbot;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- FYI: Ansification,
Gary V. Vaughan <=