From: Bruno Haible Date: Thu, 14 Nov 2002 15:00:41 +0000 (+0000) Subject: Switch from K&R C to ANSI C. X-Git-Tag: v0.12~1214 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=741bd98a238c11918aadca01170c3e012f435216;p=thirdparty%2Fgettext.git Switch from K&R C to ANSI C. --- diff --git a/ChangeLog b/ChangeLog index d259b7bb8..ec171bfd5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-11-13 Bruno Haible + + Assume ANSI C. + * configure.in: Remove AC_C_BACKSLASH_A call. + * os2/configure.awk: Remove HAVE_C_BACKSLASH_A setting. + 2002-11-07 Bruno Haible * ltmain.sh: Upgrade to libtool-1.4.3. diff --git a/configure.in b/configure.in index ca07c27cb..249dacbcc 100644 --- a/configure.in +++ b/configure.in @@ -64,7 +64,6 @@ dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE bh_C_SIGNED -AC_C_BACKSLASH_A jm_AC_TYPE_UNSIGNED_LONG_LONG AC_TYPE_OFF_T AC_TYPE_SIZE_T diff --git a/lib/ChangeLog b/lib/ChangeLog index 482e0016d..7960cce7a 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,146 @@ +2002-11-13 Bruno Haible + + Assume ANSI C. + * libstdarg.h: Remove file. + * Makefile.am (LIBADD_SOURCE): Remove libstdarg.h. + * addext.c (addext): Use ANSI C function declarations. + * alloca.c (alloca): Likewise. + * argmatch.h (PARAMS): Remove macro. + (argmatch, argmatch_exit_fn, argmatch_invalid, argmatch_valid, + __xargmatch_internal, argmatch_to_argument): Use ANSI C function + declarations. + * argmatch.c (argmatch, argmatch_invalid, argmatch_valid, + __xargmatch_internal, argmatch_to_argument): Likewise. + * backupfile.h (PARAMS): Remove macro. + (find_backup_file_name, get_version, xget_version, addext): Use ANSI C + function declarations. + * backupfile.c (find_backup_file_name, max_backup_version, + version_number, get_version, xget_version): Likewise. + * basename.h (gnu_basename): Likewise. + * basename.c (basename): Likewise. + * c-ctype.h (PARAMS): Remove macro. + (c_isascii, c_isalnum, c_isalpha, c_isblank, c_iscntrl, c_isdigit, + c_islower, c_isgraph, c_isprint, c_ispunct, c_isspace, c_isupper, + c_isxdigit, c_tolower, c_toupper): Use ANSI C function declarations. + * c-ctype.c (c_isascii, c_isalnum, c_isalpha, c_isblank, c_iscntrl, + c_isdigit, c_islower, c_isgraph, c_isprint, c_ispunct, c_isspace, + c_isupper, c_isxdigit, c_tolower, c_toupper): Likewise. + * classpath.c (new_classpath, set_classpath, reset_classpath): + Likewise. + * concatpath.c (concatenated_pathname): Likewise. + * copy-file.h (copy_file): Likewise. + * copy-file.c (copy_file): Likewise. + * execute.h (execute): Likewise. + * execute.c (nonintr_close, nonintr_open, execute): Likewise. + * findprog.h (find_in_path): Likewise. + * findprog.c (find_in_path): Likewise. + * fstrcmp.h (fstrcmp): Likewise. + * fstrcmp.c (diag, compareseq, fstrcmp): Likewise. + * full-write.h (full_write): Likewise. + * full-write.c (full_write): Likewise. + * gcd.h (PARAMS): Remove macro. + (gcd): Use ANSI C function declarations. + * gcd.c (gcd): Likewise. + * getline.h (PARAMS): Remove macro. + (getline, getdelim): Use ANSI C function declarations. + * getline.c (getstr, getline, getdelim): Likewise. + * hash.h (PARAMS): Remove macro. + (init_hash, delete_hash, insert_entry, find_entry, iterate_table, + next_prime): Use ANSI C function declarations. + * hash.c (init_hash, delete_hash, insert_entry, insert_entry_2, + find_entry, iterate_table, lookup, compute_hashval, next_prime, + is_prime): Likewise. + * javacomp.h (compile_java_class): Likewise. + * javacomp.c (compile_java_class): Likewise. + * javaexec.h (execute_fn, execute_java_class): Likewise. + * javaexec.c (execute_java_class): Likewise. + * linebreak.h (PARAMS): Remove macro. + (locale_charset, uc_width, u8_width, u16_width, u32_width, + u8_possible_linebreaks, u16_possible_linebreaks, + u32_possible_linebreaks, mbs_possible_linebreaks, u8_width_linebreaks, + u16_width_linebreaks, u32_width_linebreaks, mbs_width_linebreaks): Use + ANSI C function declarations. + * linebreak.c (u32_mbtouc, is_cjk_encoding, is_utf8_encoding, + uc_width, u8_width, u16_width, u32_width, lbrkprop_lookup, + u8_possible_linebreaks, u16_possible_linebreaks, + u32_possible_linebreaks, u8_width_linebreaks, u16_width_linebreaks, + u32_width_linebreaks, read_file, main, iconv_string_length, + iconv_string_keeping_offsets, is_all_ascii, mbs_possible_linebreaks, + mbs_width_linebreaks, read_file, main): Likewise. + * mbswidth.h (PARAMS): Remove macro. + (mbswidth, mbsnwidth): Use ANSI C function declarations. + * mbswidth.c (mbswidth, mbsnwidth): Likewise. + * memmove.c (memmove): Likewise. + * memset.c (memset): Likewise. + * mkdtemp.h (PARAMS): Remove macro. + (mkdtemp): Use ANSI C function declarations. + * mkdtemp.c (gen_tempname, mkdtemp): Likewise. + * pathname.h (PARAMS): Remove macro. + (concatenated_pathname): Use ANSI C function declarations. + * pfnmatch.h (PARAMS): Remove macro. + (fnmatch): Use ANSI C function declarations. + * pfnmatch.c (fnmatch): Likewise. + * pipe.h (create_pipe_out, create_pipe_in, create_pipe_bidi): + Likewise. + * pipe-bidi.c (nonintr_close, create_pipe_bidi): Likewise. + * pipe-in.c (nonintr_close, nonintr_open, create_pipe_in): Likewise. + * pipe-out.c (nonintr_close, nonintr_open, create_pipe_out): Likewise. + * progname.h (set_program_name, maybe_print_progname): Likewise. + * progname.c (set_program_name): Likewise. + * safe-read.h (safe_read): Likewise. + * safe-read.c (safe_read): Likewise. + * setenv.h (PARAMS): Remove macro. + (setenv, unsetenv): Use ANSI C function declarations. + * setenv.c (compar_fn_t, __add_to_environ, setenv): Likewise. + * sh-quote.h (shell_quote_length, shell_quote_copy, shell_quote, + shell_quote_argv): Likewise. + * sh-quote.c (shell_quote_length, shell_quote_copy, shell_quote, + shell_quote_argv): Likewise. + * stpcpy.h (PARAMS): Remove macro. + (stpcpy): Use ANSI C function declarations. + * stpcpy.c (__stpcpy): Likewise. + * stpncpy.h (PARAMS): Remove macro. + (gnu_stpncpy): Use ANSI C function declarations. + * stpncpy.c (__stpncpy): Likewise. + * strcase.h (PARAMS): Remove macro. + (strcasecmp, strncasecmp): Use ANSI C function declarations. + * strcasecmp.c (__strcasecmp): Likewise. + * strncasecmp.c (__strncasecmp): Likewise. + * strcspn.c (strcspn): Likewise. + * strpbrk.h (PARAMS): Remove macro. + (strpbrk): Use ANSI C function declarations. + * strpbrk.c (strpbrk): Likewise. + * strstr.h (PARAMS): Remove macro. + (strstr): Use ANSI C function declarations. + * strstr.c (strstr): Likewise. + * tmpdir.h (PARAMS): Remove macro. + (path_search): Use ANSI C function declarations. + * tmpdir.c (direxists, path_search): Likewise. + * ucs4-utf8.h (u8_uctomb_aux, u8_uctomb): Likewise. + * ucs4-utf16.h (u16_uctomb_aux, u16_uctomb): Likewise. + * unsetenv.c (unsetenv): Likewise. + * utf8-ucs4.h (u8_mbtouc_aux, u8_mbtouc): Likewise. + * utf16-ucs4.h (u16_mbtouc_aux, u16_mbtouc): Likewise. + * vasprintf.h (PARAMS): Remove macro. + Include instead of libstdarg.h. + (asprintf, vasprintf): Use ANSI C function declarations. + * vasprintf.c: Include instead of libstdarg.h. + (int_vasprintf, asprintf, checkit): Use ANSI C function declarations. + Use va_start instead of VA_START. + * wait-process.h (wait_subprocess): Likewise. + * wait-process.c (wait_subprocess): Likewise. + * xerror.h (xasprintf, multiline_warning, multiline_error): Likewise. + * xerror.c: Include instead of libstdarg.h. + (xasprintf, multiline_warning, multiline_error): Use ANSI C function + declarations. Use va_start instead of VA_START. + * xgetcwd.h (PARAMS): Remove macro. + (xgetcwd): Use ANSI C function declarations. + * xmalloc.h (xmalloc, xcalloc, xrealloc, xstrdup): Likewise. + * xmalloc.c (fixup_null_alloc, xmalloc, xcalloc, xrealloc): Likewise. + * xsetenv.h (xsetenv): Likewise. + * xsetenv.c (xsetenv): Likewise. + * xstrdup.c (xstrdup): Likewise. + 2002-11-05 Bruno Haible * argmatch.c: Include gettext.h instead of and . diff --git a/lib/Makefile.am b/lib/Makefile.am index e297d58d6..7a32a3631 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -72,7 +72,6 @@ LIBADD_SOURCE = \ mkdtemp.h mkdtemp.c \ pfnmatch.h pfnmatch.c \ setenv.h setenv.c unsetenv.c \ - libstdarg.h \ stpcpy.h stpcpy.c \ strcase.h strcasecmp.c strncasecmp.c \ strcspn.c \ diff --git a/lib/addext.c b/lib/addext.c index 9e601bd93..ec6c42e24 100644 --- a/lib/addext.c +++ b/lib/addext.c @@ -1,5 +1,5 @@ /* addext.c -- add an extension to a file name - Copyright (C) 1990, 1997-1999, 2001 Free Software Foundation, Inc. + Copyright (C) 1990, 1997-1999, 2001-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -55,10 +55,7 @@ in which case just append the character E. */ void -addext (filename, ext, e) - char *filename; - char const *ext; - int e; +addext (char *filename, char const *ext, char e) { char *s = basename (filename); size_t slen = strlen (s), extlen = strlen (ext); diff --git a/lib/alloca.c b/lib/alloca.c index 11e4cc374..1f6ebbdd4 100644 --- a/lib/alloca.c +++ b/lib/alloca.c @@ -186,11 +186,10 @@ static header *last_alloca_header = NULL; /* -> last alloca header. */ pointer #ifdef EMACS_WANTS_C_ALLOCA -c_alloca (size) +c_alloca (unsigned size) #else -alloca (size) +alloca (unsigned size) #endif - unsigned size; { auto char probe; /* Probes stack depth: */ register char *depth = ADDRESS_FUNCTION (probe); diff --git a/lib/argmatch.c b/lib/argmatch.c index c3972e647..0ff6ef861 100644 --- a/lib/argmatch.c +++ b/lib/argmatch.c @@ -41,11 +41,6 @@ ARGMATCH_DIE_DECL; #endif -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static void __argmatch_die PARAMS ((void)); - - static void __argmatch_die () { @@ -69,11 +64,8 @@ argmatch_exit_fn argmatch_die = __argmatch_die; "y" is a valid argument, for `0', and "n" for `1'. */ int -argmatch (arg, arglist, vallist, valsize) - const char *arg; - const char *const *arglist; - const char *vallist; - size_t valsize; +argmatch (const char *arg, const char *const *arglist, + const char *vallist, size_t valsize) { int i; /* Temporary index in ARGLIST. */ size_t arglen; /* Length of ARG. */ @@ -119,10 +111,7 @@ argmatch (arg, arglist, vallist, valsize) PROBLEM is the return value from argmatch. */ void -argmatch_invalid (context, value, problem) - const char *context; - const char *value; - int problem; +argmatch_invalid (const char *context, const char *value, int problem) { char const *format = (problem == -1 ? _("invalid argument `%s' for `%s'") @@ -136,10 +125,8 @@ argmatch_invalid (context, value, problem) VALLIST is a pointer to an array of values. VALSIZE is the size of the elements of VALLIST */ void -argmatch_valid (arglist, vallist, valsize) - const char *const *arglist; - const char *vallist; - size_t valsize; +argmatch_valid (const char *const *arglist, + const char *vallist, size_t valsize) { int i; const char *last_val = NULL; @@ -168,13 +155,10 @@ argmatch_valid (arglist, vallist, valsize) calls the (supposed never to return) function EXIT_FN. */ int -__xargmatch_internal (context, arg, arglist, vallist, valsize, exit_fn) - const char *context; - const char *arg; - const char *const *arglist; - const char *vallist; - size_t valsize; - argmatch_exit_fn exit_fn; +__xargmatch_internal (const char *context, + const char *arg, const char *const *arglist, + const char *vallist, size_t valsize, + argmatch_exit_fn exit_fn) { int res = argmatch (arg, arglist, vallist, valsize); if (res >= 0) @@ -192,11 +176,9 @@ __xargmatch_internal (context, arg, arglist, vallist, valsize, exit_fn) /* Look for VALUE in VALLIST, an array of objects of size VALSIZE and return the first corresponding argument in ARGLIST */ const char * -argmatch_to_argument (value, arglist, vallist, valsize) - const char *value; - const char *const *arglist; - const char *vallist; - size_t valsize; +argmatch_to_argument (const char *value, + const char *const *arglist, + const char *vallist, size_t valsize) { int i; diff --git a/lib/argmatch.h b/lib/argmatch.h index 380985ea9..fb87a6f5f 100644 --- a/lib/argmatch.h +++ b/lib/argmatch.h @@ -1,5 +1,5 @@ /* argmatch.h -- definitions and prototypes for argmatch.c - Copyright (C) 1990, 1998, 1999, 2001 Free Software Foundation, Inc. + Copyright (C) 1990, 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,14 +27,6 @@ # include -# ifndef PARAMS -# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES -# define PARAMS(args) args -# else -# define PARAMS(args) () -# endif /* ANSI C. */ -# endif /* Not PARAMS. */ - /* Assert there are as many real arguments as there are values (argument list ends with a NULL guard). There is no execution cost, since it will be statically evalauted to `assert (0)' or @@ -51,9 +43,8 @@ false ambiguities (i.e., different matches of ARG but corresponding to the same values in VALLIST). */ -int argmatch - PARAMS ((const char *arg, const char *const *arglist, - const char *vallist, size_t valsize)); +int argmatch (const char *arg, const char *const *arglist, + const char *vallist, size_t valsize); # define ARGMATCH(Arg, Arglist, Vallist) \ argmatch ((Arg), (Arglist), (const char *) (Vallist), sizeof (*(Vallist))) @@ -61,13 +52,12 @@ int argmatch /* xargmatch calls this function when it fails. This function should not return. By default, this is a function that calls ARGMATCH_DIE which in turn defaults to `exit (EXIT_FAILURE)'. */ -typedef void (*argmatch_exit_fn) PARAMS ((void)); +typedef void (*argmatch_exit_fn) (void); extern argmatch_exit_fn argmatch_die; /* Report on stderr why argmatch failed. Report correct values. */ -void argmatch_invalid - PARAMS ((const char *context, const char *value, int problem)); +void argmatch_invalid (const char *context, const char *value, int problem); /* Left for compatibility with the old name invalid_arg */ @@ -78,9 +68,8 @@ void argmatch_invalid /* Report on stderr the list of possible arguments. */ -void argmatch_valid - PARAMS ((const char *const *arglist, - const char *vallist, size_t valsize)); +void argmatch_valid (const char *const *arglist, + const char *vallist, size_t valsize); # define ARGMATCH_VALID(Arglist, Vallist) \ argmatch_valid (Arglist, (const char *) Vallist, sizeof (*(Vallist))) @@ -90,11 +79,10 @@ void argmatch_valid /* Same as argmatch, but upon failure, reports a explanation on the failure, and exits using the function EXIT_FN. */ -int __xargmatch_internal - PARAMS ((const char *context, - const char *arg, const char *const *arglist, - const char *vallist, size_t valsize, - argmatch_exit_fn exit_fn)); +int __xargmatch_internal (const char *context, + const char *arg, const char *const *arglist, + const char *vallist, size_t valsize, + argmatch_exit_fn exit_fn); /* Programmer friendly interface to __xargmatch_internal. */ @@ -106,9 +94,9 @@ int __xargmatch_internal /* Convert a value into a corresponding argument. */ -const char *argmatch_to_argument - PARAMS ((char const *value, const char *const *arglist, - const char *vallist, size_t valsize)); +const char *argmatch_to_argument (char const *value, + const char *const *arglist, + const char *vallist, size_t valsize); # define ARGMATCH_TO_ARGUMENT(Value, Arglist, Vallist) \ argmatch_to_argument ((char const *) &(Value), (Arglist), \ diff --git a/lib/backupfile.c b/lib/backupfile.c index 78f2ad0a2..24e0043a1 100644 --- a/lib/backupfile.c +++ b/lib/backupfile.c @@ -1,5 +1,5 @@ /* backupfile.c -- make Emacs style backup file names - Copyright (C) 1990-1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1990-1999, 2000-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -100,8 +100,8 @@ const char *simple_backup_suffix = "~"; #if HAVE_DIR -static int max_backup_version PARAMS ((const char *, const char *)); -static int version_number PARAMS ((const char *, const char *, size_t)); +static int max_backup_version (const char *, const char *); +static int version_number (const char *, const char *, size_t); #endif /* Return the name of the new backup file for file FILE, @@ -110,9 +110,7 @@ static int version_number PARAMS ((const char *, const char *, size_t)); Do not call this function if backup_type == none. */ char * -find_backup_file_name (file, backup_type) - const char *file; - enum backup_type backup_type; +find_backup_file_name (const char *file, enum backup_type backup_type) { size_t backup_suffix_size_max; size_t file_len = strlen (file); @@ -161,9 +159,7 @@ find_backup_file_name (file, backup_type) */ static int -max_backup_version (file, dir) - const char *file; - const char *dir; +max_backup_version (const char *file, const char *dir) { DIR *dirp; struct dirent *dp; @@ -197,10 +193,7 @@ max_backup_version (file, dir) */ static int -version_number (base, backup, base_length) - const char *base; - const char *backup; - size_t base_length; +version_number (const char *base, const char *backup, size_t base_length) { int version; const char *p; @@ -244,9 +237,7 @@ static const enum backup_type backup_types[] = for the specified CONTEXT. Unambiguous abbreviations are accepted. */ enum backup_type -get_version (context, version) - const char *context; - const char *version; +get_version (const char *context, const char *version) { if (version == 0 || *version == 0) return numbered_existing; @@ -262,9 +253,7 @@ get_version (context, version) Unambiguous abbreviations are accepted. */ enum backup_type -xget_version (context, version) - const char *context; - const char *version; +xget_version (const char *context, const char *version) { if (version && *version) return get_version (context, version); diff --git a/lib/backupfile.h b/lib/backupfile.h index b06116157..55ac68271 100644 --- a/lib/backupfile.h +++ b/lib/backupfile.h @@ -1,5 +1,5 @@ /* backupfile.h -- declarations for making Emacs style backup file names - Copyright (C) 1990-1992, 1997-1999, 2001 Free Software Foundation, Inc. + Copyright (C) 1990-1992, 1997-1999, 2001-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -44,20 +44,10 @@ enum backup_type extern char const *simple_backup_suffix; -# ifndef PARAMS -# if defined PROTOTYPES || (defined __STDC__ && __STDC__) -# define PARAMS(Args) Args -# else -# define PARAMS(Args) () -# endif -# endif - -extern char *find_backup_file_name PARAMS ((char const *file, - enum backup_type backup_type)); -extern enum backup_type get_version PARAMS ((char const *context, - char const *arg)); -extern enum backup_type xget_version PARAMS ((char const *context, - char const *arg)); -extern void addext PARAMS ((char *, char const *, int)); +extern char *find_backup_file_name (char const *file, + enum backup_type backup_type); +extern enum backup_type get_version (char const *context, char const *arg); +extern enum backup_type xget_version (char const *context, char const *arg); +extern void addext (char *filename, char const *ext, char e); #endif /* ! BACKUPFILE_H_ */ diff --git a/lib/basename.c b/lib/basename.c index 6daf723a5..5c5894122 100644 --- a/lib/basename.c +++ b/lib/basename.c @@ -61,8 +61,7 @@ If NAME is all slashes, be sure to return `/'. */ char * -basename (name) - char const *name; +basename (char const *name) { char const *base = name += FILESYSTEM_PREFIX_LEN (name); int all_slashes = 1; diff --git a/lib/basename.h b/lib/basename.h index 38530ec1f..03059582b 100644 --- a/lib/basename.h +++ b/lib/basename.h @@ -25,7 +25,7 @@ #if !(__GLIBC__ >= 2) /* When not using the GNU libc we use the basename implementation we provide here. */ -extern char *gnu_basename PARAMS ((const char *)); +extern char *gnu_basename (const char *); #define basename(Arg) gnu_basename (Arg) #endif diff --git a/lib/c-ctype.c b/lib/c-ctype.c index f918dc6d6..b8452060d 100644 --- a/lib/c-ctype.c +++ b/lib/c-ctype.c @@ -38,15 +38,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* The function isascii is not locale dependent. Its use in EBCDIC is questionable. */ bool -c_isascii (c) - int c; +c_isascii (int c) { return ((c & ~0x7f) == 0); } bool -c_isalnum (c) - int c; +c_isalnum (int c) { #if C_CTYPE_CONSECUTIVE_DIGITS \ && C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE @@ -76,8 +74,7 @@ c_isalnum (c) } bool -c_isalpha (c) - int c; +c_isalpha (int c) { #if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE return ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')); @@ -102,15 +99,13 @@ c_isalpha (c) } bool -c_isblank (c) - int c; +c_isblank (int c) { return (c == ' ' || c == '\t'); } bool -c_iscntrl (c) - int c; +c_iscntrl (int c) { #if C_CTYPE_ASCII return ((c & ~0x1f) == 0 || c == 0x7f); @@ -144,8 +139,7 @@ c_iscntrl (c) } bool -c_isdigit (c) - int c; +c_isdigit (int c) { #if C_CTYPE_CONSECUTIVE_DIGITS return (c >= '0' && c <= '9'); @@ -162,8 +156,7 @@ c_isdigit (c) } bool -c_islower (c) - int c; +c_islower (int c) { #if C_CTYPE_CONSECUTIVE_LOWERCASE return (c >= 'a' && c <= 'z'); @@ -183,8 +176,7 @@ c_islower (c) } bool -c_isgraph (c) - int c; +c_isgraph (int c) { #if C_CTYPE_ASCII return (c >= '!' && c <= '~'); @@ -218,8 +210,7 @@ c_isgraph (c) } bool -c_isprint (c) - int c; +c_isprint (int c) { #if C_CTYPE_ASCII return (c >= ' ' && c <= '~'); @@ -253,8 +244,7 @@ c_isprint (c) } bool -c_ispunct (c) - int c; +c_ispunct (int c) { #if C_CTYPE_ASCII return ((c >= '!' && c <= '~') @@ -279,16 +269,14 @@ c_ispunct (c) } bool -c_isspace (c) - int c; +c_isspace (int c) { return (c == ' ' || c == '\t' || c == '\n' || c == '\v' || c == '\f' || c == '\r'); } bool -c_isupper (c) - int c; +c_isupper (int c) { #if C_CTYPE_CONSECUTIVE_UPPERCASE return (c >= 'A' && c <= 'Z'); @@ -308,8 +296,7 @@ c_isupper (c) } bool -c_isxdigit (c) - int c; +c_isxdigit (int c) { #if C_CTYPE_CONSECUTIVE_DIGITS \ && C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE @@ -331,8 +318,7 @@ c_isxdigit (c) } int -c_tolower (c) - int c; +c_tolower (int c) { #if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE return (c >= 'A' && c <= 'Z' ? c - 'A' + 'a' : c); @@ -371,8 +357,7 @@ c_tolower (c) } int -c_toupper (c) - int c; +c_toupper (int c) { #if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE return (c >= 'a' && c <= 'z' ? c - 'a' + 'A' : c); diff --git a/lib/c-ctype.h b/lib/c-ctype.h index 929b14ec1..104d7dae2 100644 --- a/lib/c-ctype.h +++ b/lib/c-ctype.h @@ -24,14 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef C_CTYPE_H #define C_CTYPE_H -#ifndef PARAMS -# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES -# define PARAMS(args) args -# else -# define PARAMS(args) () -# endif -#endif - #include @@ -100,23 +92,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Function declarations. */ -extern bool c_isascii PARAMS ((int c)); /* not locale dependent */ - -extern bool c_isalnum PARAMS ((int c)); -extern bool c_isalpha PARAMS ((int c)); -extern bool c_isblank PARAMS ((int c)); -extern bool c_iscntrl PARAMS ((int c)); -extern bool c_isdigit PARAMS ((int c)); -extern bool c_islower PARAMS ((int c)); -extern bool c_isgraph PARAMS ((int c)); -extern bool c_isprint PARAMS ((int c)); -extern bool c_ispunct PARAMS ((int c)); -extern bool c_isspace PARAMS ((int c)); -extern bool c_isupper PARAMS ((int c)); -extern bool c_isxdigit PARAMS ((int c)); - -extern int c_tolower PARAMS ((int c)); -extern int c_toupper PARAMS ((int c)); +extern bool c_isascii (int c); /* not locale dependent */ + +extern bool c_isalnum (int c); +extern bool c_isalpha (int c); +extern bool c_isblank (int c); +extern bool c_iscntrl (int c); +extern bool c_isdigit (int c); +extern bool c_islower (int c); +extern bool c_isgraph (int c); +extern bool c_isprint (int c); +extern bool c_ispunct (int c); +extern bool c_isspace (int c); +extern bool c_isupper (int c); +extern bool c_isxdigit (int c); + +extern int c_tolower (int c); +extern int c_toupper (int c); #if defined __GNUC__ && defined __OPTIMIZE__ && !defined __OPTIMIZE_SIZE__ diff --git a/lib/classpath.c b/lib/classpath.c index 949702a21..a58924f29 100644 --- a/lib/classpath.c +++ b/lib/classpath.c @@ -1,5 +1,5 @@ /* Java CLASSPATH handling. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -27,26 +27,12 @@ #endif -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static char * new_classpath PARAMS ((const char * const *classpaths, - unsigned int classpaths_count, - bool use_minimal_classpath)); -static char * set_classpath PARAMS ((const char * const *classpaths, - unsigned int classpaths_count, - bool use_minimal_classpath, - bool verbose)); -static void reset_classpath PARAMS ((char *old_classpath)); - - /* Return the new CLASSPATH value. The given classpaths are prepended to the current CLASSPATH value. If use_minimal_classpath, the current CLASSPATH is ignored. */ static char * -new_classpath (classpaths, classpaths_count, use_minimal_classpath) - const char * const *classpaths; - unsigned int classpaths_count; - bool use_minimal_classpath; +new_classpath (const char * const *classpaths, unsigned int classpaths_count, + bool use_minimal_classpath) { const char *old_classpath; unsigned int length; @@ -90,11 +76,8 @@ new_classpath (classpaths, classpaths_count, use_minimal_classpath) /* Set CLASSPATH and returns a safe copy of its old value. */ static char * -set_classpath (classpaths, classpaths_count, use_minimal_classpath, verbose) - const char * const *classpaths; - unsigned int classpaths_count; - bool use_minimal_classpath; - bool verbose; +set_classpath (const char * const *classpaths, unsigned int classpaths_count, + bool use_minimal_classpath, bool verbose) { const char *old_CLASSPATH = getenv ("CLASSPATH"); char *result = (old_CLASSPATH != NULL ? xstrdup (old_CLASSPATH) : NULL); @@ -113,8 +96,7 @@ set_classpath (classpaths, classpaths_count, use_minimal_classpath, verbose) /* Restore CLASSPATH to its previous value. */ static void -reset_classpath (old_classpath) - char *old_classpath; +reset_classpath (char *old_classpath) { if (old_classpath != NULL) { diff --git a/lib/concatpath.c b/lib/concatpath.c index 88c2864f8..d57f96510 100644 --- a/lib/concatpath.c +++ b/lib/concatpath.c @@ -1,5 +1,5 @@ /* Construct a full pathname from a directory and a filename. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the @@ -35,10 +35,8 @@ argument may not start with the directory separator (it is relative). Return a freshly allocated pathname. */ char * -concatenated_pathname (directory, filename, suffix) - const char *directory; - const char *filename; - const char *suffix; +concatenated_pathname (const char *directory, const char *filename, + const char *suffix) { char *result; char *p; diff --git a/lib/copy-file.c b/lib/copy-file.c index 07697ab2d..d1c194e8e 100644 --- a/lib/copy-file.c +++ b/lib/copy-file.c @@ -1,5 +1,5 @@ /* Copying of files. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -45,9 +45,7 @@ #define _(str) gettext (str) void -copy_file (src_filename, dest_filename) - const char *src_filename; - const char *dest_filename; +copy_file (const char *src_filename, const char *dest_filename) { int src_fd; struct stat statbuf; diff --git a/lib/copy-file.h b/lib/copy-file.h index e0958bdeb..1608ab70c 100644 --- a/lib/copy-file.h +++ b/lib/copy-file.h @@ -1,5 +1,5 @@ /* Copying of files. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -19,5 +19,4 @@ /* Copy a regular file: from src_filename to dest_filename. The destination file is assumed to be a backup file. Exit upon failure. */ -extern void copy_file PARAMS ((const char *src_filename, - const char *dest_filename)); +extern void copy_file (const char *src_filename, const char *dest_filename); diff --git a/lib/execute.c b/lib/execute.c index 6b11c7f00..0c5bcaaa9 100644 --- a/lib/execute.c +++ b/lib/execute.c @@ -1,5 +1,5 @@ /* Creation of autonomous subprocesses. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -59,17 +59,6 @@ #define _(str) gettext (str) -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -#ifdef EINTR -static inline int nonintr_close PARAMS ((int fd)); -# ifdef __GNUC__ -static inline int nonintr_open PARAMS ((const char *pathname, int oflag, - mode_t mode)); -# endif -#endif - - #ifdef EINTR /* EINTR handling for close(), open(). @@ -77,8 +66,7 @@ static inline int nonintr_open PARAMS ((const char *pathname, int oflag, signal handlers set up, namely when we get interrupted via SIGSTOP. */ static inline int -nonintr_close (fd) - int fd; +nonintr_close (int fd) { int retval; @@ -91,10 +79,7 @@ nonintr_close (fd) #define close nonintr_close static inline int -nonintr_open (pathname, oflag, mode) - const char *pathname; - int oflag; - mode_t mode; +nonintr_open (const char *pathname, int oflag, mode_t mode) { int retval; @@ -114,14 +99,10 @@ nonintr_open (pathname, oflag, mode) If it didn't terminate correctly, exit if exit_on_error is true, otherwise return 127. */ int -execute (progname, prog_path, prog_argv, null_stdin, null_stdout, null_stderr, exit_on_error) - const char *progname; - const char *prog_path; - char **prog_argv; - bool null_stdin; - bool null_stdout; - bool null_stderr; - bool exit_on_error; +execute (const char *progname, + const char *prog_path, char **prog_argv, + bool null_stdin, bool null_stdout, bool null_stderr, + bool exit_on_error) { /* Note about 127: Some errors during posix_spawnp() cause the function posix_spawnp() to return an error code; some other errors cause the diff --git a/lib/execute.h b/lib/execute.h index ac0fbeddb..5915dc4fd 100644 --- a/lib/execute.h +++ b/lib/execute.h @@ -1,5 +1,5 @@ /* Creation of autonomous subprocesses. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -25,10 +25,9 @@ descriptors to /dev/null. Return its exit code. If it didn't terminate correctly, exit if exit_on_error is true, otherwise return 127. */ -extern int execute PARAMS ((const char *progname, - const char *prog_path, char **prog_argv, - bool null_stdin, - bool null_stdout, bool null_stderr, - bool exit_on_error)); +extern int execute (const char *progname, + const char *prog_path, char **prog_argv, + bool null_stdin, bool null_stdout, bool null_stderr, + bool exit_on_error); #endif /* _EXECUTE_H */ diff --git a/lib/findprog.c b/lib/findprog.c index 571ed4740..af0a40573 100644 --- a/lib/findprog.c +++ b/lib/findprog.c @@ -1,5 +1,5 @@ /* Locating a program in PATH. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -36,8 +36,7 @@ const char * -find_in_path (progname) - const char *progname; +find_in_path (const char *progname) { #if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ /* Win32, OS/2, DOS */ diff --git a/lib/findprog.h b/lib/findprog.h index 3a0d13526..713f028ad 100644 --- a/lib/findprog.h +++ b/lib/findprog.h @@ -1,5 +1,5 @@ /* Locating a program in PATH. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -21,4 +21,4 @@ of PROGNAME. If successful, return a pathname containing a slash (either absolute or relative to the current directory). Otherwise, return PROGNAME unmodified. */ -extern const char *find_in_path PARAMS ((const char *progname)); +extern const char *find_in_path (const char *progname); diff --git a/lib/fstrcmp.c b/lib/fstrcmp.c index ef73d1f18..369319af9 100644 --- a/lib/fstrcmp.c +++ b/lib/fstrcmp.c @@ -1,5 +1,5 @@ /* Functions to make fuzzy comparisons between strings - Copyright (C) 1988-1989, 1992-1993, 1995, 2001 Free Software Foundation, Inc. + Copyright (C) 1988-1989, 1992-1993, 1995, 2001-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -147,16 +147,9 @@ struct partition cause suboptimal diff output. It cannot cause incorrect diff output. */ -static int diag PARAMS ((int, int, int, int, int, struct partition *)); - static int -diag (xoff, xlim, yoff, ylim, minimal, part) - int xoff; - int xlim; - int yoff; - int ylim; - int minimal; - struct partition *part; +diag (int xoff, int xlim, int yoff, int ylim, int minimal, + struct partition *part) { int *const fd = fdiag; /* Give the compiler a chance. */ int *const bd = bdiag; /* Additional help for the compiler. */ @@ -474,15 +467,8 @@ diag (xoff, xlim, yoff, ylim, minimal, part) If MINIMAL is nonzero, find a minimal difference no matter how expensive it is. */ -static void compareseq PARAMS ((int, int, int, int, int)); - static void -compareseq (xoff, xlim, yoff, ylim, minimal) - int xoff; - int xlim; - int yoff; - int ylim; - int minimal; +compareseq (int xoff, int xlim, int yoff, int ylim, int minimal) { const char *const xv = string[0].data; /* Help the compiler. */ const char *const yv = string[1].data; @@ -570,9 +556,7 @@ compareseq (xoff, xlim, yoff, ylim, minimal) similar. */ double -fstrcmp (string1, string2) - const char *string1; - const char *string2; +fstrcmp (const char *string1, const char *string2) { int i; diff --git a/lib/fstrcmp.h b/lib/fstrcmp.h index 422f650cf..fa3f1bbe5 100644 --- a/lib/fstrcmp.h +++ b/lib/fstrcmp.h @@ -1,5 +1,5 @@ /* GNU gettext - internationalization aids - Copyright (C) 1995, 2000 Free Software Foundation, Inc. + Copyright (C) 1995, 2000, 2002 Free Software Foundation, Inc. This file was written by Peter Miller @@ -20,6 +20,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _FSTRCMP_H #define _FSTRCMP_H -extern double fstrcmp PARAMS ((const char *__s1, const char *__s2)); +extern double fstrcmp (const char *__s1, const char *__s2); #endif diff --git a/lib/full-write.c b/lib/full-write.c index bb784ac40..2d38878b8 100644 --- a/lib/full-write.c +++ b/lib/full-write.c @@ -1,5 +1,5 @@ /* full-write.c -- an interface to write that retries after interrupts - Copyright (C) 1993-1994, 1997-1998, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1993-1994, 1997-1998, 2000-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -40,10 +40,7 @@ extern int errno; Return LEN upon success, write's (negative) error code otherwise. */ ssize_t -full_write (desc, ptr, len) - int desc; - const char *ptr; - size_t len; +full_write (int desc, const char *ptr, size_t len) { int total_written; diff --git a/lib/full-write.h b/lib/full-write.h index d7070a2f0..5747855a6 100644 --- a/lib/full-write.h +++ b/lib/full-write.h @@ -1,5 +1,5 @@ /* write() wrapper. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -24,4 +24,4 @@ /* Write LEN bytes at PTR to descriptor DESC, retrying if interrupted. Return LEN upon success, write's (negative) error code otherwise. */ -extern ssize_t full_write PARAMS ((int desc, const char *ptr, size_t len)); +extern ssize_t full_write (int desc, const char *ptr, size_t len); diff --git a/lib/gcd.c b/lib/gcd.c index 4d9e88f2d..3a14e5012 100644 --- a/lib/gcd.c +++ b/lib/gcd.c @@ -1,5 +1,5 @@ /* Arithmetic. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -23,9 +23,7 @@ /* Return the greatest common divisor of a > 0 and b > 0. */ unsigned int -gcd (a, b) - unsigned int a; - unsigned int b; +gcd (unsigned int a, unsigned int b) { /* Why no division, as in Euclid's algorithm? Because in Euclid's algorithm the division result floor(a/b) or floor(b/a) is very often = 1 or = 2, diff --git a/lib/gcd.h b/lib/gcd.h index 37ff21ea5..6be393383 100644 --- a/lib/gcd.h +++ b/lib/gcd.h @@ -1,5 +1,5 @@ /* Arithmetic. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -19,15 +19,7 @@ #ifndef _GCD_H #define _GCD_H -#ifndef PARAMS -# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES -# define PARAMS(args) args -# else -# define PARAMS(args) () -# endif -#endif - /* Return the greatest common divisor of a > 0 and b > 0. */ -extern unsigned int gcd PARAMS ((unsigned int a, unsigned int b)); +extern unsigned int gcd (unsigned int a, unsigned int b); #endif /* _GCD_H */ diff --git a/lib/getline.c b/lib/getline.c index 86bba0d09..29efa2742 100644 --- a/lib/getline.c +++ b/lib/getline.c @@ -36,10 +36,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #if defined __GNU_LIBRARY__ && HAVE_GETDELIM int -getline (lineptr, n, stream) - char **lineptr; - size_t *n; - FILE *stream; +getline (char **lineptr, size_t *n, FILE *stream) { return getdelim (lineptr, n, '\n', stream); } @@ -66,12 +63,8 @@ extern char *realloc (); NOTE: There is another getstr() function declared in . */ static int -getstr (lineptr, n, stream, terminator, offset) - char **lineptr; - size_t *n; - FILE *stream; - char terminator; - size_t offset; +getstr (char **lineptr, size_t *n, FILE *stream, char terminator, + size_t offset) { int nchars_avail; /* Allocated but unused chars in *LINEPTR. */ char *read_pos; /* Where we're reading into *LINEPTR. */ @@ -140,20 +133,13 @@ getstr (lineptr, n, stream, terminator, offset) } int -getline (lineptr, n, stream) - char **lineptr; - size_t *n; - FILE *stream; +getline (char **lineptr, size_t *n, FILE *stream) { return getstr (lineptr, n, stream, '\n', 0); } int -getdelim (lineptr, n, delimiter, stream) - char **lineptr; - size_t *n; - int delimiter; - FILE *stream; +getdelim (char **lineptr, size_t *n, int delimiter, FILE *stream) { return getstr (lineptr, n, stream, delimiter, 0); } diff --git a/lib/getline.h b/lib/getline.h index 6eb59c6e1..e0fe87ea3 100644 --- a/lib/getline.h +++ b/lib/getline.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1995, 2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1995, 2000-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,22 +20,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ # include # include -# ifndef PARAMS -# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES -# define PARAMS(args) args -# else -# define PARAMS(args) () -# endif -# endif - /* glibc2 has these functions declared in . Avoid redeclarations. */ # if __GLIBC__ < 2 int -getline PARAMS ((char **_lineptr, size_t *_n, FILE *_stream)); +getline (char **_lineptr, size_t *_n, FILE *_stream); int -getdelim PARAMS ((char **_lineptr, size_t *_n, int _delimiter, FILE *_stream)); +getdelim (char **_lineptr, size_t *_n, int _delimiter, FILE *_stream); # endif diff --git a/lib/hash.c b/lib/hash.c index 382d0be17..5eb480fbf 100644 --- a/lib/hash.c +++ b/lib/hash.c @@ -1,5 +1,5 @@ /* hash - implement simple hashing table with string based keys. - Copyright (C) 1994, 1995, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1994-1995, 2000-2002 Free Software Foundation, Inc. Written by Ulrich Drepper , October 1994. This program is free software; you can redistribute it and/or modify @@ -77,22 +77,19 @@ typedef struct hash_entry } hash_entry; -/* Prototypes for local functions. */ -static void insert_entry_2 PARAMS ((hash_table *htab, - const void *key, size_t keylen, - unsigned long int hval, size_t idx, - void *data)); -static size_t lookup PARAMS ((hash_table *htab, - const void *key, size_t keylen, - unsigned long int hval)); -static unsigned long compute_hashval PARAMS ((const void *key, size_t keylen)); -static int is_prime PARAMS ((unsigned long int candidate)); +/* Forward declaration of local functions. */ +static void insert_entry_2 (hash_table *htab, + const void *key, size_t keylen, + unsigned long int hval, size_t idx, void *data); +static size_t lookup (hash_table *htab, + const void *key, size_t keylen, + unsigned long int hval); +static unsigned long compute_hashval (const void *key, size_t keylen); +static int is_prime (unsigned long int candidate); int -init_hash (htab, init_size) - hash_table *htab; - unsigned long int init_size; +init_hash (hash_table *htab, unsigned long int init_size) { /* We need the size to be a prime. */ init_size = next_prime (init_size); @@ -110,8 +107,7 @@ init_hash (htab, init_size) int -delete_hash (htab) - hash_table *htab; +delete_hash (hash_table *htab) { free (htab->table); obstack_free (&htab->mem_pool, NULL); @@ -120,11 +116,7 @@ delete_hash (htab) int -insert_entry (htab, key, keylen, data) - hash_table *htab; - const void *key; - size_t keylen; - void *data; +insert_entry (hash_table *htab, const void *key, size_t keylen, void *data) { unsigned long int hval = compute_hashval (key, keylen); hash_entry *table = (hash_entry *) htab->table; @@ -143,13 +135,9 @@ insert_entry (htab, key, keylen, data) } static void -insert_entry_2 (htab, key, keylen, hval, idx, data) - hash_table *htab; - const void *key; - size_t keylen; - unsigned long int hval; - size_t idx; - void *data; +insert_entry_2 (hash_table *htab, + const void *key, size_t keylen, + unsigned long int hval, size_t idx, void *data) { hash_entry *table = (hash_entry *) htab->table; @@ -196,11 +184,7 @@ insert_entry_2 (htab, key, keylen, hval, idx, data) int -find_entry (htab, key, keylen, result) - hash_table *htab; - const void *key; - size_t keylen; - void **result; +find_entry (hash_table *htab, const void *key, size_t keylen, void **result) { hash_entry *table = (hash_entry *) htab->table; size_t idx = lookup (htab, key, keylen, compute_hashval (key, keylen)); @@ -214,12 +198,8 @@ find_entry (htab, key, keylen, result) int -iterate_table (htab, ptr, key, keylen, data) - hash_table *htab; - void **ptr; - const void **key; - size_t *keylen; - void **data; +iterate_table (hash_table *htab, void **ptr, const void **key, size_t *keylen, + void **data) { if (*ptr == NULL) { @@ -246,11 +226,9 @@ iterate_table (htab, ptr, key, keylen, data) [Knuth] The Art of Computer Programming, part3 (6.4) */ static size_t -lookup (htab, key, keylen, hval) - hash_table *htab; - const void *key; - size_t keylen; - unsigned long int hval; +lookup (hash_table *htab, + const void *key, size_t keylen, + unsigned long int hval) { unsigned long int hash; size_t idx; @@ -289,9 +267,7 @@ lookup (htab, key, keylen, hval) static unsigned long -compute_hashval (key, keylen) - const void *key; - size_t keylen; +compute_hashval (const void *key, size_t keylen) { size_t cnt; unsigned long int hval; @@ -310,8 +286,7 @@ compute_hashval (key, keylen) unsigned long -next_prime (seed) - unsigned long int seed; +next_prime (unsigned long int seed) { /* Make it definitely odd. */ seed |= 1; @@ -324,8 +299,7 @@ next_prime (seed) static int -is_prime (candidate) - unsigned long int candidate; +is_prime (unsigned long int candidate) { /* No even number and none less than 10 will be passed here. */ unsigned long int divn = 3; diff --git a/lib/hash.h b/lib/hash.h index d568c11e9..10e512c9d 100644 --- a/lib/hash.h +++ b/lib/hash.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1995, 2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1995, 2000-2002 Free Software Foundation, Inc. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as @@ -30,27 +30,19 @@ typedef struct hash_table } hash_table; -# ifndef PARAMS -# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES -# define PARAMS(Args) Args -# else -# define PARAMS(Args) () -# endif -# endif - -extern int init_hash PARAMS ((hash_table *htab, unsigned long int init_size)); -extern int delete_hash PARAMS ((hash_table *htab)); -extern int insert_entry PARAMS ((hash_table *htab, - const void *key, size_t keylen, - void *data)); -extern int find_entry PARAMS ((hash_table *htab, - const void *key, size_t keylen, - void **result)); - -extern int iterate_table PARAMS ((hash_table *htab, void **ptr, - const void **key, size_t *keylen, - void **data)); - -extern unsigned long int next_prime PARAMS ((unsigned long int seed)); +extern int init_hash (hash_table *htab, unsigned long int init_size); +extern int delete_hash (hash_table *htab); +extern int insert_entry (hash_table *htab, + const void *key, size_t keylen, + void *data); +extern int find_entry (hash_table *htab, + const void *key, size_t keylen, + void **result); + +extern int iterate_table (hash_table *htab, void **ptr, + const void **key, size_t *keylen, + void **data); + +extern unsigned long int next_prime (unsigned long int seed); #endif /* not _HASH_H */ diff --git a/lib/javacomp.c b/lib/javacomp.c index 83a6dd6f9..46164b0f1 100644 --- a/lib/javacomp.c +++ b/lib/javacomp.c @@ -80,18 +80,14 @@ */ bool -compile_java_class (java_sources, java_sources_count, - classpaths, classpaths_count, - directory, optimize, debug, use_minimal_classpath, verbose) - const char * const *java_sources; - unsigned int java_sources_count; - const char * const *classpaths; - unsigned int classpaths_count; - const char *directory; - bool optimize; - bool debug; - bool use_minimal_classpath; - bool verbose; +compile_java_class (const char * const *java_sources, + unsigned int java_sources_count, + const char * const *classpaths, + unsigned int classpaths_count, + const char *directory, + bool optimize, bool debug, + bool use_minimal_classpath, + bool verbose) { bool err = false; char *old_JAVA_HOME; diff --git a/lib/javacomp.h b/lib/javacomp.h index 83c435c16..0294d552e 100644 --- a/lib/javacomp.h +++ b/lib/javacomp.h @@ -1,5 +1,5 @@ /* Compile a Java program. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -33,13 +33,13 @@ Java version. If verbose, the command to be executed will be printed. Return false if OK, true on error. */ -extern bool compile_java_class PARAMS ((const char * const *java_sources, - unsigned int java_sources_count, - const char * const *classpaths, - unsigned int classpaths_count, - const char *directory, - bool optimize, bool debug, - bool use_minimal_classpath, - bool verbose)); +extern bool compile_java_class (const char * const *java_sources, + unsigned int java_sources_count, + const char * const *classpaths, + unsigned int classpaths_count, + const char *directory, + bool optimize, bool debug, + bool use_minimal_classpath, + bool verbose); #endif /* _JAVACOMP_H */ diff --git a/lib/javaexec.c b/lib/javaexec.c index 092396c6e..fd82b549b 100644 --- a/lib/javaexec.c +++ b/lib/javaexec.c @@ -74,22 +74,14 @@ */ bool -execute_java_class (class_name, - classpaths, classpaths_count, use_minimal_classpath, - exe_dir, - args, - verbose, quiet, - executer, private_data) - const char *class_name; - const char * const *classpaths; - unsigned int classpaths_count; - bool use_minimal_classpath; - const char *exe_dir; - const char * const *args; - bool verbose; - bool quiet; - execute_fn *executer; - void *private_data; +execute_java_class (const char *class_name, + const char * const *classpaths, + unsigned int classpaths_count, + bool use_minimal_classpath, + const char *exe_dir, + const char * const *args, + bool verbose, bool quiet, + execute_fn *executer, void *private_data) { bool err = false; unsigned int nargs; diff --git a/lib/javaexec.h b/lib/javaexec.h index 9f33aacfe..ac2e8ae2e 100644 --- a/lib/javaexec.h +++ b/lib/javaexec.h @@ -21,9 +21,9 @@ #include -typedef bool execute_fn PARAMS ((const char *progname, - const char *prog_path, char **prog_argv, - void *private_data)); +typedef bool execute_fn (const char *progname, + const char *prog_path, char **prog_argv, + void *private_data); /* Execute a Java class. class_name is the Java class name to be executed. @@ -39,14 +39,13 @@ typedef bool execute_fn PARAMS ((const char *progname, private_data argument. This function returns false if OK, true on error. Return false if OK, true on error. If quiet, error messages will not be printed. */ -extern bool execute_java_class PARAMS ((const char *class_name, - const char * const *classpaths, - unsigned int classpaths_count, - bool use_minimal_classpath, - const char *exe_dir, - const char * const *args, - bool verbose, bool quiet, - execute_fn *executer, - void *private_data)); +extern bool execute_java_class (const char *class_name, + const char * const *classpaths, + unsigned int classpaths_count, + bool use_minimal_classpath, + const char *exe_dir, + const char * const *args, + bool verbose, bool quiet, + execute_fn *executer, void *private_data); #endif /* _JAVAEXEC_H */ diff --git a/lib/libstdarg.h b/lib/libstdarg.h deleted file mode 100644 index 79c86daed..000000000 --- a/lib/libstdarg.h +++ /dev/null @@ -1,32 +0,0 @@ -/* with fallback on for old platforms. - Copyright (C) 2001-2002 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published - by the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - USA. */ - -#ifndef _LIBSTDARG_H -#define _LIBSTDARG_H - -#if __STDC__ || defined __SUNPRO_C || defined __cplusplus -# include -# define VA_START(args, lastarg) va_start (args, lastarg) -# define VA_PARAMS(stdc_params, oldc_params) stdc_params -#else -# include -# define VA_START(args, lastarg) va_start (args) -# define VA_PARAMS(stdc_params, oldc_params) oldc_params -#endif - -#endif /* _LIBSTDARG_H */ diff --git a/lib/linebreak.c b/lib/linebreak.c index f62826b2f..200272e88 100644 --- a/lib/linebreak.c +++ b/lib/linebreak.c @@ -33,10 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "utf16-ucs4.h" static inline int -u32_mbtouc (puc, s, n) - unsigned int *puc; - const unsigned int *s; - size_t n; +u32_mbtouc (unsigned int *puc, const unsigned int *s, size_t n) { *puc = *s; return 1; @@ -192,8 +189,7 @@ streq0 (const char *s1, const char *s2, char s20, char s21, char s22, char s23, static int -is_cjk_encoding (encoding) - const char *encoding; +is_cjk_encoding (const char *encoding) { if (0 /* Legacy Japanese encodings */ @@ -212,8 +208,7 @@ is_cjk_encoding (encoding) } static int -is_utf8_encoding (encoding) - const char *encoding; +is_utf8_encoding (const char *encoding) { if (STREQ (encoding, "UTF-8", 'U', 'T', 'F', '-', '8', 0, 0, 0 ,0)) return 1; @@ -222,7 +217,7 @@ is_utf8_encoding (encoding) /* Determine number of column positions required for UC. */ -int uc_width PARAMS ((unsigned int uc, const char *encoding)); +int uc_width (unsigned int uc, const char *encoding); /* * Non-spacing attribute table. @@ -415,9 +410,7 @@ static const signed char nonspacing_table_ind[240] = { /* Determine number of column positions required for UC. */ int -uc_width (uc, encoding) - unsigned int uc; - const char *encoding; +uc_width (unsigned int uc, const char *encoding) { /* Test for non-spacing or control character. */ if ((uc >> 9) < 240) @@ -469,10 +462,7 @@ uc_width (uc, encoding) (or fewer if S ends before this) in S. */ int -u8_width (s, n, encoding) - const unsigned char *s; - size_t n; - const char *encoding; +u8_width (const unsigned char *s, size_t n, const char *encoding) { const unsigned char *s_end = s + n; int width = 0; @@ -496,10 +486,7 @@ u8_width (s, n, encoding) } int -u16_width (s, n, encoding) - const unsigned short *s; - size_t n; - const char *encoding; +u16_width (const unsigned short *s, size_t n, const char *encoding) { const unsigned short *s_end = s + n; int width = 0; @@ -523,10 +510,7 @@ u16_width (s, n, encoding) } int -u32_width (s, n, encoding) - const unsigned int *s; - size_t n; - const char *encoding; +u32_width (const unsigned int *s, size_t n, const char *encoding) { const unsigned int *s_end = s + n; int width = 0; @@ -593,8 +577,7 @@ enum #include "lbrkprop.h" static inline unsigned char -lbrkprop_lookup (uc) - unsigned int uc; +lbrkprop_lookup (unsigned int uc) { unsigned int index1 = uc >> lbrkprop_header_0; if (index1 < lbrkprop_header_1) @@ -647,11 +630,7 @@ static const unsigned char lbrk_table[19][19] = { /* Note: The (PR,ID) entry should probably be D instead of I. */ void -u8_possible_linebreaks (s, n, encoding, p) - const unsigned char *s; - size_t n; - const char *encoding; - char *p; +u8_possible_linebreaks (const unsigned char *s, size_t n, const char *encoding, char *p) { int LBP_AI_REPLACEMENT = (is_cjk_encoding (encoding) ? LBP_ID : LBP_AL); const unsigned char *s_end = s + n; @@ -765,11 +744,7 @@ u8_possible_linebreaks (s, n, encoding, p) #ifdef unused void -u16_possible_linebreaks (s, n, encoding, p) - const unsigned short *s; - size_t n; - const char *encoding; - char *p; +u16_possible_linebreaks (const unsigned short *s, size_t n, const char *encoding, char *p) { int LBP_AI_REPLACEMENT = (is_cjk_encoding (encoding) ? LBP_ID : LBP_AL); const unsigned short *s_end = s + n; @@ -881,11 +856,7 @@ u16_possible_linebreaks (s, n, encoding, p) } void -u32_possible_linebreaks (s, n, encoding, p) - const unsigned int *s; - size_t n; - const char *encoding; - char *p; +u32_possible_linebreaks (const unsigned int *s, size_t n, const char *encoding, char *p) { int LBP_AI_REPLACEMENT = (is_cjk_encoding (encoding) ? LBP_ID : LBP_AL); const unsigned int *s_end = s + n; @@ -999,15 +970,10 @@ u32_possible_linebreaks (s, n, encoding, p) Return the column after the end of the string. */ int -u8_width_linebreaks (s, n, width, start_column, at_end_columns, o, encoding, p) - const unsigned char *s; - size_t n; - int width; - int start_column; - int at_end_columns; - const char *o; - const char *encoding; - char *p; +u8_width_linebreaks (const unsigned char *s, size_t n, + int width, int start_column, int at_end_columns, + const char *o, const char *encoding, + char *p) { const unsigned char *s_end; char *last_p; @@ -1090,15 +1056,10 @@ u8_width_linebreaks (s, n, width, start_column, at_end_columns, o, encoding, p) #ifdef unused int -u16_width_linebreaks (s, n, width, start_column, at_end_columns, o, encoding, p) - const unsigned short *s; - size_t n; - int width; - int start_column; - int at_end_columns; - const char *o; - const char *encoding; - char *p; +u16_width_linebreaks (const unsigned short *s, size_t n, + int width, int start_column, int at_end_columns, + const char *o, const char *encoding, + char *p) { const unsigned short *s_end; char *last_p; @@ -1179,15 +1140,10 @@ u16_width_linebreaks (s, n, width, start_column, at_end_columns, o, encoding, p) } int -u32_width_linebreaks (s, n, width, start_column, at_end_columns, o, encoding, p) - const unsigned int *s; - size_t n; - int width; - int start_column; - int at_end_columns; - const char *o; - const char *encoding; - char *p; +u32_width_linebreaks (const unsigned int *s, size_t n, + int width, int start_column, int at_end_columns, + const char *o, const char *encoding, + char *p) { const unsigned int *s_end; char *last_p; @@ -1276,8 +1232,7 @@ u32_width_linebreaks (s, n, width, start_column, at_end_columns, o, encoding, p) /* Read the contents of an input stream, and return it, terminated with a NUL byte. */ char * -read_file (stream) - FILE *stream; +read_file (FILE *stream) { #define BUFSIZE 4096 char *buf = NULL; @@ -1323,9 +1278,7 @@ read_file (stream) } int -main (argc, argv) - int argc; - char * argv[]; +main (int argc, char * argv[]) { if (argc == 1) { @@ -1423,10 +1376,7 @@ main (argc, argv) /* Return the length of a string after conversion through an iconv_t. */ static size_t -iconv_string_length (cd, s, n) - iconv_t cd; - const char *s; - size_t n; +iconv_string_length (iconv_t cd, const char *s, size_t n) { #define TMPBUFSIZE 4096 size_t count = 0; @@ -1461,13 +1411,8 @@ iconv_string_length (cd, s, n) } static void -iconv_string_keeping_offsets (cd, s, n, offtable, t, m) - iconv_t cd; - const char *s; - size_t n; - size_t *offtable; - char *t; - size_t m; +iconv_string_keeping_offsets (iconv_t cd, const char *s, size_t n, + size_t *offtable, char *t, size_t m) { size_t i; const char *s_end; @@ -1525,9 +1470,7 @@ iconv_string_keeping_offsets (cd, s, n, offtable, t, m) /* Tests whether a string is entirely ASCII. Returns 1 if yes. Returns 0 if the string is in an 8-bit encoding or an ISO-2022 encoding. */ static int -is_all_ascii (s, n) - const char *s; - size_t n; +is_all_ascii (const char *s, size_t n) { for (; n > 0; s++, n--) { @@ -1544,11 +1487,8 @@ is_all_ascii (s, n) #if defined unused || defined TEST2 void -mbs_possible_linebreaks (s, n, encoding, p) - const char *s; - size_t n; - const char *encoding; - char *p; +mbs_possible_linebreaks (const char *s, size_t n, const char *encoding, + char *p) { if (is_utf8_encoding (encoding)) u8_possible_linebreaks ((const unsigned char *) s, n, encoding, p); @@ -1626,15 +1566,10 @@ mbs_possible_linebreaks (s, n, encoding, p) #endif int -mbs_width_linebreaks (s, n, width, start_column, at_end_columns, o, encoding, p) - const char *s; - size_t n; - int width; - int start_column; - int at_end_columns; - const char *o; - const char *encoding; - char *p; +mbs_width_linebreaks (const char *s, size_t n, + int width, int start_column, int at_end_columns, + const char *o, const char *encoding, + char *p) { if (is_utf8_encoding (encoding)) return u8_width_linebreaks ((const unsigned char *) s, n, width, start_column, at_end_columns, o, encoding, p); @@ -1735,8 +1670,7 @@ mbs_width_linebreaks (s, n, width, start_column, at_end_columns, o, encoding, p) /* Read the contents of an input stream, and return it, terminated with a NUL byte. */ char * -read_file (stream) - FILE *stream; +read_file (FILE *stream) { #define BUFSIZE 4096 char *buf = NULL; @@ -1782,9 +1716,7 @@ read_file (stream) } int -main (argc, argv) - int argc; - char * argv[]; +main (int argc, char * argv[]) { setlocale (LC_CTYPE, ""); if (argc == 1) diff --git a/lib/linebreak.h b/lib/linebreak.h index 59b737187..93af62d9b 100644 --- a/lib/linebreak.h +++ b/lib/linebreak.h @@ -1,5 +1,5 @@ /* linebreak.h - line breaking of Unicode strings - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -19,14 +19,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _LINEBREAK_H #define _LINEBREAK_H -#ifndef PARAMS -# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES -# define PARAMS(args) args -# else -# define PARAMS(args) () -# endif -#endif - /* Get size_t. */ #include @@ -37,16 +29,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ the encoding (e.g. "ISO-8859-2" for Polish). */ /* Return the encoding of the current locale. */ -extern const char * locale_charset PARAMS ((void)); +extern const char * locale_charset (void); /* Determine number of column positions required for UC. */ -extern int uc_width PARAMS ((unsigned int uc, const char *encoding)); +extern int uc_width (unsigned int uc, const char *encoding); /* Determine number of column positions required for first N units (or fewer if S ends before this) in S. */ -extern int u8_width PARAMS ((const unsigned char *s, size_t n, const char *encoding)); -extern int u16_width PARAMS ((const unsigned short *s, size_t n, const char *encoding)); -extern int u32_width PARAMS ((const unsigned int *s, size_t n, const char *encoding)); +extern int u8_width (const unsigned char *s, size_t n, const char *encoding); +extern int u16_width (const unsigned short *s, size_t n, const char *encoding); +extern int u32_width (const unsigned int *s, size_t n, const char *encoding); /* Line breaking. */ @@ -68,20 +60,20 @@ enum { hyphenation rules. p[i] = UC_BREAK_PROHIBITED means that s[i-1] and s[i] must not be separated. */ -extern void u8_possible_linebreaks PARAMS ((const unsigned char *s, size_t n, const char *encoding, char *p)); -extern void u16_possible_linebreaks PARAMS ((const unsigned short *s, size_t n, const char *encoding, char *p)); -extern void u32_possible_linebreaks PARAMS ((const unsigned int *s, size_t n, const char *encoding, char *p)); -extern void mbs_possible_linebreaks PARAMS ((const char *s, size_t n, const char *encoding, char *p)); +extern void u8_possible_linebreaks (const unsigned char *s, size_t n, const char *encoding, char *p); +extern void u16_possible_linebreaks (const unsigned short *s, size_t n, const char *encoding, char *p); +extern void u32_possible_linebreaks (const unsigned int *s, size_t n, const char *encoding, char *p); +extern void mbs_possible_linebreaks (const char *s, size_t n, const char *encoding, char *p); /* Choose the best line breaks, assuming the uc_width function. Return the column after the end of the string. o is an optional override; if o[i] != UC_BREAK_UNDEFINED, o[i] takes precedence over p[i] as returned by the *_possible_linebreaks function. */ -extern int u8_width_linebreaks PARAMS ((const unsigned char *s, size_t n, int width, int start_column, int at_end_columns, const char *o, const char *encoding, char *p)); -extern int u16_width_linebreaks PARAMS ((const unsigned short *s, size_t n, int width, int start_column, int at_end_columns, const char *o, const char *encoding, char *p)); -extern int u32_width_linebreaks PARAMS ((const unsigned int *s, size_t n, int width, int start_column, int at_end_columns, const char *o, const char *encoding, char *p)); -extern int mbs_width_linebreaks PARAMS ((const char *s, size_t n, int width, int start_column, int at_end_columns, const char *o, const char *encoding, char *p)); +extern int u8_width_linebreaks (const unsigned char *s, size_t n, int width, int start_column, int at_end_columns, const char *o, const char *encoding, char *p); +extern int u16_width_linebreaks (const unsigned short *s, size_t n, int width, int start_column, int at_end_columns, const char *o, const char *encoding, char *p); +extern int u32_width_linebreaks (const unsigned int *s, size_t n, int width, int start_column, int at_end_columns, const char *o, const char *encoding, char *p); +extern int mbs_width_linebreaks (const char *s, size_t n, int width, int start_column, int at_end_columns, const char *o, const char *encoding, char *p); #endif /* _LINEBREAK_H */ diff --git a/lib/mbswidth.c b/lib/mbswidth.c index 9d5ebe74a..a2ef5b3fd 100644 --- a/lib/mbswidth.c +++ b/lib/mbswidth.c @@ -1,5 +1,5 @@ /* Determine the number of screen columns needed for a string. - Copyright (C) 2000-2001 Free Software Foundation, Inc. + Copyright (C) 2000-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -87,9 +87,7 @@ int wcwidth (); With flags = MBSW_REJECT_INVALID | MBSW_REJECT_UNPRINTABLE, this is the multibyte analogon of the wcswidth function. */ int -mbswidth (string, flags) - const char *string; - int flags; +mbswidth (const char *string, int flags) { return mbsnwidth (string, strlen (string), flags); } @@ -99,10 +97,7 @@ mbswidth (string, flags) non-printable character occurs, and MBSW_REJECT_UNPRINTABLE is specified, -1 is returned. */ int -mbsnwidth (string, nbytes, flags) - const char *string; - size_t nbytes; - int flags; +mbsnwidth (const char *string, size_t nbytes, int flags) { const char *p = string; const char *plimit = p + nbytes; diff --git a/lib/mbswidth.h b/lib/mbswidth.h index 1f9c66001..40d4cba04 100644 --- a/lib/mbswidth.h +++ b/lib/mbswidth.h @@ -1,5 +1,5 @@ /* Determine the number of screen columns needed for a string. - Copyright (C) 2000-2001 Free Software Foundation, Inc. + Copyright (C) 2000-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,14 +17,6 @@ #include -#ifndef PARAMS -# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES -# define PARAMS(Args) Args -# else -# define PARAMS(Args) () -# endif -#endif - /* Optional flags to influence mbswidth/mbsnwidth behavior. */ /* If this bit is set, return -1 upon finding an invalid or incomplete @@ -38,8 +30,8 @@ /* Returns the number of screen columns needed for STRING. */ #define mbswidth gnu_mbswidth /* avoid clash with UnixWare 7.1.1 function */ -extern int mbswidth PARAMS ((const char *string, int flags)); +extern int mbswidth (const char *string, int flags); /* Returns the number of screen columns needed for the NBYTES bytes starting at BUF. */ -extern int mbsnwidth PARAMS ((const char *buf, size_t nbytes, int flags)); +extern int mbsnwidth (const char *buf, size_t nbytes, int flags); diff --git a/lib/memmove.c b/lib/memmove.c index ea38e8df5..5d4af5d74 100644 --- a/lib/memmove.c +++ b/lib/memmove.c @@ -8,10 +8,7 @@ #endif void * -memmove (dest, source, length) - char *dest; - const char *source; - unsigned length; +memmove (char *dest, const char *source, unsigned length) { char *d0 = dest; if (source < dest) diff --git a/lib/memset.c b/lib/memset.c index a0db560a9..5e090b1ac 100644 --- a/lib/memset.c +++ b/lib/memset.c @@ -1,5 +1,5 @@ /* memset.c -- set an area of memory to a given value - Copyright (C) 1991 Free Software Foundation, Inc. + Copyright (C) 1991, 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,10 +16,7 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ char * -memset (str, c, len) - char *str; - int c; - unsigned len; +memset (char *str, int c, unsigned len) { register char *st = str; diff --git a/lib/mkdtemp.c b/lib/mkdtemp.c index 15081020d..93900a7f7 100644 --- a/lib/mkdtemp.c +++ b/lib/mkdtemp.c @@ -116,8 +116,7 @@ static const char letters[] = We use a clever algorithm to get hard-to-predict names. */ static int -gen_tempname (tmpl) - char *tmpl; +gen_tempname (char *tmpl) { int len; char *XXXXXX; @@ -191,8 +190,7 @@ gen_tempname (tmpl) The directory is created, mode 700, and its name is returned. (This function comes from OpenBSD.) */ char * -mkdtemp (template) - char *template; +mkdtemp (char *template) { if (gen_tempname (template)) return NULL; diff --git a/lib/mkdtemp.h b/lib/mkdtemp.h index dbc47ac36..65ee99eff 100644 --- a/lib/mkdtemp.h +++ b/lib/mkdtemp.h @@ -1,5 +1,5 @@ /* Creating a private temporary directory. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,14 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef PARAMS -# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES -# define PARAMS(Args) Args -# else -# define PARAMS(Args) () -# endif -#endif - #if HAVE_MKDTEMP /* Get mkdtemp() declaration. */ @@ -35,6 +27,6 @@ they are replaced with a string that makes the directory name unique. Returns TEMPLATE, or a null pointer if it cannot get a unique name. The directory is created mode 700. */ -extern char * mkdtemp PARAMS ((char *template)); +extern char * mkdtemp (char *template); #endif diff --git a/lib/pathname.h b/lib/pathname.h index d2a4c7578..7b817a4f7 100644 --- a/lib/pathname.h +++ b/lib/pathname.h @@ -1,5 +1,5 @@ /* Pathname support. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,14 +18,6 @@ #ifndef _PATHNAME_H #define _PATHNAME_H -#ifndef PARAMS -# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES -# define PARAMS(args) args -# else -# define PARAMS(args) () -# endif -#endif - /* Pathname support. ISSLASH(C) tests whether C is a directory separator character. IS_ABSOLUTE_PATH(P) tests whether P is an absolute path. If it is not, @@ -52,8 +44,7 @@ /* Concatenate a directory pathname, a relative pathname and an optional suffix. Return a freshly allocated pathname. */ -extern char *concatenated_pathname PARAMS ((const char *directory, - const char *filename, - const char *suffix)); +extern char *concatenated_pathname (const char *directory, + const char *filename, const char *suffix); #endif /* _PATHNAME_H */ diff --git a/lib/pfnmatch.c b/lib/pfnmatch.c index e2c897aa4..209d598b7 100644 --- a/lib/pfnmatch.c +++ b/lib/pfnmatch.c @@ -1,5 +1,5 @@ /* POSIX fnmatch(). - Copyright 1991-1993, 1996, 1997, 2000, 2001 Free Software Foundation, Inc. + Copyright 1991-1993, 1996-1997, 2000-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -33,10 +33,7 @@ /* Match STRING against the filename pattern PATTERN, returning zero if it matches, nonzero if not. */ int -fnmatch (pattern, string, flags) - const char *pattern; - const char *string; - int flags; +fnmatch (const char *pattern, const char *string, int flags) { register const char *p = pattern, *n = string; register char c; diff --git a/lib/pfnmatch.h b/lib/pfnmatch.h index 420024e20..c2d2a3639 100644 --- a/lib/pfnmatch.h +++ b/lib/pfnmatch.h @@ -1,5 +1,5 @@ /* POSIX . - Copyright (C) 1991-1993, 2001 Free Software Foundation, Inc. + Copyright (C) 1991-1993, 2001-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the @@ -22,14 +22,6 @@ extern "C" { #endif -#ifndef PARAMS -# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES -# define PARAMS(Args) Args -# else -# define PARAMS(Args) () -# endif -#endif - /* We #undef these before defining them because some losing systems (HP-UX A.08.07 for example) define these in . */ @@ -52,8 +44,7 @@ extern "C" { /* Match STRING against the filename pattern PATTERN, returning zero if it matches, FNM_NOMATCH if not. */ -extern int fnmatch PARAMS ((const char *__pattern, const char *__string, - int __flags)); +extern int fnmatch (const char *__pattern, const char *__string, int __flags); #ifdef __cplusplus } diff --git a/lib/pipe-bidi.c b/lib/pipe-bidi.c index 28c1b31c3..1e51af5d2 100644 --- a/lib/pipe-bidi.c +++ b/lib/pipe-bidi.c @@ -1,5 +1,5 @@ /* Creation of subprocesses, communicating via pipes. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -54,13 +54,6 @@ #define _(str) gettext (str) -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -#ifdef EINTR -static inline int nonintr_close PARAMS ((int fd)); -#endif - - #ifdef EINTR /* EINTR handling for close(). @@ -68,8 +61,7 @@ static inline int nonintr_close PARAMS ((int fd)); signal handlers set up, namely when we get interrupted via SIGSTOP. */ static inline int -nonintr_close (fd) - int fd; +nonintr_close (int fd) { int retval; @@ -93,13 +85,11 @@ nonintr_close (fd) * */ pid_t -create_pipe_bidi (progname, prog_path, prog_argv, null_stderr, exit_on_error, fd) - const char *progname; - const char *prog_path; - char **prog_argv; - bool null_stderr; - bool exit_on_error; - int fd[2]; +create_pipe_bidi (const char *progname, + const char *prog_path, char **prog_argv, + bool null_stderr, + bool exit_on_error, + int fd[2]) { int ifd[2]; int ofd[2]; diff --git a/lib/pipe-in.c b/lib/pipe-in.c index 00380bff7..4273dc1df 100644 --- a/lib/pipe-in.c +++ b/lib/pipe-in.c @@ -1,5 +1,5 @@ /* Creation of subprocesses, communicating via pipes. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -54,17 +54,6 @@ #define _(str) gettext (str) -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -#ifdef EINTR -static inline int nonintr_close PARAMS ((int fd)); -# ifdef __GNUC__ -static inline int nonintr_open PARAMS ((const char *pathname, int oflag, - mode_t mode)); -# endif -#endif - - #ifdef EINTR /* EINTR handling for close(), open(). @@ -72,8 +61,7 @@ static inline int nonintr_open PARAMS ((const char *pathname, int oflag, signal handlers set up, namely when we get interrupted via SIGSTOP. */ static inline int -nonintr_close (fd) - int fd; +nonintr_close (int fd) { int retval; @@ -86,10 +74,7 @@ nonintr_close (fd) #define close nonintr_close static inline int -nonintr_open (pathname, oflag, mode) - const char *pathname; - int oflag; - mode_t mode; +nonintr_open (const char *pathname, int oflag, mode_t mode) { int retval; @@ -112,14 +97,11 @@ nonintr_open (pathname, oflag, mode) * */ pid_t -create_pipe_in (progname, prog_path, prog_argv, prog_stdin, null_stderr, exit_on_error, fd) - const char *progname; - const char *prog_path; - char **prog_argv; - const char *prog_stdin; - bool null_stderr; - bool exit_on_error; - int fd[1]; +create_pipe_in (const char *progname, + const char *prog_path, char **prog_argv, + const char *prog_stdin, bool null_stderr, + bool exit_on_error, + int fd[1]) { int ifd[2]; #if HAVE_POSIX_SPAWN diff --git a/lib/pipe-out.c b/lib/pipe-out.c index 3ee8137a0..cda7db303 100644 --- a/lib/pipe-out.c +++ b/lib/pipe-out.c @@ -1,5 +1,5 @@ /* Creation of subprocesses, communicating via pipes. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -54,17 +54,6 @@ #define _(str) gettext (str) -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -#ifdef EINTR -static inline int nonintr_close PARAMS ((int fd)); -# ifdef __GNUC__ -static inline int nonintr_open PARAMS ((const char *pathname, int oflag, - mode_t mode)); -# endif -#endif - - #ifdef EINTR /* EINTR handling for close(), open(). @@ -72,8 +61,7 @@ static inline int nonintr_open PARAMS ((const char *pathname, int oflag, signal handlers set up, namely when we get interrupted via SIGSTOP. */ static inline int -nonintr_close (fd) - int fd; +nonintr_close (int fd) { int retval; @@ -86,10 +74,7 @@ nonintr_close (fd) #define close nonintr_close static inline int -nonintr_open (pathname, oflag, mode) - const char *pathname; - int oflag; - mode_t mode; +nonintr_open (const char *pathname, int oflag, mode_t mode) { int retval; @@ -112,14 +97,11 @@ nonintr_open (pathname, oflag, mode) * */ pid_t -create_pipe_out (progname, prog_path, prog_argv, prog_stdout, null_stderr, exit_on_error, fd) - const char *progname; - const char *prog_path; - char **prog_argv; - const char *prog_stdout; - bool null_stderr; - bool exit_on_error; - int fd[1]; +create_pipe_out (const char *progname, + const char *prog_path, char **prog_argv, + const char *prog_stdout, bool null_stderr, + bool exit_on_error, + int fd[1]) { int ofd[2]; #if HAVE_POSIX_SPAWN diff --git a/lib/pipe.h b/lib/pipe.h index 528a3c2cb..f32dcaf0c 100644 --- a/lib/pipe.h +++ b/lib/pipe.h @@ -1,5 +1,5 @@ /* Creation of subprocesses, communicating via pipes. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -53,11 +53,11 @@ * parent -> fd[0] -> STDIN_FILENO -> child * */ -extern pid_t create_pipe_out PARAMS ((const char *progname, - const char *prog_path, char **prog_argv, - const char *prog_stdout, bool null_stderr, - bool exit_on_error, - int fd[1])); +extern pid_t create_pipe_out (const char *progname, + const char *prog_path, char **prog_argv, + const char *prog_stdout, bool null_stderr, + bool exit_on_error, + int fd[1]); /* Open a pipe for input from a child process. * The child's stdin comes from a file. @@ -66,11 +66,11 @@ extern pid_t create_pipe_out PARAMS ((const char *progname, * parent <- fd[0] <- STDOUT_FILENO <- child * */ -extern pid_t create_pipe_in PARAMS ((const char *progname, - const char *prog_path, char **prog_argv, - const char *prog_stdin, bool null_stderr, - bool exit_on_error, - int fd[1])); +extern pid_t create_pipe_in (const char *progname, + const char *prog_path, char **prog_argv, + const char *prog_stdin, bool null_stderr, + bool exit_on_error, + int fd[1]); /* Open a bidirectional pipe. * @@ -80,10 +80,10 @@ extern pid_t create_pipe_in PARAMS ((const char *progname, * read system write * */ -extern pid_t create_pipe_bidi PARAMS ((const char *progname, - const char *prog_path, char **prog_argv, - bool null_stderr, - bool exit_on_error, - int fd[2])); +extern pid_t create_pipe_bidi (const char *progname, + const char *prog_path, char **prog_argv, + bool null_stderr, + bool exit_on_error, + int fd[2]); #endif /* _PIPE_H */ diff --git a/lib/progname.c b/lib/progname.c index 6f48a219a..98e1a6013 100644 --- a/lib/progname.c +++ b/lib/progname.c @@ -1,5 +1,5 @@ /* Program name management. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -34,8 +34,7 @@ const char *program_name; /* Set program_name, based on argv[0]. */ void -set_program_name (argv0) - const char *argv0; +set_program_name (const char *argv0) { /* libtool creates a temporary executable whose name is prefixed with "lt-". Remove this prefix here. */ diff --git a/lib/progname.h b/lib/progname.h index b6883115e..0b50bfe38 100644 --- a/lib/progname.h +++ b/lib/progname.h @@ -1,5 +1,5 @@ /* Program name management. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -33,7 +33,7 @@ extern const char *program_name; /* Set program_name, based on argv[0]. */ -extern void set_program_name PARAMS ((const char *argv0)); +extern void set_program_name (const char *argv0); /* Indicates whether errors and warnings get prefixed with program_name. Default is true. @@ -43,6 +43,6 @@ extern bool error_with_progname; /* Print program_name prefix on stderr if and only if error_with_progname is true. */ -extern void maybe_print_progname PARAMS ((void)); +extern void maybe_print_progname (void); #endif /* _PROGNAME_H */ diff --git a/lib/safe-read.c b/lib/safe-read.c index a8947af38..8fe36ad9a 100644 --- a/lib/safe-read.c +++ b/lib/safe-read.c @@ -1,5 +1,5 @@ /* safe-read.c -- an interface to read that retries after interrupts - Copyright (C) 1993-1994, 1998, 2001 Free Software Foundation, Inc. + Copyright (C) 1993-1994, 1998, 2001-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -39,10 +39,7 @@ extern int errno; for an error. */ ssize_t -safe_read (desc, ptr, len) - int desc; - void *ptr; - size_t len; +safe_read (int desc, void *ptr, size_t len) { ssize_t n_chars; diff --git a/lib/safe-read.h b/lib/safe-read.h index 1b111a66f..d08043778 100644 --- a/lib/safe-read.h +++ b/lib/safe-read.h @@ -1,5 +1,5 @@ /* read() wrapper. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -25,4 +25,4 @@ /* Read LEN bytes at PTR from descriptor DESC, retrying if interrupted. Return the actual number of bytes read, zero for EOF, or negative for an error. */ -extern ssize_t safe_read PARAMS ((int desc, void *ptr, size_t len)); +extern ssize_t safe_read (int desc, void *ptr, size_t len); diff --git a/lib/setenv.c b/lib/setenv.c index c0047a149..6a7548f0f 100644 --- a/lib/setenv.c +++ b/lib/setenv.c @@ -73,7 +73,7 @@ __libc_lock_define_initialized (static, envlock) && defined __GNUC__) # define USE_TSEARCH 1 # include -typedef int (*compar_fn_t) PARAMS ((const void *, const void *)); +typedef int (*compar_fn_t) (const void *, const void *); /* This is a pointer to the root of the search tree with the known values. */ @@ -108,11 +108,8 @@ static char **last_environ; to reuse values once generated for a `setenv' call since we can never free the strings. */ int -__add_to_environ (name, value, combined, replace) - const char *name; - const char *value; - const char *combined; - int replace; +__add_to_environ (const char *name, const char *value, const char *combined, + int replace) { register char **ep; register size_t size; @@ -258,10 +255,7 @@ __add_to_environ (name, value, combined, replace) } int -setenv (name, value, replace) - const char *name; - const char *value; - int replace; +setenv (const char *name, const char *value, int replace) { return __add_to_environ (name, value, NULL, replace); } diff --git a/lib/setenv.h b/lib/setenv.h index 49e7c5d31..9068b70ff 100644 --- a/lib/setenv.h +++ b/lib/setenv.h @@ -15,14 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef PARAMS -# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES -# define PARAMS(Args) Args -# else -# define PARAMS(Args) () -# endif -#endif - #if HAVE_SETENV || HAVE_UNSETENV /* Get setenv(), unsetenv() declarations. */ @@ -38,14 +30,14 @@ extern "C" { /* Set NAME to VALUE in the environment. If REPLACE is nonzero, overwrite an existing value. */ -extern int setenv PARAMS ((const char *name, const char *value, int replace)); +extern int setenv (const char *name, const char *value, int replace); #endif #if !HAVE_UNSETENV /* Remove the variable NAME from the environment. */ -extern int unsetenv PARAMS ((const char *name)); +extern int unsetenv (const char *name); #endif diff --git a/lib/sh-quote.c b/lib/sh-quote.c index 8cc300f92..41c82c3bb 100644 --- a/lib/sh-quote.c +++ b/lib/sh-quote.c @@ -1,5 +1,5 @@ /* Shell quoting. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -33,8 +33,7 @@ /* Returns the number of bytes needed for the quoted string. */ size_t -shell_quote_length (string) - const char *string; +shell_quote_length (const char *string) { if (strpbrk (string, SHELL_SPECIAL_CHARS) == NULL) return strlen (string); @@ -66,9 +65,7 @@ shell_quote_length (string) /* Copies the quoted string to p and returns the incremented p. */ char * -shell_quote_copy (p, string) - char *p; - const char *string; +shell_quote_copy (char *p, const char *string) { if (strpbrk (string, SHELL_SPECIAL_CHARS) == NULL) { @@ -102,8 +99,7 @@ shell_quote_copy (p, string) /* Returns the freshly allocated quoted string. */ char * -shell_quote (string) - const char *string; +shell_quote (const char *string) { size_t length = shell_quote_length (string); char *quoted = (char *) xmalloc (length + 1); @@ -115,8 +111,7 @@ shell_quote (string) /* Returns a freshly allocated string containing all argument strings, quoted, separated through spaces. */ char * -shell_quote_argv (argv) - char **argv; +shell_quote_argv (char **argv) { if (*argv != NULL) { diff --git a/lib/sh-quote.h b/lib/sh-quote.h index 8c18c9895..76a583103 100644 --- a/lib/sh-quote.h +++ b/lib/sh-quote.h @@ -1,5 +1,5 @@ /* Shell quoting. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -23,14 +23,14 @@ #include /* Returns the number of bytes needed for the quoted string. */ -extern size_t shell_quote_length PARAMS ((const char *string)); +extern size_t shell_quote_length (const char *string); /* Copies the quoted string to p and returns the incremented p. */ -extern char * shell_quote_copy PARAMS ((char *p, const char *string)); +extern char * shell_quote_copy (char *p, const char *string); /* Returns the freshly allocated quoted string. */ -extern char * shell_quote PARAMS ((const char *string)); +extern char * shell_quote (const char *string); /* Returns a freshly allocated string containing all argument strings, quoted, separated through spaces. */ -extern char * shell_quote_argv PARAMS ((char **argv)); +extern char * shell_quote_argv (char **argv); diff --git a/lib/stpcpy.c b/lib/stpcpy.c index d1b135989..83d82775e 100644 --- a/lib/stpcpy.c +++ b/lib/stpcpy.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1992, 1995, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1992, 1995, 1997, 2002 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@gnu.org. @@ -33,9 +33,7 @@ /* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */ char * -__stpcpy (dest, src) - char *dest; - const char *src; +__stpcpy (char *dest, const char *src) { register char *d = dest; register const char *s = src; diff --git a/lib/stpcpy.h b/lib/stpcpy.h index ce8fe0ec4..6583189ff 100644 --- a/lib/stpcpy.h +++ b/lib/stpcpy.h @@ -1,5 +1,5 @@ /* String copying. - Copyright (C) 1995, 2001 Free Software Foundation, Inc. + Copyright (C) 1995, 2001-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,14 +18,6 @@ #ifndef _STPCPY_H #define _STPCPY_H -#ifndef PARAMS -# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES -# define PARAMS(args) args -# else -# define PARAMS(args) () -# endif -#endif - #if HAVE_STPCPY /* Get stpcpy() declaration. */ @@ -33,7 +25,7 @@ #else -extern char *stpcpy PARAMS ((char *__dst, const char *__src)); +extern char *stpcpy (char *__dst, const char *__src); #endif diff --git a/lib/stpncpy.c b/lib/stpncpy.c index cb34e08c6..42e31ad0d 100644 --- a/lib/stpncpy.c +++ b/lib/stpncpy.c @@ -46,10 +46,7 @@ /* Copy no more than N characters of SRC to DEST, returning the address of the terminating '\0' in DEST, if any, or else DEST + N. */ char * -__stpncpy (dest, src, n) - char *dest; - const char *src; - size_t n; +__stpncpy (char *dest, const char *src, size_t n) { char c; char *s = dest; diff --git a/lib/stpncpy.h b/lib/stpncpy.h index 2b1e680fb..af239dc55 100644 --- a/lib/stpncpy.h +++ b/lib/stpncpy.h @@ -18,21 +18,13 @@ #ifndef _STPNCPY_H #define _STPNCPY_H -#ifndef PARAMS -# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES -# define PARAMS(args) args -# else -# define PARAMS(args) () -# endif -#endif - #include #ifndef __GNU_LIBRARY__ /* When not using the GNU libc we use the stpncpy implementation we provide here. */ -extern char *gnu_stpncpy PARAMS ((char *__dst, const char *__src, size_t __n)); +extern char *gnu_stpncpy (char *__dst, const char *__src, size_t __n); #define stpncpy(Dst, Src, N) gnu_stpncpy (Dst, Src, N) #endif diff --git a/lib/strcase.h b/lib/strcase.h index be2d0dd71..f590e8d21 100644 --- a/lib/strcase.h +++ b/lib/strcase.h @@ -1,5 +1,5 @@ /* Case-insensitive string comparison functions. - Copyright (C) 1995-1996, 2001 Free Software Foundation, Inc. + Copyright (C) 1995-1996, 2001-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,16 +20,7 @@ #include -#ifndef PARAMS -# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES -# define PARAMS(args) args -# else -# define PARAMS(args) () -# endif -#endif - -extern int strcasecmp PARAMS ((const char *__s1, const char *__s2)); -extern int strncasecmp PARAMS ((const char *__s1, const char *__s2, - size_t __n)); +extern int strcasecmp (const char *__s1, const char *__s2); +extern int strncasecmp (const char *__s1, const char *__s2, size_t __n); #endif /* _STRCASE_H */ diff --git a/lib/strcasecmp.c b/lib/strcasecmp.c index 778d317d3..8f85d1589 100644 --- a/lib/strcasecmp.c +++ b/lib/strcasecmp.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1995, 1996, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1991-1992, 1995-1997, 2002 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@gnu.org. @@ -38,21 +38,16 @@ #endif #ifdef USE_IN_EXTENDED_LOCALE_MODEL -# define LOCALE_PARAM , loc -# define LOCALE_PARAM_DECL __locale_t loc; +# define LOCALE_PARAM , __locale_t loc #else # define LOCALE_PARAM -# define LOCALE_PARAM_DECL #endif /* Compare S1 and S2, ignoring case, returning less than, equal to or greater than zero if S1 is lexicographically less than, equal to or greater than S2. */ int -__strcasecmp (s1, s2 LOCALE_PARAM) - const char *s1; - const char *s2; - LOCALE_PARAM_DECL +__strcasecmp (const char *s1, const char *s2 LOCALE_PARAM) { const unsigned char *p1 = (const unsigned char *) s1; const unsigned char *p2 = (const unsigned char *) s2; diff --git a/lib/strcspn.c b/lib/strcspn.c index 6a81c93a2..8ff1109db 100644 --- a/lib/strcspn.c +++ b/lib/strcspn.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1994, 1996, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1994, 1996-1997, 2002 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@gnu.org. @@ -36,9 +36,7 @@ /* Return the length of the maximum initial segment of S which contains no characters from REJECT. */ size_t -strcspn (s, reject) - const char *s; - const char *reject; +strcspn (const char *s, const char *reject) { size_t count = 0; diff --git a/lib/strncasecmp.c b/lib/strncasecmp.c index cb331c440..0cdbabe93 100644 --- a/lib/strncasecmp.c +++ b/lib/strncasecmp.c @@ -1,6 +1,6 @@ /* Compare at most N characters of two strings without taking care for the case. - Copyright (C) 1992, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1992, 1996-1997, 2002 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@gnu.org. @@ -40,11 +40,9 @@ #endif #ifdef USE_IN_EXTENDED_LOCALE_MODEL -# define LOCALE_PARAM , loc -# define LOCALE_PARAM_DECL __locale_t loc; +# define LOCALE_PARAM , __locale_t loc #else # define LOCALE_PARAM -# define LOCALE_PARAM_DECL #endif /* Compare no more than N characters of S1 and S2, @@ -52,11 +50,7 @@ greater than zero if S1 is lexicographically less than, equal to or greater than S2. */ int -__strncasecmp (s1, s2, n LOCALE_PARAM) - const char *s1; - const char *s2; - size_t n; - LOCALE_PARAM_DECL +__strncasecmp (const char *s1, const char *s2, size_t n LOCALE_PARAM) { const unsigned char *p1 = (const unsigned char *) s1; const unsigned char *p2 = (const unsigned char *) s2; diff --git a/lib/strpbrk.c b/lib/strpbrk.c index a49d2b145..1546233da 100644 --- a/lib/strpbrk.c +++ b/lib/strpbrk.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1994, 1996, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1994, 1996-1997, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -28,9 +28,7 @@ /* Find the first occurrence in S of any character in ACCEPT. */ char * -strpbrk (s, accept) - const char *s; - const char *accept; +strpbrk (const char *s, const char *accept) { while (*s != '\0') { diff --git a/lib/strpbrk.h b/lib/strpbrk.h index 67aa525d9..cee75b9c6 100644 --- a/lib/strpbrk.h +++ b/lib/strpbrk.h @@ -1,5 +1,5 @@ /* Searching in a string. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,14 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef PARAMS -# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES -# define PARAMS(Args) Args -# else -# define PARAMS(Args) () -# endif -#endif - #if HAVE_STRPBRK /* Get strpbrk() declaration. */ @@ -31,6 +23,6 @@ #else /* Find the first occurrence in S of any character in ACCEPT. */ -extern char *strpbrk PARAMS ((const char *s, const char *accept)); +extern char *strpbrk (const char *s, const char *accept); #endif diff --git a/lib/strstr.c b/lib/strstr.c index 3eb2f2207..b16346b16 100644 --- a/lib/strstr.c +++ b/lib/strstr.c @@ -1,5 +1,5 @@ /* Return the offset of one string within another. - Copyright (C) 1994, 1996, 1997, 2000 Free Software Foundation, Inc. + Copyright (C) 1994, 1996, 1997, 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -39,9 +39,7 @@ typedef unsigned chartype; #undef strstr char * -strstr (phaystack, pneedle) - const char *phaystack; - const char *pneedle; +strstr (const char *phaystack, const char *pneedle) { register const unsigned char *haystack, *needle; register chartype b, c; diff --git a/lib/strstr.h b/lib/strstr.h index 0162d0971..e424b8340 100644 --- a/lib/strstr.h +++ b/lib/strstr.h @@ -1,5 +1,5 @@ /* Searching in a string. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001, 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,14 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef PARAMS -# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES -# define PARAMS(Args) Args -# else -# define PARAMS(Args) () -# endif -#endif - #if HAVE_STRSTR /* Get strstr() declaration. */ @@ -31,6 +23,6 @@ #else /* Find the first occurrence of NEEDLE in HAYSTACK. */ -extern char *strstr PARAMS ((const char *haystack, const char *needle)); +extern char *strstr (const char *haystack, const char *needle); #endif diff --git a/lib/tmpdir.c b/lib/tmpdir.c index 11b62944e..5c19f7ee5 100644 --- a/lib/tmpdir.c +++ b/lib/tmpdir.c @@ -77,15 +77,9 @@ #endif -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static bool direxists PARAMS ((const char *dir)); - - /* Return nonzero if DIR is an existent directory. */ static bool -direxists (dir) - const char *dir; +direxists (const char *dir) { struct_stat64 buf; return __xstat64 (_STAT_VER, dir, &buf) == 0 && S_ISDIR (buf.st_mode); @@ -98,12 +92,8 @@ direxists (dir) doesn't exist, none of the searched dirs exists, or there's not enough space in TMPL. */ int -path_search (tmpl, tmpl_len, dir, pfx, try_tmpdir) - char *tmpl; - size_t tmpl_len; - const char *dir; - const char *pfx; - bool try_tmpdir; +path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx, + bool try_tmpdir) { const char *d; size_t dlen, plen; diff --git a/lib/tmpdir.h b/lib/tmpdir.h index 8eaed9e2d..2c8068168 100644 --- a/lib/tmpdir.h +++ b/lib/tmpdir.h @@ -15,14 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef PARAMS -# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES -# define PARAMS(Args) Args -# else -# define PARAMS(Args) () -# endif -#endif - #include #include @@ -32,4 +24,4 @@ for use with mk[s]temp. Will fail (-1) if DIR is non-null and doesn't exist, none of the searched dirs exists, or there's not enough space in TMPL. */ -extern int path_search PARAMS ((char *tmpl, size_t tmpl_len, const char *dir, const char *pfx, bool try_tmpdir)); +extern int path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx, bool try_tmpdir); diff --git a/lib/ucs4-utf16.h b/lib/ucs4-utf16.h index 3c55f9c9c..bf56a551f 100644 --- a/lib/ucs4-utf16.h +++ b/lib/ucs4-utf16.h @@ -19,21 +19,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static int -u16_uctomb_aux PARAMS ((unsigned short *s, unsigned int uc, int n)); -static inline int -u16_uctomb PARAMS ((unsigned short *s, unsigned int uc, int n)); - /* Return the length (number of units) of the UTF-16 representation of uc, after storing it at S. Return -1 upon failure, -2 if the number of available units, N, is too small. */ static int -u16_uctomb_aux (s, uc, n) - unsigned short *s; - unsigned int uc; - int n; +u16_uctomb_aux (unsigned short *s, unsigned int uc, int n) { if (uc >= 0x10000) { @@ -53,10 +43,7 @@ u16_uctomb_aux (s, uc, n) } static inline int -u16_uctomb (s, uc, n) - unsigned short *s; - unsigned int uc; - int n; +u16_uctomb (unsigned short *s, unsigned int uc, int n) { if (uc < 0x10000 && n > 0) { diff --git a/lib/ucs4-utf8.h b/lib/ucs4-utf8.h index 965d92a15..0757325c4 100644 --- a/lib/ucs4-utf8.h +++ b/lib/ucs4-utf8.h @@ -19,21 +19,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static int -u8_uctomb_aux PARAMS ((unsigned char *s, unsigned int uc, int n)); -static inline int -u8_uctomb PARAMS ((unsigned char *s, unsigned int uc, int n)); - /* Return the length (number of units) of the UTF-8 representation of uc, after storing it at S. Return -1 upon failure, -2 if the number of available units, N, is too small. */ static int -u8_uctomb_aux (s, uc, n) - unsigned char *s; - unsigned int uc; - int n; +u8_uctomb_aux (unsigned char *s, unsigned int uc, int n) { int count; @@ -75,10 +65,7 @@ u8_uctomb_aux (s, uc, n) } static inline int -u8_uctomb (s, uc, n) - unsigned char *s; - unsigned int uc; - int n; +u8_uctomb (unsigned char *s, unsigned int uc, int n) { if (uc < 0x80 && n > 0) { diff --git a/lib/unsetenv.c b/lib/unsetenv.c index 56b35f06a..734589dce 100644 --- a/lib/unsetenv.c +++ b/lib/unsetenv.c @@ -63,8 +63,7 @@ __libc_lock_define_initialized (static, envlock) int -unsetenv (name) - const char *name; +unsetenv (const char *name) { size_t len; char **ep; diff --git a/lib/utf16-ucs4.h b/lib/utf16-ucs4.h index 7a7ae52b8..48caab4b8 100644 --- a/lib/utf16-ucs4.h +++ b/lib/utf16-ucs4.h @@ -1,5 +1,5 @@ /* Conversion UTF-16 to UCS-4. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -19,20 +19,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static int -u16_mbtouc_aux PARAMS ((unsigned int *puc, const unsigned short *s, size_t n)); -static inline int -u16_mbtouc PARAMS ((unsigned int *puc, const unsigned short *s, size_t n)); - /* Return the length (number of units) of the first character in S, putting its 'ucs4_t' representation in *PUC. */ static int -u16_mbtouc_aux (puc, s, n) - unsigned int *puc; - const unsigned short *s; - size_t n; +u16_mbtouc_aux (unsigned int *puc, const unsigned short *s, size_t n) { unsigned short c = *s; @@ -59,10 +49,7 @@ u16_mbtouc_aux (puc, s, n) return 1; } static inline int -u16_mbtouc (puc, s, n) - unsigned int *puc; - const unsigned short *s; - size_t n; +u16_mbtouc (unsigned int *puc, const unsigned short *s, size_t n) { unsigned short c = *s; diff --git a/lib/utf8-ucs4.h b/lib/utf8-ucs4.h index a3f28834b..3cee14b29 100644 --- a/lib/utf8-ucs4.h +++ b/lib/utf8-ucs4.h @@ -19,20 +19,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static int -u8_mbtouc_aux PARAMS ((unsigned int *puc, const unsigned char *s, size_t n)); -static inline int -u8_mbtouc PARAMS ((unsigned int *puc, const unsigned char *s, size_t n)); - /* Return the length (number of units) of the first character in S, putting its 'ucs4_t' representation in *PUC. */ static int -u8_mbtouc_aux (puc, s, n) - unsigned int *puc; - const unsigned char *s; - size_t n; +u8_mbtouc_aux (unsigned int *puc, const unsigned char *s, size_t n) { unsigned char c = *s; @@ -163,10 +153,7 @@ u8_mbtouc_aux (puc, s, n) return 1; } static inline int -u8_mbtouc (puc, s, n) - unsigned int *puc; - const unsigned char *s; - size_t n; +u8_mbtouc (unsigned int *puc, const unsigned char *s, size_t n) { unsigned char c = *s; diff --git a/lib/vasprintf.c b/lib/vasprintf.c index bd66b7911..2016e967f 100644 --- a/lib/vasprintf.c +++ b/lib/vasprintf.c @@ -26,19 +26,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include +#include #include -#include "libstdarg.h" - #ifdef TEST size_t global_total_width; #endif static int -int_vasprintf (result, format, args) - char **result; - const char *format; - va_list *args; +int_vasprintf (char **result, const char *format, va_list *args) { const char *p = format; /* Add one to make sure that it is never zero, which might cause malloc @@ -126,25 +122,18 @@ int_vasprintf (result, format, args) } int -vasprintf (result, format, args) - char **result; - const char *format; - va_list args; +vasprintf (char **result, const char *format, va_list args) { return int_vasprintf (result, format, &args); } int -asprintf VA_PARAMS ((char **result, const char *format, ...), - (result, format, va_alist) - char **result; - const char *format; - va_dcl) +asprintf (char **result, const char *format, ...) { va_list args; int done; - VA_START (args, format); + va_start (args, format); done = vasprintf (result, format, args); va_end (args); @@ -158,15 +147,12 @@ asprintf VA_PARAMS ((char **result, const char *format, ...), #include void -checkit VA_PARAMS ((const char* format, ...), - (format, va_alist) - const char *format; - va_dcl) +checkit (const char* format, ...) { va_list args; char *result; - VA_START (args, format); + va_start (args, format); vasprintf (&result, format, args); if (strlen (result) < global_total_width) printf ("PASS: "); diff --git a/lib/vasprintf.h b/lib/vasprintf.h index 686e37c59..cd4a8aa82 100644 --- a/lib/vasprintf.h +++ b/lib/vasprintf.h @@ -18,14 +18,6 @@ #ifndef _VASPRINTF_H #define _VASPRINTF_H -#ifndef PARAMS -# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES -# define PARAMS(Args) Args -# else -# define PARAMS(Args) () -# endif -#endif - #if HAVE_VASPRINTF /* Get asprintf(), vasprintf() declarations. */ @@ -34,11 +26,7 @@ #else /* Get va_list. */ -#if __STDC__ || defined __cplusplus -# include -#else -# include -#endif +#include #ifndef __attribute__ /* This feature is available in gcc versions 2.5 and later. */ @@ -57,9 +45,9 @@ extern "C" { #endif -extern int asprintf PARAMS ((char **result, const char *format, ...)) +extern int asprintf (char **result, const char *format, ...) __attribute__ ((__format__ (__printf__, 2, 3))); -extern int vasprintf PARAMS ((char **result, const char *format, va_list args)) +extern int vasprintf (char **result, const char *format, va_list args) __attribute__ ((__format__ (__printf__, 2, 0))); #ifdef __cplusplus diff --git a/lib/wait-process.c b/lib/wait-process.c index cd4e3a0ef..af315f0c7 100644 --- a/lib/wait-process.c +++ b/lib/wait-process.c @@ -78,10 +78,7 @@ int -wait_subprocess (child, progname, exit_on_error) - pid_t child; - const char *progname; - bool exit_on_error; +wait_subprocess (pid_t child, const char *progname, bool exit_on_error) { /* waitpid() is just as portable as wait() nowadays. */ WAIT_T status; diff --git a/lib/wait-process.h b/lib/wait-process.h index 509d73d61..22440f410 100644 --- a/lib/wait-process.h +++ b/lib/wait-process.h @@ -1,5 +1,5 @@ /* Waiting for a subprocess to finish. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -31,7 +31,7 @@ /* Wait for a subprocess to finish. Return its exit code. If it didn't terminate correctly, exit if exit_on_error is true, otherwise return 127. */ -extern int wait_subprocess PARAMS ((pid_t child, const char *progname, - bool exit_on_error)); +extern int wait_subprocess (pid_t child, const char *progname, + bool exit_on_error); #endif /* _WAIT_PROCESS_H */ diff --git a/lib/xerror.c b/lib/xerror.c index bab939f6c..b07a6d662 100644 --- a/lib/xerror.c +++ b/lib/xerror.c @@ -27,28 +27,25 @@ #include #include #include +#include #include "error.h" #include "progname.h" #include "exit.h" #include "mbswidth.h" #include "vasprintf.h" -#include "libstdarg.h" #include "gettext.h" #define _(str) gettext (str) /* Format a message and return the freshly allocated resulting string. */ char * -xasprintf VA_PARAMS ((const char *format, ...), - (format, va_alist) - const char *format; - va_dcl) +xasprintf (const char *format, ...) { va_list args; char *result; - VA_START (args, format); + va_start (args, format); if (vasprintf (&result, format, args) < 0) error (EXIT_FAILURE, 0, _("memory exhausted")); va_end (args); @@ -60,9 +57,7 @@ xasprintf VA_PARAMS ((const char *format, ...), the same amount of spaces. Reuse the spaces of the previous call if PREFIX is NULL. Free the PREFIX and MESSAGE when done. */ void -multiline_warning (prefix, message) - char *prefix; - char *message; +multiline_warning (char *prefix, char *message) { static int width; const char *cp; @@ -115,9 +110,7 @@ multiline_warning (prefix, message) the same amount of spaces. Reuse the spaces of the previous call if PREFIX is NULL. Free the PREFIX and MESSAGE when done. */ void -multiline_error (prefix, message) - char *prefix; - char *message; +multiline_error (char *prefix, char *message) { if (prefix != NULL) ++error_message_count; diff --git a/lib/xerror.h b/lib/xerror.h index 788cbb2b0..543ac96d0 100644 --- a/lib/xerror.h +++ b/lib/xerror.h @@ -1,5 +1,5 @@ /* Multiline error-reporting functions. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -23,23 +23,19 @@ #include "error.h" /* Format a message and return the freshly allocated resulting string. */ -#if defined (__STDC__) && __STDC__ extern char *xasprintf (const char *format, ...) __attribute__ ((__format__ (__printf__, 1, 2))); -#else -extern char *xasprintf (); -#endif /* Emit a multiline warning to stderr, consisting of MESSAGE, with the first line prefixed with PREFIX and the remaining lines prefixed with the same amount of spaces. Reuse the spaces of the previous call if PREFIX is NULL. Free the PREFIX and MESSAGE when done. */ -extern void multiline_warning PARAMS ((char *prefix, char *message)); +extern void multiline_warning (char *prefix, char *message); /* Emit a multiline error to stderr, consisting of MESSAGE, with the first line prefixed with PREFIX and the remaining lines prefixed with the same amount of spaces. Reuse the spaces of the previous call if PREFIX is NULL. Free the PREFIX and MESSAGE when done. */ -extern void multiline_error PARAMS ((char *prefix, char *message)); +extern void multiline_error (char *prefix, char *message); #endif /* _XERROR_H */ diff --git a/lib/xgetcwd.h b/lib/xgetcwd.h index 2f6df8a6d..6af2cdcbc 100644 --- a/lib/xgetcwd.h +++ b/lib/xgetcwd.h @@ -1,5 +1,5 @@ /* xgetcwd -- return current directory with unlimited length - Copyright (C) 1995, 2001 Free Software Foundation, Inc. + Copyright (C) 1995, 2001-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,13 +15,5 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef PARAMS -# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES -# define PARAMS(args) args -# else -# define PARAMS(args) () -# endif -#endif - /* Wrapper function with error checking for standard function. */ -extern char *xgetcwd PARAMS ((void)); +extern char *xgetcwd (void); diff --git a/lib/xmalloc.c b/lib/xmalloc.c index d7fa81279..ed757d2a9 100644 --- a/lib/xmalloc.c +++ b/lib/xmalloc.c @@ -1,5 +1,5 @@ /* xmalloc.c -- malloc with out of memory checking - Copyright (C) 1990-1996, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1990-1996, 2000-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,18 +31,12 @@ #define _(str) gettext (str) -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static void *fixup_null_alloc PARAMS ((size_t n)); - - /* Exit value when the requested amount of memory is not available. The caller may set it to some other value. */ int xmalloc_exit_failure = EXIT_FAILURE; static void * -fixup_null_alloc (n) - size_t n; +fixup_null_alloc (size_t n) { void *p; @@ -57,8 +51,7 @@ fixup_null_alloc (n) /* Allocate N bytes of memory dynamically, with error checking. */ void * -xmalloc (n) - size_t n; +xmalloc (size_t n) { void *p; @@ -71,8 +64,7 @@ xmalloc (n) /* Allocate memory for N elements of S bytes, with error checking. */ void * -xcalloc (n, s) - size_t n, s; +xcalloc (size_t n, size_t s) { void *p; @@ -87,9 +79,7 @@ xcalloc (n, s) If P is NULL, run xmalloc. */ void * -xrealloc (p, n) - void *p; - size_t n; +xrealloc (void *p, size_t n) { if (p == NULL) return xmalloc (n); diff --git a/lib/xmalloc.h b/lib/xmalloc.h index 880bb405d..c5b47ece3 100644 --- a/lib/xmalloc.h +++ b/lib/xmalloc.h @@ -1,5 +1,5 @@ /* malloc with out of memory checking. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -25,20 +25,20 @@ /* Defined in xmalloc.c. */ /* Allocate SIZE bytes of memory dynamically, with error checking. */ -extern void *xmalloc PARAMS ((size_t size)); +extern void *xmalloc (size_t size); /* Allocate memory for NMEMB elements of SIZE bytes, with error checking. */ -extern void *xcalloc PARAMS ((size_t nmemb, size_t size)); +extern void *xcalloc (size_t nmemb, size_t size); /* Change the size of an allocated block of memory PTR to SIZE bytes, with error checking. If PTR is NULL, run xmalloc. */ -extern void *xrealloc PARAMS ((void *ptr, size_t size)); +extern void *xrealloc (void *ptr, size_t size); /* Defined in xstrdup.c. */ /* Return a newly allocated copy of STRING. */ -extern char *xstrdup PARAMS ((const char *string)); +extern char *xstrdup (const char *string); #endif /* _XMALLOC_H */ diff --git a/lib/xsetenv.c b/lib/xsetenv.c index f20d1a9e6..43537f637 100644 --- a/lib/xsetenv.c +++ b/lib/xsetenv.c @@ -1,5 +1,5 @@ /* Setting environment variables, with out-of-memory checking. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -34,10 +34,7 @@ If REPLACE is nonzero, overwrite an existing value. With error checking. */ void -xsetenv (name, value, replace) - const char *name; - const char *value; - int replace; +xsetenv (const char *name, const char *value, int replace) { if (setenv (name, value, replace) < 0) error (EXIT_FAILURE, 0, _("memory exhausted")); diff --git a/lib/xsetenv.h b/lib/xsetenv.h index 67803f093..a3b5e9faf 100644 --- a/lib/xsetenv.h +++ b/lib/xsetenv.h @@ -25,7 +25,7 @@ extern "C" { /* Set NAME to VALUE in the environment. If REPLACE is nonzero, overwrite an existing value. With error checking. */ -extern void xsetenv PARAMS ((const char *name, const char *value, int replace)); +extern void xsetenv (const char *name, const char *value, int replace); #ifdef __cplusplus } diff --git a/lib/xstrdup.c b/lib/xstrdup.c index ca117a7c6..6d20e2b55 100644 --- a/lib/xstrdup.c +++ b/lib/xstrdup.c @@ -1,5 +1,5 @@ /* xstrdup.c -- copy a string with out of memory checking - Copyright (C) 1990, 1996, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1990, 1996, 2000-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,8 +27,7 @@ /* Return a newly allocated copy of STRING. */ char * -xstrdup (string) - const char *string; +xstrdup (const char *string) { return strcpy (xmalloc (strlen (string) + 1), string); } diff --git a/libasprintf/ChangeLog b/libasprintf/ChangeLog index 6e452c711..b5a2fa266 100644 --- a/libasprintf/ChangeLog +++ b/libasprintf/ChangeLog @@ -1,3 +1,26 @@ +2002-11-13 Bruno Haible + + Assume ANSI C. + * libstdarg.h: Remove file. + * Makefile.am (lib_asprintf_EXTRASOURCES): Remove libstdarg.h. + * asnprintf.c: Include instead of libstdarg.h. + (asnprintf): Use ANSI C function declarations. Use va_start instead of + VA_START. + * asprintf.c: Include instead of libstdarg.h. + (asnprintf): Use ANSI C function declarations. Use va_start instead of + VA_START. + * printf-args.h (PARAMS): Remove macro. + (printf_fetchargs): Use ANSI C function declarations. + * printf-args.c (printf_fetchargs): Likewise. + * printf-parse.h (printf_parse): Likewise. + * printf-parse.c (printf_parse): Likewise. + * vasnprintf.h (PARAMS): Remove macro. + (asnprintf, vasnprintf): Use ANSI C function declarations. + * vasnprintf.c (vasnprintf): Likewise. + * vasprintf.h (PARAMS): Remove macro. + (asprintf, vasprintf): Use ANSI C function declarations. + * vasprintf.c (vasprintf): Likewise. + 2002-10-27 Bruno Haible * printf-args.h, printf-args.c: New files. diff --git a/libasprintf/Makefile.am b/libasprintf/Makefile.am index aea2c8cb8..e0debdf7a 100644 --- a/libasprintf/Makefile.am +++ b/libasprintf/Makefile.am @@ -41,8 +41,7 @@ lib_asprintf_EXTRASOURCES = \ printf-parse.h printf-parse.c \ vasnprintf.h vasnprintf.c asnprintf.c \ vasprintf.h vasprintf.c asprintf.c \ - liballoca.h \ - libstdarg.h + liballoca.h lib-asprintf.lo: $(lib_asprintf_EXTRASOURCES) diff --git a/libasprintf/asnprintf.c b/libasprintf/asnprintf.c index 7d7d6b12a..8fb9d3c82 100644 --- a/libasprintf/asnprintf.c +++ b/libasprintf/asnprintf.c @@ -23,20 +23,15 @@ /* Specification. */ #include "vasnprintf.h" -#include "libstdarg.h" +#include char * -asnprintf VA_PARAMS ((char *resultbuf, size_t *lengthp, const char *format, ...), - (resultbuf, lengthp, format, va_alist) - char *resultbuf; - size_t *lengthp; - const char *format; - va_dcl) +asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...) { va_list args; char *result; - VA_START (args, format); + va_start (args, format); result = vasnprintf (resultbuf, lengthp, format, args); va_end (args); return result; diff --git a/libasprintf/asprintf.c b/libasprintf/asprintf.c index c70290523..a8e1bf899 100644 --- a/libasprintf/asprintf.c +++ b/libasprintf/asprintf.c @@ -23,19 +23,15 @@ /* Specification. */ #include "vasprintf.h" -#include "libstdarg.h" +#include int -asprintf VA_PARAMS ((char **resultp, const char *format, ...), - (resultp, format, va_alist) - char **resultp; - const char *format; - va_dcl) +asprintf (char **resultp, const char *format, ...) { va_list args; int result; - VA_START (args, format); + va_start (args, format); result = vasprintf (resultp, format, args); va_end (args); return result; diff --git a/libasprintf/libstdarg.h b/libasprintf/libstdarg.h deleted file mode 100644 index 79c86daed..000000000 --- a/libasprintf/libstdarg.h +++ /dev/null @@ -1,32 +0,0 @@ -/* with fallback on for old platforms. - Copyright (C) 2001-2002 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published - by the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, - USA. */ - -#ifndef _LIBSTDARG_H -#define _LIBSTDARG_H - -#if __STDC__ || defined __SUNPRO_C || defined __cplusplus -# include -# define VA_START(args, lastarg) va_start (args, lastarg) -# define VA_PARAMS(stdc_params, oldc_params) stdc_params -#else -# include -# define VA_START(args, lastarg) va_start (args) -# define VA_PARAMS(stdc_params, oldc_params) oldc_params -#endif - -#endif /* _LIBSTDARG_H */ diff --git a/libasprintf/printf-args.c b/libasprintf/printf-args.c index 60bb989d1..85731302c 100644 --- a/libasprintf/printf-args.c +++ b/libasprintf/printf-args.c @@ -27,9 +27,7 @@ STATIC #endif int -printf_fetchargs (args, a) - va_list args; - arguments *a; +printf_fetchargs (va_list args, arguments *a) { unsigned int i; argument *ap; diff --git a/libasprintf/printf-args.h b/libasprintf/printf-args.h index 55c81912b..5fcbb2ced 100644 --- a/libasprintf/printf-args.h +++ b/libasprintf/printf-args.h @@ -25,19 +25,7 @@ #endif /* Get va_list. */ -#if __STDC__ || defined __SUNPRO_C || defined __cplusplus -# include -#else -# include -#endif - -#ifndef PARAMS -# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES -# define PARAMS(Args) Args -# else -# define PARAMS(Args) () -# endif -#endif +#include /* Argument types */ @@ -136,6 +124,6 @@ STATIC #else extern #endif -int printf_fetchargs PARAMS ((va_list args, arguments *a)); +int printf_fetchargs (va_list args, arguments *a); #endif /* _PRINTF_ARGS_H */ diff --git a/libasprintf/printf-parse.c b/libasprintf/printf-parse.c index 50fe1dc32..45ed1b60d 100644 --- a/libasprintf/printf-parse.c +++ b/libasprintf/printf-parse.c @@ -41,10 +41,7 @@ STATIC #endif int -printf_parse (format, d, a) - const char *format; - char_directives *d; - arguments *a; +printf_parse (const char *format, char_directives *d, arguments *a) { const char *cp = format; /* pointer into format */ int arg_posn = 0; /* number of regular arguments consumed */ diff --git a/libasprintf/printf-parse.h b/libasprintf/printf-parse.h index c3344a92c..97e432af1 100644 --- a/libasprintf/printf-parse.h +++ b/libasprintf/printf-parse.h @@ -67,7 +67,6 @@ STATIC #else extern #endif -int printf_parse PARAMS ((const char *format, char_directives *d, - arguments *a)); +int printf_parse (const char *format, char_directives *d, arguments *a); #endif /* _PRINTF_PARSE_H */ diff --git a/libasprintf/vasnprintf.c b/libasprintf/vasnprintf.c index b17c74436..806cc088d 100644 --- a/libasprintf/vasnprintf.c +++ b/libasprintf/vasnprintf.c @@ -49,11 +49,7 @@ #endif char * -vasnprintf (resultbuf, lengthp, format, args) - char *resultbuf; - size_t *lengthp; - const char *format; - va_list args; +vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args) { char_directives d; arguments a; diff --git a/libasprintf/vasnprintf.h b/libasprintf/vasnprintf.h index 903e7bccb..6822ae9ac 100644 --- a/libasprintf/vasnprintf.h +++ b/libasprintf/vasnprintf.h @@ -19,20 +19,8 @@ #ifndef _VASNPRINTF_H #define _VASNPRINTF_H -#ifndef PARAMS -# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES -# define PARAMS(Args) Args -# else -# define PARAMS(Args) () -# endif -#endif - /* Get va_list. */ -#if __STDC__ || defined __SUNPRO_C || defined __cplusplus -# include -#else -# include -#endif +#include /* Get size_t. */ #include @@ -54,9 +42,9 @@ extern "C" { #endif -extern char * asnprintf PARAMS ((char *resultbuf, size_t *lengthp, const char *format, ...)) +extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...) __attribute__ ((__format__ (__printf__, 3, 4))); -extern char * vasnprintf PARAMS ((char *resultbuf, size_t *lengthp, const char *format, va_list args)) +extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args) __attribute__ ((__format__ (__printf__, 3, 0))); #ifdef __cplusplus diff --git a/libasprintf/vasprintf.c b/libasprintf/vasprintf.c index 016202553..925d2fb81 100644 --- a/libasprintf/vasprintf.c +++ b/libasprintf/vasprintf.c @@ -26,10 +26,7 @@ #include "vasnprintf.h" int -vasprintf (resultp, format, args) - char **resultp; - const char *format; - va_list args; +vasprintf (char **resultp, const char *format, va_list args) { size_t length; char *result = vasnprintf (NULL, &length, format, args); diff --git a/libasprintf/vasprintf.h b/libasprintf/vasprintf.h index 314341938..c82d7b7bb 100644 --- a/libasprintf/vasprintf.h +++ b/libasprintf/vasprintf.h @@ -19,20 +19,8 @@ #ifndef _VASPRINTF_H #define _VASPRINTF_H -#ifndef PARAMS -# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES -# define PARAMS(Args) Args -# else -# define PARAMS(Args) () -# endif -#endif - /* Get va_list. */ -#if __STDC__ || defined __SUNPRO_C || defined __cplusplus -# include -#else -# include -#endif +#include #ifndef __attribute__ /* This feature is available in gcc versions 2.5 and later. */ @@ -51,9 +39,9 @@ extern "C" { #endif -extern int asprintf PARAMS ((char **result, const char *format, ...)) +extern int asprintf (char **result, const char *format, ...) __attribute__ ((__format__ (__printf__, 2, 3))); -extern int vasprintf PARAMS ((char **result, const char *format, va_list args)) +extern int vasprintf (char **result, const char *format, va_list args) __attribute__ ((__format__ (__printf__, 2, 0))); #ifdef __cplusplus diff --git a/libuniname/ChangeLog b/libuniname/ChangeLog index 8c92d6028..8156fa32f 100644 --- a/libuniname/ChangeLog +++ b/libuniname/ChangeLog @@ -1,3 +1,13 @@ +2002-11-13 Bruno Haible + + Assume ANSI C. + * uniname.h (PARAMS): Remove macro. + (unicode_character_name, unicode_name_character): Use ANSI C function + declarations. + * uniname.c (unicode_name_word, unicode_name_word_lookup, + unicode_character_name, unicode_name_character): Likewise. + * test-names.c (getfield, fill_names, main): Likewise. + 2002-08-06 Bruno Haible * gettext-0.11.5 released. diff --git a/libuniname/test-names.c b/libuniname/test-names.c index 8ce0dfeda..19a757c54 100644 --- a/libuniname/test-names.c +++ b/libuniname/test-names.c @@ -38,10 +38,7 @@ const char * unicode_names [0x110000]; Reads up to (but excluding) DELIM. Returns 1 when a field was successfully read, otherwise 0. */ static int -getfield (stream, buffer, delim) - FILE *stream; - char *buffer; - int delim; +getfield (FILE *stream, char *buffer, int delim) { int count = 0; int c; @@ -67,8 +64,7 @@ getfield (stream, buffer, delim) /* Stores in unicode_names[] the relevant contents of the UnicodeData.txt file. */ static void -fill_names (unicodedata_filename) - const char *unicodedata_filename; +fill_names (const char *unicodedata_filename) { unsigned int i; FILE *stream; @@ -253,9 +249,7 @@ test_inverse_lookup () } int -main (argc, argv) - int argc; - char *argv[]; +main (int argc, char *argv[]) { int error = 0; diff --git a/libuniname/uniname.c b/libuniname/uniname.c index 4deb465ef..68017ecdf 100644 --- a/libuniname/uniname.c +++ b/libuniname/uniname.c @@ -30,12 +30,6 @@ #define SIZEOF(a) (sizeof(a) / sizeof(a[0])) -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static const char * unicode_name_word PARAMS ((unsigned int index, unsigned int *lengthp)); -static int unicode_name_word_lookup PARAMS ((const char *word, unsigned int length)); - - /* Table of Unicode character names, derived from UnicodeData.txt. */ #define uint16_t unsigned short #define uint32_t unsigned int @@ -57,9 +51,7 @@ static int unicode_name_word_lookup PARAMS ((const char *word, unsigned int leng /* Returns the word with a given index. */ static const char * -unicode_name_word (index, lengthp) - unsigned int index; - unsigned int *lengthp; +unicode_name_word (unsigned int index, unsigned int *lengthp) { unsigned int i1; unsigned int i2; @@ -93,9 +85,7 @@ unicode_name_word (index, lengthp) /* Looks up the index of a word. */ static int -unicode_name_word_lookup (word, length) - const char *word; - unsigned int length; +unicode_name_word_lookup (const char *word, unsigned int length) { if (length > 0 && length < SIZEOF (unicode_name_by_length) - 1) { @@ -156,9 +146,7 @@ static const char jamo_final_short_name[28][3] = /* Looks up the name of a Unicode character, in uppercase ASCII. Returns the filled buf, or NULL if the character does not have a name. */ char * -unicode_character_name (c, buf) - unsigned int c; - char *buf; +unicode_character_name (unsigned int c, char *buf) { if (c >= 0xAC00 && c <= 0xD7A3) { @@ -302,8 +290,7 @@ unicode_character_name (c, buf) /* Looks up the Unicode character with a given name, in upper- or lowercase ASCII. Returns the character if found, or UNINAME_INVALID if not found. */ unsigned int -unicode_name_character (name) - const char *name; +unicode_name_character (const char *name) { unsigned int len = strlen (name); if (len > 1 && len <= UNICODE_CHARNAME_MAX_LENGTH) diff --git a/libuniname/uniname.h b/libuniname/uniname.h index 2ea51c31b..550df022b 100644 --- a/libuniname/uniname.h +++ b/libuniname/uniname.h @@ -18,24 +18,16 @@ #ifndef _UNINAME_H #define _UNINAME_H -#ifndef PARAMS -# if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES -# define PARAMS(Args) Args -# else -# define PARAMS(Args) () -# endif -#endif - /* Required size of buffer for a Unicode character name. */ #define UNINAME_MAX 256 /* Looks up the name of a Unicode character, in uppercase ASCII. Returns the filled buf, or NULL if the character does not have a name. */ -extern char * unicode_character_name PARAMS ((unsigned int uc, char *buf)); +extern char * unicode_character_name (unsigned int uc, char *buf); /* Looks up the Unicode character with a given name, in upper- or lowercase ASCII. Returns the character if found, or UNINAME_INVALID if not found. */ -extern unsigned int unicode_name_character PARAMS ((const char *name)); +extern unsigned int unicode_name_character (const char *name); #define UNINAME_INVALID ((unsigned int) 0xFFFF) #endif /* _UNINAME_H */ diff --git a/m4/ChangeLog b/m4/ChangeLog index 4808a9303..71a9a59b6 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,9 @@ +2002-11-13 Bruno Haible + + Assume ANSI C. + * c-bs-a.m4: Remove file. + * Makefile.am (EXTRA_DIST): Remove it. + 2002-11-08 Bruno Haible * progtest.m4 (AM_PATH_PROG_WITH_TEST): Portability to OS/2. diff --git a/m4/Makefile.am b/m4/Makefile.am index dffd1b65a..e09fdd829 100644 --- a/m4/Makefile.am +++ b/m4/Makefile.am @@ -7,7 +7,7 @@ aclocal_DATA = codeset.m4 gettext.m4 glibc21.m4 iconv.m4 intdiv0.m4 inttypes.m4 # find . -type f -name '*.m4' -printf '%f\n'|sort |fmt |tr '\012' @ \ # |sed 's/@$/%/;s/@/ \\@/g' |tr @% '\012\012' EXTRA_DIST = README \ -backupfile.m4 c-bs-a.m4 codeset.m4 error.m4 flex.m4 fnmatch.m4 gcj.m4 \ +backupfile.m4 codeset.m4 error.m4 flex.m4 fnmatch.m4 gcj.m4 \ getline.m4 gettext.m4 glibc21.m4 hostname.m4 iconv.m4 intdiv0.m4 intmax.m4 \ inttypes.m4 inttypes_h.m4 inttypes-pri.m4 isc-posix.m4 javacomp.m4 \ javaexec.m4 lcmessage.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 libtool.m4 \ diff --git a/m4/c-bs-a.m4 b/m4/c-bs-a.m4 deleted file mode 100644 index 1c7eb1c4e..000000000 --- a/m4/c-bs-a.m4 +++ /dev/null @@ -1,29 +0,0 @@ -# c-bs-a.m4 serial 4 (fileutils-4.1.3) -dnl Copyright (C) 2000-2002 Free Software Foundation, Inc. -dnl This file is free software, distributed under the terms of the GNU -dnl General Public License. As a special exception to the GNU General -dnl Public License, this file may be distributed as part of a program -dnl that contains a configuration script generated by Autoconf, under -dnl the same distribution terms as the rest of that program. - -dnl From Paul Eggert. - -AC_DEFUN([AC_C_BACKSLASH_A], -[ - AC_CACHE_CHECK([whether backslash-a works in strings], ac_cv_c_backslash_a, - [AC_TRY_COMPILE([], - [ -#if '\a' == 'a' - syntax error; -#endif - char buf['\a' == 'a' ? -1 : 1]; - buf[0] = '\a'; - return buf[0] != "\a"[0]; - ], - ac_cv_c_backslash_a=yes, - ac_cv_c_backslash_a=no)]) - if test $ac_cv_c_backslash_a = yes; then - AC_DEFINE(HAVE_C_BACKSLASH_A, 1, - [Define if backslash-a works in C strings.]) - fi -]) diff --git a/misc/ChangeLog b/misc/ChangeLog index b07202042..9e683ba68 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,3 +1,9 @@ +2002-11-13 Bruno Haible + + Assume ANSI C. + * tcl_gettext.c (tcl_gettext, tcl_textdomain, tcl_bindtextdomain): + Use ANSI C function declarations. + 2002-10-25 Karl Eichwalder * po-compat.el (po-find-file-coding-system-guts): Provide the old diff --git a/misc/tcl_gettext.c b/misc/tcl_gettext.c index f399ca0e1..b26849bbc 100644 --- a/misc/tcl_gettext.c +++ b/misc/tcl_gettext.c @@ -1,5 +1,5 @@ /* tcl_gettext - Module implementing gettext interface for Tcl. - Copyright (C) 1995, 1998 Free Software Foundation, Inc. + Copyright (C) 1995, 1998, 2002 Free Software Foundation, Inc. Written by Ulrich Drepper , December 1995. This program is free software; you can redistribute it and/or modify @@ -27,41 +27,10 @@ /* Data for Tcl interpreter interface. */ #include "tcl.h" -/* Prototypes for local functions. */ -static int -tcl_gettext (ClientData client_data, Tcl_Interp *interp, int argc, - char *argv[]); -static int -tcl_textdomain (ClientData client_data, Tcl_Interp *interp, int argc, - char *argv[]); -static int -tcl_bindtextdomain (ClientData client_data, Tcl_Interp *interp, int argc, - char *argv[]); - - -/* Initialization functions. Called from the tclAppInit.c/tkAppInit.c - or while the dynamic loading with Tcl7.x, x>= 5. */ -int -Gettext_Init (interp) - Tcl_Interp *interp; -{ - Tcl_CreateCommand (interp, "gettext", tcl_gettext, (ClientData) 0, - (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand (interp, "textdomain", tcl_textdomain, (ClientData) 0, - (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand (interp, "bindtextdomain", tcl_bindtextdomain, - (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); - - return TCL_OK; -} - static int -tcl_gettext (client_data, interp, argc, argv) - ClientData client_data; - Tcl_Interp *interp; - int argc; - char *argv[]; +tcl_gettext (ClientData client_data, Tcl_Interp *interp, + int argc, char *argv[]) { const char *domainname = NULL; int category = LC_MESSAGES; @@ -130,11 +99,8 @@ tcl_gettext (client_data, interp, argc, argv) static int -tcl_textdomain (client_data, interp, argc, argv) - ClientData client_data; - Tcl_Interp *interp; - int argc; - char *argv[]; +tcl_textdomain (ClientData client_data, Tcl_Interp *interp, + int argc, char *argv[]) { if (argc != 2) { @@ -149,11 +115,8 @@ tcl_textdomain (client_data, interp, argc, argv) static int -tcl_bindtextdomain (client_data, interp, argc, argv) - ClientData client_data; - Tcl_Interp *interp; - int argc; - char *argv[]; +tcl_bindtextdomain (ClientData client_data, Tcl_Interp *interp, + int argc, char *argv[]) { if (argc != 3) { @@ -163,3 +126,19 @@ tcl_bindtextdomain (client_data, interp, argc, argv) return bindtextdomain (argv[1], argv[2]) == NULL ? TCL_ERROR : TCL_OK; } + + +/* Initialization functions. Called from the tclAppInit.c/tkAppInit.c + or while the dynamic loading with Tcl7.x, x>= 5. */ +int +Gettext_Init (Tcl_Interp *interp) +{ + Tcl_CreateCommand (interp, "gettext", tcl_gettext, (ClientData) 0, + (Tcl_CmdDeleteProc *) NULL); + Tcl_CreateCommand (interp, "textdomain", tcl_textdomain, (ClientData) 0, + (Tcl_CmdDeleteProc *) NULL); + Tcl_CreateCommand (interp, "bindtextdomain", tcl_bindtextdomain, + (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); + + return TCL_OK; +} diff --git a/os2/configure.awk b/os2/configure.awk index 58f01fcae..c23e4a108 100644 --- a/os2/configure.awk +++ b/os2/configure.awk @@ -56,7 +56,6 @@ BEGIN{ cfg["HAVE_ICONV"] = 1; cfg["ICONV_CONST"] = "const"; cfg["_GNU_SOURCE"] = 1; - cfg["HAVE_C_BACKSLASH_A"] = 1; cfg["HAVE_UNSIGNED_LONG_LONG"] = 1; cfg["HAVE_PTRDIFF_T"] = 1; cfg["vfork"] = "fork"; diff --git a/src/ChangeLog b/src/ChangeLog index 9c872b5c6..534e68a70 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,307 @@ +2002-11-13 Bruno Haible + + Assume ANSI C. + * dir-list.h (dir_list_append, dir_list_nth, dir_list_save_reset, + dir_list_restore): Use ANSI C function declarations. + * dir-list.c (dir_list_append, dir_list_nth, dir_list_restore): + Likewise. + * file-list.h (read_names_from_file): Likewise. + * file-list.c (read_names_from_file): Likewise. + * format.h (struct formatstring_parser, get_c99_format_directives): + Likewise. + * format-awk.c (numbered_arg_compare, format_parse, format_free, + format_get_number_of_directives, format_check, format_print): Likewise. + * format-c.c (numbered_arg_compare, format_parse, format_free, + format_get_number_of_directives, format_check, + get_c99_format_directives, format_print): Likewise. + * format-elisp.c (numbered_arg_compare, format_parse, format_free, + format_get_number_of_directives, format_check, format_print): Likewise. + * format-java.c (message_format_parse, date_format_parse, + number_format_parse, choice_format_parse, numbered_arg_compare, + format_parse, format_free, format_get_number_of_directives, + format_check, format_print): Likewise. + * format-librep.c (numbered_arg_compare, format_parse, format_free, + format_get_number_of_directives, format_check, format_print): Likewise. + * format-lisp.c (verify_element, verify_list, free_element, free_list, + copy_element, copy_list, equal_element, equal_list, + ensure_initial_alloc, grow_initial_alloc, ensure_repeated_alloc, + grow_repeated_alloc, normalize_outermost_list, normalize_list, + is_empty_list, unfold_loop, rotate_loop, initial_splitelement, + initial_unshare, shift_list, make_intersected_element, + append_repeated_to_initial, backtrack_in_initial, + make_intersected_list, make_intersection_with_empty_list, + intersection, make_union_element, make_union_list, + make_union_with_empty_list, union, is_required, + add_required_constraint, add_end_constraint, add_type_constraint, + add_listtype_constraint, add_req_type_constraint, + add_req_listtype_constraint, make_repeated_list_of_lists, + make_repeated_list, check_params, nocheck_params, parse_upto, + format_parse, format_free, format_get_number_of_directives, + format_check, print_element, print_list, format_print): Likewise. + * format-pascal.c (numbered_arg_compare, format_parse, format_free, + format_get_number_of_directives, format_check, format_print): Likewise. + * format-php.c (numbered_arg_compare, format_parse, format_free, + format_get_number_of_directives, format_check, format_print): Likewise. + * format-python.c (named_arg_compare, format_parse, format_free, + format_get_number_of_directives, format_check, format_print): Likewise. + * format-tcl.c (numbered_arg_compare, format_parse, format_free, + format_get_number_of_directives, format_check, format_print): Likewise. + * format-ycp.c (format_parse, format_free, + format_get_number_of_directives, format_check, format_print): Likewise. + * gettext.c (main, usage, expand_escape): Likewise. + * hostname.c (main, usage): Likewise. + * message.h (possible_format_p, message_alloc, message_free, + message_comment_append, message_comment_dot_append, + message_comment_filepos, message_copy, message_list_alloc, + message_list_free, message_list_append, message_list_prepend, + message_list_delete_nth, message_predicate_ty, + message_list_remove_if_not, message_list_search, + message_list_search_fuzzy, message_list_list_alloc, + message_list_list_free, message_list_list_append, + message_list_list_append_list, message_list_list_search, + message_list_list_search_fuzzy, msgdomain_alloc, msgdomain_free, + msgdomain_list_alloc, msgdomain_list_free, msgdomain_list_append, + msgdomain_list_append_list, msgdomain_list_sublist, + msgdomain_list_search, msgdomain_list_search_fuzzy): Likewise. + * message.c (possible_format_p, message_alloc, message_free, + message_comment_append, message_comment_dot_append, + message_comment_filepos, message_copy, message_list_alloc, + message_list_free, message_list_append, message_list_prepend, + message_list_delete_nth, message_list_remove_if_not, + message_list_search, message_list_search_fuzzy_inner, + message_list_search_fuzzy, message_list_list_free, + message_list_list_append, message_list_list_append_list, + message_list_list_search, message_list_list_search_fuzzy, + msgdomain_alloc, msgdomain_free, msgdomain_list_alloc, + msgdomain_list_free, msgdomain_list_append, + msgdomain_list_append_list, msgdomain_list_sublist, + msgdomain_list_search, msgdomain_list_search_fuzzy): Likewise. + * msgattrib.c (main, usage, is_message_selected, process_message_list, + process_msgdomain_list): Likewise. + * msgcat.c (main, usage): Likewise. + * msgcmp.c (main, usage, is_message_selected, remove_obsoletes, + match_domain, compare): Likewise. + * msgcomm.c (main, usage): Likewise. + * msgconv.c (locale_charset, main, usage): Likewise. + * msgen.c (main, usage): Likewise. + * msgexec.c (main, usage, nonintr_close, process_string, + process_message, process_message_list, process_msgdomain_list): + Likewise. + * msgfilter.c (main, usage, nonintr_close, nonintr_read, nonintr_write, + nonintr_select, process_string, process_message, process_message_list, + process_msgdomain_list): Likewise. + * msgfmt.c (main, usage, add_mo_suffix, new_domain, is_nonobsolete, + sigfpe_handler, check_plural_eval, check_plural, check_pair, + check_header_entry, format_constructor, format_debrief, + format_directive_domain, format_directive_message, + format_comment_special, read_po_file): Likewise. + * msggrep.c (main, no_pass, usage, filename_list_match, nonintr_close, + is_string_selected, is_message_selected, process_message_list, + process_msgdomain_list): Likewise. + * msginit.c (locale_charset, _nl_locale_name, _nl_expand_alias, main, + usage, catalogname_for_locale, language_of_locale, po_revision_date, + content_type, fields, get_field, put_field, subst_string, + subst_string_list, fill_header): Likewise. + * msgl-ascii.h (is_ascii_string, is_ascii_string_list, + is_ascii_message, is_ascii_message_list): Likewise. + * msgl-ascii.c (is_ascii_string, is_ascii_string_list, + is_ascii_message, is_ascii_message_list): Likewise. + * msgl-cat.h (catenate_msgdomain_list): Likewise. + * msgl-cat.c (is_message_selected, is_message_needed, + is_message_first_needed, catenate_msgdomain_list): Likewise. + * msgl-charset.h (compare_po_locale_charsets): Likewise. + * msgl-charset.c (locale_charset, compare_po_locale_charsets): + Likewise. + * msgl-english.h (msgdomain_list_english): Likewise. + * msgl-english.c (msgdomain_list_english): Likewise. + * msgl-equal.h (string_list_equal, message_equal, message_list_equal, + msgdomain_list_equal): Likewise. + * msgl-equal.c (msgstr_equal, msgstr_equal_ignoring_potcdate, + pos_equal, string_list_equal, message_equal, message_list_equal, + msgdomain_equal, msgdomain_list_equal): Likewise. + * msgl-iconv.h (convert_string, iconv_message_list, + iconv_msgdomain_list): Likewise. + * msgl-iconv.c (iconv_string, convert_string, convert_string_list, + convert_msgid, convert_msgstr, iconv_message_list, + iconv_msgdomain_list): Likewise. + * msgmerge.c (main, usage, compendium, msgfmt_check_pair_fails, + message_merge, match_domain, merge): Likewise. + * msgunfmt.c (main, usage): Likewise. + * msguniq.c (main, usage): Likewise. + * ngettext.c (main, usage, expand_escape): Likewise. + * open-po.h (open_po_file): Likewise. + * open-po.c (open_po_file): Likewise. + * po-charset.h (po_charset_canonicalize, po_charset_ascii_compatible, + po_is_charset_weird, po_is_charset_weird_cjk, po_lex_charset_init, + po_lex_charset_set, po_lex_charset_close): Likewise. + * po-charset.c (po_charset_canonicalize, po_charset_ascii_compatible, + po_is_charset_weird, po_is_charset_weird_cjk, po_lex_charset_set): + Likewise. + * po-gram.h (po_gram_parse): Likewise. + * po-hash-gen.y (yyerror, yylex, po_hash): Likewise. + * po-hash.h (po_hash): Likewise. + * po-lex.h (lex_start, lex_end, lex_open, lex_close, po_gram_lex, + po_lex_pass_comments, po_lex_pass_obsolete_entries, po_gram_error, + po_gram_error_at_line): Likewise. + * po-lex.c: Include instead of libstdarg.h. + (ALERT_CHAR): Remove macro. + (po_gram_error, po_gram_error_at_line): Use ANSI C function + declarations. Use va_start instead of VA_START. + (memcpy_small, mb_iseof, mb_ptr, mb_len, mb_iseq, mb_isnul, mb_cmp, + mb_equal, mb_isascii, mb_width, mb_putc, mb_setascii, mb_copy, + mbfile_init, mbfile_getc, mbfile_ungetc, lex_start, lex_open, + lex_getc, lex_ungetc, keyword_p, po_lex_pass_comments, + po_lex_pass_obsolete_entries): Use ANSI C function declarations. + * po-time.h (po_strftime): Likewise. + * po-time.c (difftm, po_strftime): Likewise. + * po.h (struct po_method_ty, po_alloc, po_scan, po_scan_file, po_free, + po_callback_domain, po_callback_message, po_callback_comment, + po_callback_comment_dot, po_callback_comment_filepos, + po_parse_comment_special): Likewise. + * po.c (po_alloc, po_free, po_parse_brief, po_parse_debrief, po_scan, + po_scan_file, po_directive_domain, po_callback_domain, + po_directive_message, po_callback_message, po_comment_special, + po_comment, po_comment_dot, po_callback_comment, po_comment_filepos, + po_callback_comment_filepos, po_parse_comment_special): Likewise. + * read-java.h (msgdomain_read_java): Likewise. + * read-java.c (execute_and_read_po_output, msgdomain_read_java): + Likewise. + * read-mo.h (read_mo_file): Likewise. + * read-mo.c (read_binary_mo_file, get_uint32, get_string, + get_sysdep_string, read_mo_file): Likewise. + * read-po.h (read_po, read_po_file): Likewise. + * read-po.c (readall_constructor, readall_destructor, + readall_directive_domain, readall_directive_message, + readall_parse_brief, readall_comment, readall_comment_dot, + readall_comment_special, readall_comment_filepos, read_po, + read_po_file): Likewise. + * read-tcl.h (msgdomain_read_tcl): Likewise. + * read-tcl.c (msgdomain_read_tcl): Likewise. + * str-list.h (string_list_init, string_list_alloc, string_list_append, + string_list_append_unique, string_list_destroy, string_list_free, + string_list_concat, string_list_concat_destroy, string_list_join, + string_list_member): Likewise. + * str-list.c (string_list_init, string_list_append, + string_list_append_unique, string_list_destroy, string_list_free, + string_list_concat, string_list_concat_destroy, string_list_join, + string_list_member): Likewise. + * urlget.c (main, usage, cat_file, execute_it, fetch): Likewise. + * write-java.h (msgdomain_write_java): Likewise. + * write-java.c (check_resource_name, string_hashcode, + compute_hashsize, compare_index, compute_table_items, + write_java_string, write_java_msgstr, write_lookup_code, + is_expression_boolean, write_java_expression, write_java_code, + cleanup, msgdomain_write_java): Likewise. + * write-mo.h (msgdomain_write_mo): Likewise. + * write-mo.c (compare_id, write_table, msgdomain_write_mo): Likewise. + * write-po.h (message_page_width_set, message_page_width_ignore, + message_print_style_indent, message_print_style_uniforum, + message_print_style_escape, msgdomain_list_print, + msgdomain_list_sort_by_msgid, msgdomain_list_sort_by_filepos): + Likewise. + * write-po.c (message_page_width_set, message_print_style_escape, + make_format_description_string, significant_format_p, + has_significant_format_p, make_c_width_description_string, + memcpy_small, wrap, print_blank_line, message_print, + message_print_obsolete, msgdomain_list_print, cmp_by_msgid, + msgdomain_list_sort_by_msgid, cmp_filepos, + msgdomain_list_sort_filepos, cmp_by_filepos, + msgdomain_list_sort_by_filepos): Likewise. + * write-tcl.h (msgdomain_write_tcl): Likewise. + * write-tcl.c (write_tcl_string, write_msg, msgdomain_write_tcl): + Likewise. + * x-awk.h (extract_awk, x_awk_keyword, x_awk_extract_all): Likewise. + * x-awk.c (ALERT_CHAR): Remove macro. + (x_awk_keyword, phase1_ungetc, phase2_ungetc, free_token, x_awk_lex, + extract_parenthesized, extract_awk): Use ANSI C function declarations. + * x-c.h (extract_c, x_c_extract_all, x_c_keyword, x_c_any_keywords, + x_c_trigraphs): Likewise. + * x-c.c (ALERT_CHAR): Remove macro. + (x_c_keyword, phase1_ungetc, phase2_ungetc, phase3_ungetc, + comment_add, comment_line_end, phase4_ungetc, phase7_ungetc, + free_token, phase5_get, phaseX_get, phase6_get, phase6_unget, + is_inttypes_macro, phase8a_get, phase8a_unget, phase8_get, x_c_lex, + extract_parenthesized, extract_c): Use ANSI C function declarations. + * x-elisp.h (extract_elisp, x_elisp_extract_all, x_elisp_keyword): + Likewise. + * x-elisp.c (ALERT_CHAR): Remove macro. + (x_elisp_keyword, do_ungetc, init_token, free_token, grow_token, + is_integer, is_float, read_token, comment_add, comment_line_end, + free_object, string_of_object, do_getc_escaped, read_object, + extract_elisp): Use ANSI C function declarations. + * x-glade.h (extract_glade, x_glade_extract_all, x_glade_keyword): + Likewise. + * x-glade.c (x_glade_keyword, XML_StartElementHandler, + XML_EndElementHandler, XML_CharacterDataHandler, XML_CommentHandler, + p_XML_ParserCreate, p_XML_SetElementHandler, + p_XML_SetCharacterDataHandler, p_XML_SetCommentHandler, p_XML_Parse, + p_XML_GetErrorCode, p_XML_GetCurrentLineNumber, + p_XML_GetCurrentColumnNumber, p_XML_ParserFree, p_XML_ErrorString, + ensure_stack_size, start_element_handler, end_element_handler, + character_data_handler, comment_handler, do_extract_glade, + extract_glade): Likewise. + * x-java.h (extract_java, x_java_keyword, x_java_extract_all): + Likewise. + * x-java.l (append_char_buf, get_string, destroy_charbuf, + update_line_no, strip_ending_spaces, append_strings, isplus, isdot, + translate_esc, object_list_destroy, get_num_objects, get_object, + add_object, alloc_keyword, tailcmp, do_compare, is_keyword, + x_java_keyword, extract_java): Likewise. + * x-librep.h (extract_librep, x_librep_extract_all, x_librep_keyword): + Likewise. + * x-librep.c (ALERT_CHAR): Remove macro. + (x_librep_keyword, do_ungetc, init_token, free_token, grow_token, + read_token, comment_add, comment_line_end, free_object, + string_of_object, do_getc_escaped, read_object, extract_librep): Use + ANSI C function declarations. + * x-lisp.h (extract_lisp, x_lisp_extract_all, x_lisp_keyword): + Likewise. + * x-lisp.c (x_lisp_keyword, do_ungetc, syntax_code_of, + read_char_syntax, attribute_of, init_token, free_token, grow_token, + read_token, has_a_dot, all_a_number, a_letter_to_digit, has_a_digit, + has_adjacent_letters, is_potential_number, is_number, upcase_token, + downcase_token, case_convert_token, comment_add, comment_line_end, + free_object, string_of_object, read_object, extract_lisp): Likewise. + * x-php.h (extract_php, x_php_keyword, x_php_extract_all): Likewise. + * x-php.c (x_php_keyword, phase1_ungetc, phase2_ungetc, comment_add, + comment_line_end, phase3_ungetc, free_token, x_php_lex, + extract_parenthesized, extract_php): Likewise. + * x-po.h (extract_po): Likewise. + * x-po.c (extract_constructor, extract_directive_domain, + extract_directive_message, extract_parse_brief, extract_comment, + extract_comment_dot, extract_comment_filepos, extract_comment_special, + extract_po): Likewise. + * x-python.h (extract_python, x_python_keyword, x_python_extract_all): + Likewise. + * x-python.c (ALERT_CHAR): Remove macro. + (x_python_keyword, phase1_ungetc, comment_add, phase2_ungetc, + phase7_getuc, phase5_get, phase5_unget, x_python_lex, + extract_parenthesized, extract_python): Use ANSI C function + declarations. + * x-rst.h (extract_rst): Likewise. + * x-rst.c (extract_rst): Likewise. + * x-smalltalk.h (extract_smalltalk): Likewise. + * x-smalltalk.c (phase1_ungetc, comment_add, phase2_get, phase2_unget, + x_smalltalk_lex, extract_smalltalk): Likewise. + * x-tcl.h (extract_tcl, x_tcl_extract_all, x_tcl_keyword): Likewise. + * x-tcl.c (ALERT_CHAR): Remove macro. + (x_tcl_keyword, do_ungetc, phase1_ungetc, phase2_pop, phase2_ungetc, + init_token, free_token, grow_token, comment_add, free_word, + string_of_word, accumulate_word, read_word, read_command, + read_command_list, extract_tcl): Use ANSI C function declarations. + * x-ycp.h (extract_ycp): Likewise. + * x-ycp.c (phase1_ungetc, phase2_ungetc, x_ycp_lex, extract_ycp): + Likewise. + * xgettext.h (split_keywordspec, xgettext_comment_add, + xgettext_comment, xgettext_comment_reset, remember_a_message, + remember_a_message_plural): Likewise. + * xgettext.c (extractor_func, main, usage, exclude_directive_domain, + exclude_directive_message, read_exclusion_file, split_keywordspec, + xgettext_comment_add, xgettext_comment, xgettext_open, + extract_from_file, remember_a_message, remember_a_message_plural, + finalize_header, language_to_extractor, extension_to_language): + Likewise. + 2002-11-05 Bruno Haible Allow non-ASCII msgids in POT files. diff --git a/src/dir-list.c b/src/dir-list.c index d3bfde903..4b8c374a1 100644 --- a/src/dir-list.c +++ b/src/dir-list.c @@ -35,8 +35,7 @@ static string_list_ty *directory /* = NULL */; /* Append a directory to the end of the list of directories. */ void -dir_list_append (s) - const char *s; +dir_list_append (const char *s) { if (directory == NULL) directory = string_list_alloc (); @@ -46,8 +45,7 @@ dir_list_append (s) /* Return the nth directory, or NULL of n is out of range. */ const char * -dir_list_nth (n) - int n; +dir_list_nth (int n) { /* The default value of the list consists of the single directory ".". */ if (directory == NULL) @@ -73,8 +71,7 @@ dir_list_save_reset () /* Restore a previously saved list of directories. */ void -dir_list_restore (saved_value) - void *saved_value; +dir_list_restore (void *saved_value) { /* Don't free the contained strings, because they may have been returned by dir_list_nth and may still be in use. */ diff --git a/src/dir-list.h b/src/dir-list.h index f712189ce..dc8ad21c6 100644 --- a/src/dir-list.h +++ b/src/dir-list.h @@ -25,16 +25,16 @@ list consists of the single directory ".". */ /* Append a directory to the end of the list of directories. */ -extern void dir_list_append PARAMS ((const char *directory)); +extern void dir_list_append (const char *directory); /* Return the nth directory, or NULL of n is out of range. */ -extern const char *dir_list_nth PARAMS ((int n)); +extern const char *dir_list_nth (int n); /* Return the current list of directories, for later use with dir_list_restore. Reset the list to empty. */ -extern void *dir_list_save_reset PARAMS ((void)); +extern void *dir_list_save_reset (void); /* Restore a previously saved list of directories. */ -extern void dir_list_restore PARAMS ((void *saved_value)); +extern void dir_list_restore (void *saved_value); #endif /* _DIR_LIST_H */ diff --git a/src/file-list.c b/src/file-list.c index 2c9a007c1..d349769b7 100644 --- a/src/file-list.c +++ b/src/file-list.c @@ -1,5 +1,5 @@ /* Reading file lists. - Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -39,8 +39,7 @@ /* Read list of filenames from a file. */ string_list_ty * -read_names_from_file (file_name) - const char *file_name; +read_names_from_file (const char *file_name) { size_t line_len = 0; char *line_buf = NULL; diff --git a/src/file-list.h b/src/file-list.h index 3326c7fae..9d34d0f4a 100644 --- a/src/file-list.h +++ b/src/file-list.h @@ -1,5 +1,5 @@ /* Reading file lists. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -24,6 +24,6 @@ /* Read list of filenames from a file. One filename per line. Lines starting with # and whitespace lines are ignored. Trailing whitespace is removed. */ -extern string_list_ty *read_names_from_file PARAMS ((const char *file_name)); +extern string_list_ty *read_names_from_file (const char *file_name); #endif /* _FILE_LIST_H */ diff --git a/src/format-awk.c b/src/format-awk.c index add968fd8..0c8bbd51c 100644 --- a/src/format-awk.c +++ b/src/format-awk.c @@ -83,22 +83,8 @@ struct spec #define isdigit(c) ((unsigned int) ((c) - '0') < 10) -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static int numbered_arg_compare PARAMS ((const void *p1, const void *p2)); -static void *format_parse PARAMS ((const char *format)); -static void format_free PARAMS ((void *descr)); -static int format_get_number_of_directives PARAMS ((void *descr)); -static bool format_check PARAMS ((const lex_pos_ty *pos, - void *msgid_descr, void *msgstr_descr, - bool equality, - bool noisy, const char *pretty_msgstr)); - - static int -numbered_arg_compare (p1, p2) - const void *p1; - const void *p2; +numbered_arg_compare (const void *p1, const void *p2) { unsigned int n1 = ((const struct numbered_arg *) p1)->number; unsigned int n2 = ((const struct numbered_arg *) p2)->number; @@ -107,8 +93,7 @@ numbered_arg_compare (p1, p2) } static void * -format_parse (format) - const char *format; +format_parse (const char *format) { struct spec spec; unsigned int unnumbered_arg_count; @@ -415,8 +400,7 @@ format_parse (format) } static void -format_free (descr) - void *descr; +format_free (void *descr) { struct spec *spec = (struct spec *) descr; @@ -426,8 +410,7 @@ format_free (descr) } static int -format_get_number_of_directives (descr) - void *descr; +format_get_number_of_directives (void *descr) { struct spec *spec = (struct spec *) descr; @@ -435,13 +418,8 @@ format_get_number_of_directives (descr) } static bool -format_check (pos, msgid_descr, msgstr_descr, equality, noisy, pretty_msgstr) - const lex_pos_ty *pos; - void *msgid_descr; - void *msgstr_descr; - bool equality; - bool noisy; - const char *pretty_msgstr; +format_check (const lex_pos_ty *pos, void *msgid_descr, void *msgstr_descr, + bool equality, bool noisy, const char *pretty_msgstr) { struct spec *spec1 = (struct spec *) msgid_descr; struct spec *spec2 = (struct spec *) msgstr_descr; @@ -546,8 +524,7 @@ struct formatstring_parser formatstring_awk = #include "getline.h" static void -format_print (descr) - void *descr; +format_print (void *descr) { struct spec *spec = (struct spec *) descr; unsigned int last; diff --git a/src/format-c.c b/src/format-c.c index 2101874d2..ad9b3e616 100644 --- a/src/format-c.c +++ b/src/format-c.c @@ -160,22 +160,8 @@ struct spec #define isdigit(c) ((unsigned int) ((c) - '0') < 10) -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static int numbered_arg_compare PARAMS ((const void *p1, const void *p2)); -static void *format_parse PARAMS ((const char *format)); -static void format_free PARAMS ((void *descr)); -static int format_get_number_of_directives PARAMS ((void *descr)); -static bool format_check PARAMS ((const lex_pos_ty *pos, - void *msgid_descr, void *msgstr_descr, - bool equality, - bool noisy, const char *pretty_msgstr)); - - static int -numbered_arg_compare (p1, p2) - const void *p1; - const void *p2; +numbered_arg_compare (const void *p1, const void *p2) { unsigned int n1 = ((const struct numbered_arg *) p1)->number; unsigned int n2 = ((const struct numbered_arg *) p2)->number; @@ -184,8 +170,7 @@ numbered_arg_compare (p1, p2) } static void * -format_parse (format) - const char *format; +format_parse (const char *format) { struct spec spec; unsigned int numbered_arg_count; @@ -713,8 +698,7 @@ format_parse (format) } static void -format_free (descr) - void *descr; +format_free (void *descr) { struct spec *spec = (struct spec *) descr; @@ -726,8 +710,7 @@ format_free (descr) } static int -format_get_number_of_directives (descr) - void *descr; +format_get_number_of_directives (void *descr) { struct spec *spec = (struct spec *) descr; @@ -735,13 +718,8 @@ format_get_number_of_directives (descr) } static bool -format_check (pos, msgid_descr, msgstr_descr, equality, noisy, pretty_msgstr) - const lex_pos_ty *pos; - void *msgid_descr; - void *msgstr_descr; - bool equality; - bool noisy; - const char *pretty_msgstr; +format_check (const lex_pos_ty *pos, void *msgid_descr, void *msgstr_descr, + bool equality, bool noisy, const char *pretty_msgstr) { struct spec *spec1 = (struct spec *) msgid_descr; struct spec *spec2 = (struct spec *) msgstr_descr; @@ -792,10 +770,8 @@ struct formatstring_parser formatstring_c = void -get_c99_format_directives (string, intervalsp, lengthp) - const char *string; - struct interval **intervalsp; - size_t *lengthp; +get_c99_format_directives (const char *string, + struct interval **intervalsp, size_t *lengthp) { struct spec *descr = (struct spec *) format_parse (string); @@ -831,8 +807,7 @@ get_c99_format_directives (string, intervalsp, lengthp) #include "getline.h" static void -format_print (descr) - void *descr; +format_print (void *descr) { struct spec *spec = (struct spec *) descr; unsigned int i; diff --git a/src/format-elisp.c b/src/format-elisp.c index fa366eed2..b121a4c0e 100644 --- a/src/format-elisp.c +++ b/src/format-elisp.c @@ -84,22 +84,8 @@ struct spec #define isdigit(c) ((unsigned int) ((c) - '0') < 10) -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static int numbered_arg_compare PARAMS ((const void *p1, const void *p2)); -static void *format_parse PARAMS ((const char *format)); -static void format_free PARAMS ((void *descr)); -static int format_get_number_of_directives PARAMS ((void *descr)); -static bool format_check PARAMS ((const lex_pos_ty *pos, - void *msgid_descr, void *msgstr_descr, - bool equality, - bool noisy, const char *pretty_msgstr)); - - static int -numbered_arg_compare (p1, p2) - const void *p1; - const void *p2; +numbered_arg_compare (const void *p1, const void *p2) { unsigned int n1 = ((const struct numbered_arg *) p1)->number; unsigned int n2 = ((const struct numbered_arg *) p2)->number; @@ -108,8 +94,7 @@ numbered_arg_compare (p1, p2) } static void * -format_parse (format) - const char *format; +format_parse (const char *format) { struct spec spec; struct spec *result; @@ -292,8 +277,7 @@ format_parse (format) } static void -format_free (descr) - void *descr; +format_free (void *descr) { struct spec *spec = (struct spec *) descr; @@ -303,8 +287,7 @@ format_free (descr) } static int -format_get_number_of_directives (descr) - void *descr; +format_get_number_of_directives (void *descr) { struct spec *spec = (struct spec *) descr; @@ -312,13 +295,8 @@ format_get_number_of_directives (descr) } static bool -format_check (pos, msgid_descr, msgstr_descr, equality, noisy, pretty_msgstr) - const lex_pos_ty *pos; - void *msgid_descr; - void *msgstr_descr; - bool equality; - bool noisy; - const char *pretty_msgstr; +format_check (const lex_pos_ty *pos, void *msgid_descr, void *msgstr_descr, + bool equality, bool noisy, const char *pretty_msgstr) { struct spec *spec1 = (struct spec *) msgid_descr; struct spec *spec2 = (struct spec *) msgstr_descr; @@ -423,8 +401,7 @@ struct formatstring_parser formatstring_elisp = #include "getline.h" static void -format_print (descr) - void *descr; +format_print (void *descr) { struct spec *spec = (struct spec *) descr; unsigned int last; diff --git a/src/format-java.c b/src/format-java.c index 6b49cd574..3665f665c 100644 --- a/src/format-java.c +++ b/src/format-java.c @@ -1,5 +1,5 @@ /* Java format strings. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -126,22 +126,10 @@ struct spec }; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static bool message_format_parse PARAMS ((const char *format, - struct spec *spec)); -static bool date_format_parse PARAMS ((const char *format)); -static bool number_format_parse PARAMS ((const char *format)); -static bool choice_format_parse PARAMS ((const char *format, - struct spec *spec)); -static int numbered_arg_compare PARAMS ((const void *p1, const void *p2)); -static void *format_parse PARAMS ((const char *format)); -static void format_free PARAMS ((void *descr)); -static int format_get_number_of_directives PARAMS ((void *descr)); -static bool format_check PARAMS ((const lex_pos_ty *pos, - void *msgid_descr, void *msgstr_descr, - bool equality, - bool noisy, const char *pretty_msgstr)); +/* Forward declaration of local functions. */ +static bool date_format_parse (const char *format); +static bool number_format_parse (const char *format); +static bool choice_format_parse (const char *format, struct spec *spec); /* Quote handling: @@ -159,9 +147,7 @@ static bool format_check PARAMS ((const lex_pos_ty *pos, /* Return true if a format is a valid messageFormatPattern. Extracts argument type information into spec. */ static bool -message_format_parse (format, spec) - const char *format; - struct spec *spec; +message_format_parse (const char *format, struct spec *spec) { bool quoting = false; @@ -286,8 +272,7 @@ message_format_parse (format, spec) /* Return true if a format is a valid dateFormatPattern. */ static bool -date_format_parse (format) - const char *format; +date_format_parse (const char *format) { /* Any string is valid. Single-quote starts a quoted section, to be terminated at the next single-quote or string end. Double single-quote @@ -299,8 +284,7 @@ date_format_parse (format) /* Return true if a format is a valid numberFormatPattern. */ static bool -number_format_parse (format) - const char *format; +number_format_parse (const char *format) { /* Pattern Syntax: pattern := pos_pattern{';' neg_pattern} @@ -443,9 +427,7 @@ number_format_parse (format) /* Return true if a format is a valid choiceFormatPattern. Extracts argument type information into spec. */ static bool -choice_format_parse (format, spec) - const char *format; - struct spec *spec; +choice_format_parse (const char *format, struct spec *spec) { /* Pattern syntax: pattern := | choice | choice '|' pattern @@ -525,9 +507,7 @@ choice_format_parse (format, spec) } static int -numbered_arg_compare (p1, p2) - const void *p1; - const void *p2; +numbered_arg_compare (const void *p1, const void *p2) { unsigned int n1 = ((const struct numbered_arg *) p1)->number; unsigned int n2 = ((const struct numbered_arg *) p2)->number; @@ -536,8 +516,7 @@ numbered_arg_compare (p1, p2) } static void * -format_parse (format) - const char *format; +format_parse (const char *format) { struct spec spec; struct spec *result; @@ -603,8 +582,7 @@ format_parse (format) } static void -format_free (descr) - void *descr; +format_free (void *descr) { struct spec *spec = (struct spec *) descr; @@ -614,8 +592,7 @@ format_free (descr) } static int -format_get_number_of_directives (descr) - void *descr; +format_get_number_of_directives (void *descr) { struct spec *spec = (struct spec *) descr; @@ -623,13 +600,8 @@ format_get_number_of_directives (descr) } static bool -format_check (pos, msgid_descr, msgstr_descr, equality, noisy, pretty_msgstr) - const lex_pos_ty *pos; - void *msgid_descr; - void *msgstr_descr; - bool equality; - bool noisy; - const char *pretty_msgstr; +format_check (const lex_pos_ty *pos, void *msgid_descr, void *msgstr_descr, + bool equality, bool noisy, const char *pretty_msgstr) { struct spec *spec1 = (struct spec *) msgid_descr; struct spec *spec2 = (struct spec *) msgstr_descr; @@ -734,8 +706,7 @@ struct formatstring_parser formatstring_java = #include "getline.h" static void -format_print (descr) - void *descr; +format_print (void *descr) { struct spec *spec = (struct spec *) descr; unsigned int last; diff --git a/src/format-librep.c b/src/format-librep.c index 97d2c9572..71cad3fd6 100644 --- a/src/format-librep.c +++ b/src/format-librep.c @@ -81,22 +81,8 @@ struct spec #define isdigit(c) ((unsigned int) ((c) - '0') < 10) -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static int numbered_arg_compare PARAMS ((const void *p1, const void *p2)); -static void *format_parse PARAMS ((const char *format)); -static void format_free PARAMS ((void *descr)); -static int format_get_number_of_directives PARAMS ((void *descr)); -static bool format_check PARAMS ((const lex_pos_ty *pos, - void *msgid_descr, void *msgstr_descr, - bool equality, - bool noisy, const char *pretty_msgstr)); - - static int -numbered_arg_compare (p1, p2) - const void *p1; - const void *p2; +numbered_arg_compare (const void *p1, const void *p2) { unsigned int n1 = ((const struct numbered_arg *) p1)->number; unsigned int n2 = ((const struct numbered_arg *) p2)->number; @@ -105,8 +91,7 @@ numbered_arg_compare (p1, p2) } static void * -format_parse (format) - const char *format; +format_parse (const char *format) { struct spec spec; struct spec *result; @@ -256,8 +241,7 @@ format_parse (format) } static void -format_free (descr) - void *descr; +format_free (void *descr) { struct spec *spec = (struct spec *) descr; @@ -267,8 +251,7 @@ format_free (descr) } static int -format_get_number_of_directives (descr) - void *descr; +format_get_number_of_directives (void *descr) { struct spec *spec = (struct spec *) descr; @@ -276,13 +259,8 @@ format_get_number_of_directives (descr) } static bool -format_check (pos, msgid_descr, msgstr_descr, equality, noisy, pretty_msgstr) - const lex_pos_ty *pos; - void *msgid_descr; - void *msgstr_descr; - bool equality; - bool noisy; - const char *pretty_msgstr; +format_check (const lex_pos_ty *pos, void *msgid_descr, void *msgstr_descr, + bool equality, bool noisy, const char *pretty_msgstr) { struct spec *spec1 = (struct spec *) msgid_descr; struct spec *spec2 = (struct spec *) msgstr_descr; @@ -387,8 +365,7 @@ struct formatstring_parser formatstring_librep = #include "getline.h" static void -format_print (descr) - void *descr; +format_print (void *descr) { struct spec *spec = (struct spec *) descr; unsigned int last; diff --git a/src/format-lisp.c b/src/format-lisp.c index a09eefbd0..745c95dc7 100644 --- a/src/format-lisp.c +++ b/src/format-lisp.c @@ -1,5 +1,5 @@ /* Lisp format strings. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -126,121 +126,28 @@ struct param }; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ +/* Forward declaration of local functions. */ #define union make_union -static void verify_element PARAMS ((const struct format_arg * e)); -static void verify_list PARAMS ((const struct format_arg_list *list)); -static inline void free_element PARAMS ((struct format_arg *element)); -static void free_list PARAMS ((struct format_arg_list *list)); -static inline void copy_element PARAMS ((struct format_arg *newelement, - const struct format_arg *oldelement)); -static struct format_arg_list * copy_list - PARAMS ((const struct format_arg_list *list)); -static bool equal_element PARAMS ((const struct format_arg * e1, - const struct format_arg * e2)); -static bool equal_list PARAMS ((const struct format_arg_list *list1, - const struct format_arg_list *list2)); -static inline void ensure_initial_alloc PARAMS ((struct format_arg_list *list, - unsigned int newcount)); -static inline void grow_initial_alloc PARAMS ((struct format_arg_list *list)); -static inline void ensure_repeated_alloc PARAMS ((struct format_arg_list *list, - unsigned int newcount)); -static inline void grow_repeated_alloc PARAMS ((struct format_arg_list *list)); -static void normalize_outermost_list PARAMS ((struct format_arg_list *list)); -static void normalize_list PARAMS ((struct format_arg_list *list)); -static struct format_arg_list * make_unconstrained_list PARAMS ((void)); -static struct format_arg_list * make_empty_list PARAMS ((void)); -static bool is_empty_list PARAMS ((const struct format_arg_list *list)); -static void unfold_loop PARAMS ((struct format_arg_list *list, unsigned int m)); -static void rotate_loop PARAMS ((struct format_arg_list *list, unsigned int m)); -static unsigned int initial_splitelement PARAMS ((struct format_arg_list *list, - unsigned int n)); -static unsigned int initial_unshare PARAMS ((struct format_arg_list *list, - unsigned int n)); -static void shift_list PARAMS ((struct format_arg_list *list, unsigned int n)); -static bool make_intersected_element PARAMS ((struct format_arg *re, - const struct format_arg * e1, - const struct format_arg * e2)); -static void append_repeated_to_initial PARAMS ((struct format_arg_list *list)); -static struct format_arg_list * backtrack_in_initial - PARAMS ((struct format_arg_list *list)); +static void verify_list (const struct format_arg_list *list); +static void free_list (struct format_arg_list *list); +static struct format_arg_list * copy_list (const struct format_arg_list *list); +static bool equal_list (const struct format_arg_list *list1, + const struct format_arg_list *list2); static struct format_arg_list * make_intersected_list - PARAMS ((struct format_arg_list *list1, - struct format_arg_list *list2)); + (struct format_arg_list *list1, + struct format_arg_list *list2); static struct format_arg_list * make_intersection_with_empty_list - PARAMS ((struct format_arg_list *list)); -#ifdef unused -static struct format_arg_list * intersection - PARAMS ((struct format_arg_list *list1, - struct format_arg_list *list2)); -#endif -static void make_union_element PARAMS ((struct format_arg *re, - const struct format_arg * e1, - const struct format_arg * e2)); + (struct format_arg_list *list); static struct format_arg_list * make_union_list - PARAMS ((struct format_arg_list *list1, - struct format_arg_list *list2)); -static struct format_arg_list * make_union_with_empty_list - PARAMS ((struct format_arg_list *list)); -static struct format_arg_list * union PARAMS ((struct format_arg_list *list1, - struct format_arg_list *list2)); -static bool is_required PARAMS ((const struct format_arg_list *list, - unsigned int n)); -static struct format_arg_list * add_required_constraint - PARAMS ((struct format_arg_list *list, - unsigned int n)); -static struct format_arg_list * add_end_constraint - PARAMS ((struct format_arg_list *list, unsigned int n)); -static struct format_arg_list * add_type_constraint - PARAMS ((struct format_arg_list *list, unsigned int n, - enum format_arg_type type)); -static struct format_arg_list * add_listtype_constraint - PARAMS ((struct format_arg_list *list, unsigned int n, - enum format_arg_type type, - struct format_arg_list *sublist)); -static void add_req_type_constraint - PARAMS ((struct format_arg_list **listp, - unsigned int position, - enum format_arg_type type)); -static void add_req_listtype_constraint - PARAMS ((struct format_arg_list **listp, - unsigned int position, - enum format_arg_type type, - struct format_arg_list *sublist)); -static struct format_arg_list * make_repeated_list_of_lists - PARAMS ((struct format_arg_list *sublist)); -static struct format_arg_list * make_repeated_list - PARAMS ((struct format_arg_list *sublist, - unsigned int period)); -static bool check_params PARAMS ((struct format_arg_list **listp, - unsigned int paramcount, - struct param *params, unsigned int t_count, - const enum format_arg_type *t_types)); -static bool nocheck_params PARAMS ((struct format_arg_list **listp, - unsigned int paramcount, - struct param *params)); -static bool parse_upto PARAMS ((const char **formatp, int *positionp, - struct format_arg_list **listp, - struct format_arg_list **escapep, - int *separatorp, struct spec *spec, - /*promote: char*/ int terminator, - bool separator)); -static void *format_parse PARAMS ((const char *format)); -static void format_free PARAMS ((void *descr)); -static int format_get_number_of_directives PARAMS ((void *descr)); -static bool format_check PARAMS ((const lex_pos_ty *pos, - void *msgid_descr, void *msgstr_descr, - bool equality, - bool noisy, const char *pretty_msgstr)); + (struct format_arg_list *list1, + struct format_arg_list *list2); /* ======================= Verify a format_arg_list ======================= */ /* Verify some invariants. */ static void -verify_element (e) - const struct format_arg * e; +verify_element (const struct format_arg * e) { ASSERT (e->repcount > 0); if (e->type == FAT_LIST) @@ -250,8 +157,7 @@ verify_element (e) /* Verify some invariants. */ /* Memory effects: none. */ static void -verify_list (list) - const struct format_arg_list *list; +verify_list (const struct format_arg_list *list) { unsigned int i; unsigned int total_repcount; @@ -282,8 +188,7 @@ verify_list (list) /* Free the data belonging to an argument list element. */ static inline void -free_element (element) - struct format_arg *element; +free_element (struct format_arg *element) { if (element->type == FAT_LIST) free_list (element->list); @@ -292,8 +197,7 @@ free_element (element) /* Free an argument list. */ /* Memory effects: Frees list. */ static void -free_list (list) - struct format_arg_list *list; +free_list (struct format_arg_list *list) { unsigned int i; @@ -313,9 +217,8 @@ free_list (list) /* Copy the data belonging to an argument list element. */ static inline void -copy_element (newelement, oldelement) - struct format_arg *newelement; - const struct format_arg *oldelement; +copy_element (struct format_arg *newelement, + const struct format_arg *oldelement) { newelement->repcount = oldelement->repcount; newelement->presence = oldelement->presence; @@ -327,8 +230,7 @@ copy_element (newelement, oldelement) /* Copy an argument list. */ /* Memory effects: Freshly allocated result. */ static struct format_arg_list * -copy_list (list) - const struct format_arg_list *list; +copy_list (const struct format_arg_list *list) { struct format_arg_list *newlist; unsigned int length; @@ -388,9 +290,7 @@ copy_list (list) /* Tests whether two normalized argument constraints are equivalent, ignoring the repcount. */ static bool -equal_element (e1, e2) - const struct format_arg * e1; - const struct format_arg * e2; +equal_element (const struct format_arg * e1, const struct format_arg * e2) { return (e1->presence == e2->presence && e1->type == e2->type @@ -400,9 +300,8 @@ equal_element (e1, e2) /* Tests whether two normalized argument list constraints are equivalent. */ /* Memory effects: none. */ static bool -equal_list (list1, list2) - const struct format_arg_list *list1; - const struct format_arg_list *list2; +equal_list (const struct format_arg_list *list1, + const struct format_arg_list *list2) { unsigned int n, i; @@ -441,9 +340,7 @@ equal_list (list1, list2) /* Ensure list->initial.allocated >= newcount. */ static inline void -ensure_initial_alloc (list, newcount) - struct format_arg_list *list; - unsigned int newcount; +ensure_initial_alloc (struct format_arg_list *list, unsigned int newcount) { if (newcount > list->initial.allocated) { @@ -458,8 +355,7 @@ ensure_initial_alloc (list, newcount) /* Ensure list->initial.allocated > list->initial.count. */ static inline void -grow_initial_alloc (list) - struct format_arg_list *list; +grow_initial_alloc (struct format_arg_list *list) { if (list->initial.count >= list->initial.allocated) { @@ -474,9 +370,7 @@ grow_initial_alloc (list) /* Ensure list->repeated.allocated >= newcount. */ static inline void -ensure_repeated_alloc (list, newcount) - struct format_arg_list *list; - unsigned int newcount; +ensure_repeated_alloc (struct format_arg_list *list, unsigned int newcount) { if (newcount > list->repeated.allocated) { @@ -491,8 +385,7 @@ ensure_repeated_alloc (list, newcount) /* Ensure list->repeated.allocated > list->repeated.count. */ static inline void -grow_repeated_alloc (list) - struct format_arg_list *list; +grow_repeated_alloc (struct format_arg_list *list) { if (list->repeated.count >= list->repeated.allocated) { @@ -512,8 +405,7 @@ grow_repeated_alloc (list) normalized. */ /* Memory effects: Destructively modifies list. */ static void -normalize_outermost_list (list) - struct format_arg_list *list; +normalize_outermost_list (struct format_arg_list *list) { unsigned int n, i, j; @@ -669,8 +561,7 @@ normalize_outermost_list (list) /* Normalize an argument list constraint. */ /* Memory effects: Destructively modifies list. */ static void -normalize_list (list) - struct format_arg_list *list; +normalize_list (struct format_arg_list *list) { unsigned int n, i; @@ -752,8 +643,7 @@ make_empty_list () /* Test for an empty list. */ /* Memory effects: none. */ static bool -is_empty_list (list) - const struct format_arg_list *list; +is_empty_list (const struct format_arg_list *list) { return (list->initial.count == 0 && list->repeated.count == 0); } @@ -765,9 +655,7 @@ is_empty_list (list) Assumes list->repeated.count > 0. */ /* Memory effects: list is destructively modified. */ static void -unfold_loop (list, m) - struct format_arg_list *list; - unsigned int m; +unfold_loop (struct format_arg_list *list, unsigned int m) { unsigned int i, j, k; @@ -788,9 +676,7 @@ unfold_loop (list, m) Assumes list->repeated.count > 0. */ /* Memory effects: list is destructively modified. */ static void -rotate_loop (list, m) - struct format_arg_list *list; - unsigned int m; +rotate_loop (struct format_arg_list *list, unsigned int m) { if (m == list->initial.length) return; @@ -899,9 +785,7 @@ rotate_loop (list, m) different adjacent elements. */ /* Memory effects: list is destructively modified. */ static unsigned int -initial_splitelement (list, n) - struct format_arg_list *list; - unsigned int n; +initial_splitelement (struct format_arg_list *list, unsigned int n) { unsigned int s; unsigned int t; @@ -949,9 +833,7 @@ initial_splitelement (list, n) /* Ensure index n in the initial segment is not shared. Return its index. */ /* Memory effects: list is destructively modified. */ static unsigned int -initial_unshare (list, n) - struct format_arg_list *list; - unsigned int n; +initial_unshare (struct format_arg_list *list, unsigned int n) { /* This does the same side effects as initial_splitelement (list, n); @@ -1033,9 +915,7 @@ initial_unshare (list, n) /* Add n unconstrained elements at the front of the list. */ /* Memory effects: list is destructively modified. */ static void -shift_list (list, n) - struct format_arg_list *list; - unsigned int n; +shift_list (struct format_arg_list *list, unsigned int n) { VERIFY_LIST (list); @@ -1066,10 +946,9 @@ shift_list (list, n) two constraints give a contradiction. */ /* Memory effects: Freshly allocated element's sublist. */ static bool -make_intersected_element (re, e1, e2) - struct format_arg *re; - const struct format_arg * e1; - const struct format_arg * e2; +make_intersected_element (struct format_arg *re, + const struct format_arg * e1, + const struct format_arg * e2) { /* Intersect the cdr types. */ if (e1->presence == FCT_REQUIRED || e2->presence == FCT_REQUIRED) @@ -1168,8 +1047,7 @@ make_intersected_element (re, e1, e2) /* Append list->repeated to list->initial, and clear list->repeated. */ /* Memory effects: list is destructively modified. */ static void -append_repeated_to_initial (list) - struct format_arg_list *list; +append_repeated_to_initial (struct format_arg_list *list) { if (list->repeated.count > 0) { @@ -1198,8 +1076,7 @@ append_repeated_to_initial (list) /* Memory effects: list is destructively modified. If NULL is returned, list is freed. */ static struct format_arg_list * -backtrack_in_initial (list) - struct format_arg_list *list; +backtrack_in_initial (struct format_arg_list *list) { ASSERT (list->repeated.count == 0); @@ -1239,9 +1116,8 @@ backtrack_in_initial (list) /* Memory effects: list1 and list2 are freed. The result, if non-NULL, is freshly allocated. */ static struct format_arg_list * -make_intersected_list (list1, list2) - struct format_arg_list *list1; - struct format_arg_list *list2; +make_intersected_list (struct format_arg_list *list1, + struct format_arg_list *list2) { struct format_arg_list *result; @@ -1449,8 +1325,7 @@ make_intersected_list (list1, list2) Return NULL if the intersection is empty. */ /* Memory effects: The result, if non-NULL, is freshly allocated. */ static struct format_arg_list * -make_intersection_with_empty_list (list) - struct format_arg_list *list; +make_intersection_with_empty_list (struct format_arg_list *list) { #if 0 /* equivalent but slower */ return make_intersected_list (copy_list (list), make_empty_list ()); @@ -1472,9 +1347,7 @@ make_intersection_with_empty_list (list) /* Memory effects: list1 and list2 are freed if non-NULL. The result, if non-NULL, is freshly allocated. */ static struct format_arg_list * -intersection (list1, list2) - struct format_arg_list *list1; - struct format_arg_list *list2; +intersection (struct format_arg_list *list1, struct format_arg_list *list2) { if (list1 != NULL) { @@ -1505,10 +1378,9 @@ intersection (list1, list2) /* Create the union (i.e. alternative constraints) of two argument constraints. */ static void -make_union_element (re, e1, e2) - struct format_arg *re; - const struct format_arg * e1; - const struct format_arg * e2; +make_union_element (struct format_arg *re, + const struct format_arg * e1, + const struct format_arg * e2) { /* Union of the cdr types. */ if (e1->presence == FCT_REQUIRED && e2->presence == FCT_REQUIRED) @@ -1608,9 +1480,7 @@ make_union_element (re, e1, e2) /* Memory effects: list1 and list2 are freed. The result is freshly allocated. */ static struct format_arg_list * -make_union_list (list1, list2) - struct format_arg_list *list1; - struct format_arg_list *list2; +make_union_list (struct format_arg_list *list1, struct format_arg_list *list2) { struct format_arg_list *result; @@ -1884,8 +1754,7 @@ make_union_list (list1, list2) /* Create the union of an argument list and the empty list. */ /* Memory effects: list is freed. The result is freshly allocated. */ static struct format_arg_list * -make_union_with_empty_list (list) - struct format_arg_list *list; +make_union_with_empty_list (struct format_arg_list *list) { #if 0 /* equivalent but slower */ return make_union_list (list, make_empty_list ()); @@ -1920,9 +1789,7 @@ make_union_with_empty_list (list) /* Memory effects: list1 and list2 are freed if non-NULL. The result, if non-NULL, is freshly allocated. */ static struct format_arg_list * -union (list1, list2) - struct format_arg_list *list1; - struct format_arg_list *list2; +union (struct format_arg_list *list1, struct format_arg_list *list2) { if (list1 != NULL) { @@ -1946,9 +1813,7 @@ union (list1, list2) /* Test whether arguments 0..n are required arguments in a list. */ static bool -is_required (list, n) - const struct format_arg_list *list; - unsigned int n; +is_required (const struct format_arg_list *list, unsigned int n) { unsigned int s; unsigned int t; @@ -2006,9 +1871,7 @@ is_required (list, n) present. NULL stands for an impossible situation, i.e. a contradiction. */ /* Memory effects: list is freed. The result is freshly allocated. */ static struct format_arg_list * -add_required_constraint (list, n) - struct format_arg_list *list; - unsigned int n; +add_required_constraint (struct format_arg_list *list, unsigned int n) { unsigned int i, rest; @@ -2045,9 +1908,7 @@ add_required_constraint (list, n) contradiction. */ /* Memory effects: list is freed. The result is freshly allocated. */ static struct format_arg_list * -add_end_constraint (list, n) - struct format_arg_list *list; - unsigned int n; +add_end_constraint (struct format_arg_list *list, unsigned int n) { unsigned int s, i; enum format_cdr_type n_presence; @@ -2095,10 +1956,8 @@ add_end_constraint (list, n) contradiction. Assumes a preceding add_required_constraint (list, n). */ /* Memory effects: list is freed. The result is freshly allocated. */ static struct format_arg_list * -add_type_constraint (list, n, type) - struct format_arg_list *list; - unsigned int n; - enum format_arg_type type; +add_type_constraint (struct format_arg_list *list, unsigned int n, + enum format_arg_type type) { unsigned int s; struct format_arg newconstraint; @@ -2132,11 +1991,9 @@ add_type_constraint (list, n, type) contradiction. Assumes a preceding add_required_constraint (list, n). */ /* Memory effects: list is freed. The result is freshly allocated. */ static struct format_arg_list * -add_listtype_constraint (list, n, type, sublist) - struct format_arg_list *list; - unsigned int n; - enum format_arg_type type; - struct format_arg_list *sublist; +add_listtype_constraint (struct format_arg_list *list, unsigned int n, + enum format_arg_type type, + struct format_arg_list *sublist) { unsigned int s; struct format_arg newconstraint; @@ -2169,10 +2026,8 @@ add_listtype_constraint (list, n, type, sublist) /* ============= Subroutines used by the format string parser ============= */ static void -add_req_type_constraint (listp, position, type) - struct format_arg_list **listp; - unsigned int position; - enum format_arg_type type; +add_req_type_constraint (struct format_arg_list **listp, + unsigned int position, enum format_arg_type type) { *listp = add_required_constraint (*listp, position); *listp = add_type_constraint (*listp, position, type); @@ -2180,11 +2035,9 @@ add_req_type_constraint (listp, position, type) static void -add_req_listtype_constraint (listp, position, type, sublist) - struct format_arg_list **listp; - unsigned int position; - enum format_arg_type type; - struct format_arg_list *sublist; +add_req_listtype_constraint (struct format_arg_list **listp, + unsigned int position, enum format_arg_type type, + struct format_arg_list *sublist) { *listp = add_required_constraint (*listp, position); *listp = add_listtype_constraint (*listp, position, type, sublist); @@ -2195,8 +2048,7 @@ add_req_listtype_constraint (listp, position, type, sublist) by sublist. */ /* Memory effects: sublist is freed. The result is freshly allocated. */ static struct format_arg_list * -make_repeated_list_of_lists (sublist) - struct format_arg_list *sublist; +make_repeated_list_of_lists (struct format_arg_list *sublist) { if (sublist == NULL) /* The list cannot have a single element. */ @@ -2240,9 +2092,7 @@ make_repeated_list_of_lists (sublist) */ /* Memory effects: sublist is freed. The result is freshly allocated. */ static struct format_arg_list * -make_repeated_list (sublist, period) - struct format_arg_list *sublist; - unsigned int period; +make_repeated_list (struct format_arg_list *sublist, unsigned int period) { struct segment tmp; struct segment *srcseg; @@ -2475,12 +2325,9 @@ static const enum format_arg_type THREE [3] = { /* Check the parameters. For V params, add the constraint to the argument list. Return false if the format string is invalid. */ static bool -check_params (listp, paramcount, params, t_count, t_types) - struct format_arg_list **listp; - unsigned int paramcount; - struct param *params; - unsigned int t_count; - const enum format_arg_type *t_types; +check_params (struct format_arg_list **listp, + unsigned int paramcount, struct param *params, + unsigned int t_count, const enum format_arg_type *t_types) { for (; paramcount > 0 && t_count > 0; params++, paramcount--, t_types++, t_count--) @@ -2548,10 +2395,8 @@ check_params (listp, paramcount, params, t_count, t_types) For V params, add the constraint to the argument list. Return false if the format string is invalid. */ static bool -nocheck_params (listp, paramcount, params) - struct format_arg_list **listp; - unsigned int paramcount; - struct param *params; +nocheck_params (struct format_arg_list **listp, + unsigned int paramcount, struct param *params) { for (; paramcount > 0; params++, paramcount--) if (params->type == PT_V) @@ -2583,16 +2428,10 @@ nocheck_params (listp, paramcount, params) separator specifies if ~; separators are allowed. If the format string is invalid, false is returned. */ static bool -parse_upto (formatp, positionp, listp, escapep, - separatorp, spec, terminator, separator) - const char **formatp; - int *positionp; - struct format_arg_list **listp; - struct format_arg_list **escapep; - int *separatorp; - struct spec *spec; - char terminator; - bool separator; +parse_upto (const char **formatp, + int *positionp, struct format_arg_list **listp, + struct format_arg_list **escapep, int *separatorp, + struct spec *spec, char terminator, bool separator) { const char *format = *formatp; int position = *positionp; @@ -3307,8 +3146,7 @@ parse_upto (formatp, positionp, listp, escapep, /* ============== Top level format string handling functions ============== */ static void * -format_parse (format) - const char *format; +format_parse (const char *format) { struct spec spec; struct spec *result; @@ -3340,8 +3178,7 @@ format_parse (format) } static void -format_free (descr) - void *descr; +format_free (void *descr) { struct spec *spec = (struct spec *) descr; @@ -3349,8 +3186,7 @@ format_free (descr) } static int -format_get_number_of_directives (descr) - void *descr; +format_get_number_of_directives (void *descr) { struct spec *spec = (struct spec *) descr; @@ -3358,13 +3194,8 @@ format_get_number_of_directives (descr) } static bool -format_check (pos, msgid_descr, msgstr_descr, equality, noisy, pretty_msgstr) - const lex_pos_ty *pos; - void *msgid_descr; - void *msgstr_descr; - bool equality; - bool noisy; - const char *pretty_msgstr; +format_check (const lex_pos_ty *pos, void *msgid_descr, void *msgstr_descr, + bool equality, bool noisy, const char *pretty_msgstr) { struct spec *spec1 = (struct spec *) msgid_descr; struct spec *spec2 = (struct spec *) msgstr_descr; @@ -3430,11 +3261,10 @@ struct formatstring_parser formatstring_lisp = #include #include "getline.h" -static void print_list PARAMS ((struct format_arg_list *list)); +static void print_list (struct format_arg_list *list); static void -print_element (element) - struct format_arg *element; +print_element (struct format_arg *element) { switch (element->presence) { @@ -3485,8 +3315,7 @@ print_element (element) } static void -print_list (list) - struct format_arg_list *list; +print_list (struct format_arg_list *list) { unsigned int i, j; @@ -3515,8 +3344,7 @@ print_list (list) } static void -format_print (descr) - void *descr; +format_print (void *descr) { struct spec *spec = (struct spec *) descr; diff --git a/src/format-pascal.c b/src/format-pascal.c index 12a33d198..cf2d959a3 100644 --- a/src/format-pascal.c +++ b/src/format-pascal.c @@ -93,22 +93,8 @@ struct spec #define isdigit(c) ((unsigned int) ((c) - '0') < 10) -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static int numbered_arg_compare PARAMS ((const void *p1, const void *p2)); -static void *format_parse PARAMS ((const char *format)); -static void format_free PARAMS ((void *descr)); -static int format_get_number_of_directives PARAMS ((void *descr)); -static bool format_check PARAMS ((const lex_pos_ty *pos, - void *msgid_descr, void *msgstr_descr, - bool equality, - bool noisy, const char *pretty_msgstr)); - - static int -numbered_arg_compare (p1, p2) - const void *p1; - const void *p2; +numbered_arg_compare (const void *p1, const void *p2) { unsigned int n1 = ((const struct numbered_arg *) p1)->number; unsigned int n2 = ((const struct numbered_arg *) p2)->number; @@ -117,8 +103,7 @@ numbered_arg_compare (p1, p2) } static void * -format_parse (format) - const char *format; +format_parse (const char *format) { unsigned int directives; unsigned int numbered_arg_count; @@ -346,8 +331,7 @@ format_parse (format) } static void -format_free (descr) - void *descr; +format_free (void *descr) { struct spec *spec = (struct spec *) descr; @@ -357,8 +341,7 @@ format_free (descr) } static int -format_get_number_of_directives (descr) - void *descr; +format_get_number_of_directives (void *descr) { struct spec *spec = (struct spec *) descr; @@ -366,13 +349,8 @@ format_get_number_of_directives (descr) } static bool -format_check (pos, msgid_descr, msgstr_descr, equality, noisy, pretty_msgstr) - const lex_pos_ty *pos; - void *msgid_descr; - void *msgstr_descr; - bool equality; - bool noisy; - const char *pretty_msgstr; +format_check (const lex_pos_ty *pos, void *msgid_descr, void *msgstr_descr, + bool equality, bool noisy, const char *pretty_msgstr) { struct spec *spec1 = (struct spec *) msgid_descr; struct spec *spec2 = (struct spec *) msgstr_descr; @@ -477,8 +455,7 @@ struct formatstring_parser formatstring_pascal = #include "getline.h" static void -format_print (descr) - void *descr; +format_print (void *descr) { struct spec *spec = (struct spec *) descr; unsigned int last; diff --git a/src/format-php.c b/src/format-php.c index 9ca6ef0c8..d91803b1e 100644 --- a/src/format-php.c +++ b/src/format-php.c @@ -83,22 +83,8 @@ struct spec #define isdigit(c) ((unsigned int) ((c) - '0') < 10) -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static int numbered_arg_compare PARAMS ((const void *p1, const void *p2)); -static void *format_parse PARAMS ((const char *format)); -static void format_free PARAMS ((void *descr)); -static int format_get_number_of_directives PARAMS ((void *descr)); -static bool format_check PARAMS ((const lex_pos_ty *pos, - void *msgid_descr, void *msgstr_descr, - bool equality, - bool noisy, const char *pretty_msgstr)); - - static int -numbered_arg_compare (p1, p2) - const void *p1; - const void *p2; +numbered_arg_compare (const void *p1, const void *p2) { unsigned int n1 = ((const struct numbered_arg *) p1)->number; unsigned int n2 = ((const struct numbered_arg *) p2)->number; @@ -107,8 +93,7 @@ numbered_arg_compare (p1, p2) } static void * -format_parse (format) - const char *format; +format_parse (const char *format) { unsigned int directives; unsigned int numbered_arg_count; @@ -286,8 +271,7 @@ format_parse (format) } static void -format_free (descr) - void *descr; +format_free (void *descr) { struct spec *spec = (struct spec *) descr; @@ -297,8 +281,7 @@ format_free (descr) } static int -format_get_number_of_directives (descr) - void *descr; +format_get_number_of_directives (void *descr) { struct spec *spec = (struct spec *) descr; @@ -306,13 +289,8 @@ format_get_number_of_directives (descr) } static bool -format_check (pos, msgid_descr, msgstr_descr, equality, noisy, pretty_msgstr) - const lex_pos_ty *pos; - void *msgid_descr; - void *msgstr_descr; - bool equality; - bool noisy; - const char *pretty_msgstr; +format_check (const lex_pos_ty *pos, void *msgid_descr, void *msgstr_descr, + bool equality, bool noisy, const char *pretty_msgstr) { struct spec *spec1 = (struct spec *) msgid_descr; struct spec *spec2 = (struct spec *) msgstr_descr; @@ -417,8 +395,7 @@ struct formatstring_parser formatstring_php = #include "getline.h" static void -format_print (descr) - void *descr; +format_print (void *descr) { struct spec *spec = (struct spec *) descr; unsigned int last; diff --git a/src/format-python.c b/src/format-python.c index b59bddf04..1116a7021 100644 --- a/src/format-python.c +++ b/src/format-python.c @@ -1,5 +1,5 @@ /* Python format strings. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -101,30 +101,15 @@ struct spec #define isdigit(c) ((unsigned int) ((c) - '0') < 10) -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static int named_arg_compare PARAMS ((const void *p1, const void *p2)); -static void *format_parse PARAMS ((const char *format)); -static void format_free PARAMS ((void *descr)); -static int format_get_number_of_directives PARAMS ((void *descr)); -static bool format_check PARAMS ((const lex_pos_ty *pos, - void *msgid_descr, void *msgstr_descr, - bool equality, - bool noisy, const char *pretty_msgstr)); - - static int -named_arg_compare (p1, p2) - const void *p1; - const void *p2; +named_arg_compare (const void *p1, const void *p2) { return strcmp (((const struct named_arg *) p1)->name, ((const struct named_arg *) p2)->name); } static void * -format_parse (format) - const char *format; +format_parse (const char *format) { struct spec spec; struct spec *result; @@ -349,8 +334,7 @@ format_parse (format) } static void -format_free (descr) - void *descr; +format_free (void *descr) { struct spec *spec = (struct spec *) descr; @@ -367,8 +351,7 @@ format_free (descr) } static int -format_get_number_of_directives (descr) - void *descr; +format_get_number_of_directives (void *descr) { struct spec *spec = (struct spec *) descr; @@ -376,13 +359,8 @@ format_get_number_of_directives (descr) } static bool -format_check (pos, msgid_descr, msgstr_descr, equality, noisy, pretty_msgstr) - const lex_pos_ty *pos; - void *msgid_descr; - void *msgstr_descr; - bool equality; - bool noisy; - const char *pretty_msgstr; +format_check (const lex_pos_ty *pos, void *msgid_descr, void *msgstr_descr, + bool equality, bool noisy, const char *pretty_msgstr) { struct spec *spec1 = (struct spec *) msgid_descr; struct spec *spec2 = (struct spec *) msgstr_descr; @@ -548,8 +526,7 @@ struct formatstring_parser formatstring_python = #include "getline.h" static void -format_print (descr) - void *descr; +format_print (void *descr) { struct spec *spec = (struct spec *) descr; unsigned int i; diff --git a/src/format-tcl.c b/src/format-tcl.c index d765308de..e74126d14 100644 --- a/src/format-tcl.c +++ b/src/format-tcl.c @@ -87,22 +87,8 @@ struct spec #define isdigit(c) ((unsigned int) ((c) - '0') < 10) -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static int numbered_arg_compare PARAMS ((const void *p1, const void *p2)); -static void *format_parse PARAMS ((const char *format)); -static void format_free PARAMS ((void *descr)); -static int format_get_number_of_directives PARAMS ((void *descr)); -static bool format_check PARAMS ((const lex_pos_ty *pos, - void *msgid_descr, void *msgstr_descr, - bool equality, - bool noisy, const char *pretty_msgstr)); - - static int -numbered_arg_compare (p1, p2) - const void *p1; - const void *p2; +numbered_arg_compare (const void *p1, const void *p2) { unsigned int n1 = ((const struct numbered_arg *) p1)->number; unsigned int n2 = ((const struct numbered_arg *) p2)->number; @@ -111,8 +97,7 @@ numbered_arg_compare (p1, p2) } static void * -format_parse (format) - const char *format; +format_parse (const char *format) { struct spec spec; struct spec *result; @@ -322,8 +307,7 @@ format_parse (format) } static void -format_free (descr) - void *descr; +format_free (void *descr) { struct spec *spec = (struct spec *) descr; @@ -333,8 +317,7 @@ format_free (descr) } static int -format_get_number_of_directives (descr) - void *descr; +format_get_number_of_directives (void *descr) { struct spec *spec = (struct spec *) descr; @@ -342,13 +325,8 @@ format_get_number_of_directives (descr) } static bool -format_check (pos, msgid_descr, msgstr_descr, equality, noisy, pretty_msgstr) - const lex_pos_ty *pos; - void *msgid_descr; - void *msgstr_descr; - bool equality; - bool noisy; - const char *pretty_msgstr; +format_check (const lex_pos_ty *pos, void *msgid_descr, void *msgstr_descr, + bool equality, bool noisy, const char *pretty_msgstr) { struct spec *spec1 = (struct spec *) msgid_descr; struct spec *spec2 = (struct spec *) msgstr_descr; @@ -453,8 +431,7 @@ struct formatstring_parser formatstring_tcl = #include "getline.h" static void -format_print (descr) - void *descr; +format_print (void *descr) { struct spec *spec = (struct spec *) descr; unsigned int last; diff --git a/src/format-ycp.c b/src/format-ycp.c index 4010fdb88..fd41610b0 100644 --- a/src/format-ycp.c +++ b/src/format-ycp.c @@ -1,5 +1,5 @@ /* YCP and Smalltalk format strings. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -46,20 +46,8 @@ struct spec }; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static void *format_parse PARAMS ((const char *format)); -static void format_free PARAMS ((void *descr)); -static int format_get_number_of_directives PARAMS ((void *descr)); -static bool format_check PARAMS ((const lex_pos_ty *pos, - void *msgid_descr, void *msgstr_descr, - bool equality, - bool noisy, const char *pretty_msgstr)); - - static void * -format_parse (format) - const char *format; +format_parse (const char *format) { struct spec spec; struct spec *result; @@ -98,8 +86,7 @@ format_parse (format) } static void -format_free (descr) - void *descr; +format_free (void *descr) { struct spec *spec = (struct spec *) descr; @@ -107,8 +94,7 @@ format_free (descr) } static int -format_get_number_of_directives (descr) - void *descr; +format_get_number_of_directives (void *descr) { struct spec *spec = (struct spec *) descr; @@ -116,13 +102,8 @@ format_get_number_of_directives (descr) } static bool -format_check (pos, msgid_descr, msgstr_descr, equality, noisy, pretty_msgstr) - const lex_pos_ty *pos; - void *msgid_descr; - void *msgstr_descr; - bool equality; - bool noisy; - const char *pretty_msgstr; +format_check (const lex_pos_ty *pos, void *msgid_descr, void *msgstr_descr, + bool equality, bool noisy, const char *pretty_msgstr) { struct spec *spec1 = (struct spec *) msgid_descr; struct spec *spec2 = (struct spec *) msgstr_descr; @@ -182,8 +163,7 @@ struct formatstring_parser formatstring_smalltalk = #include "getline.h" static void -format_print (descr) - void *descr; +format_print (void *descr) { struct spec *spec = (struct spec *) descr; unsigned int i; diff --git a/src/format.h b/src/format.h index 682744a53..9d2105b08 100644 --- a/src/format.h +++ b/src/format.h @@ -32,14 +32,14 @@ struct formatstring_parser 1. the argument types/names needed for the format string, 2. the total number of format directives. Return NULL if the string is not a valid format string. */ - void * (*parse) PARAMS ((const char *string)); + void * (*parse) (const char *string); /* Free a format string descriptor, returned by parse(). */ - void (*free) PARAMS ((void *descr)); + void (*free) (void *descr); /* Return the number of format directives. A string that can be output literally has 0 format directives. */ - int (*get_number_of_directives) PARAMS ((void *descr)); + int (*get_number_of_directives) (void *descr); /* Verify that the argument types/names in msgid_descr and those in msgstr_descr are the same (if equality=true), or (if equality=false) @@ -50,7 +50,7 @@ struct formatstring_parser error_at_line (0, 0, pos->file_name, pos->line_number, ...); error_with_progname = true; (but only if noisy=true) and return true. Otherwise return false. */ - bool (*check) PARAMS ((const lex_pos_ty *pos, void *msgid_descr, void *msgstr_descr, bool equality, bool noisy, const char *pretty_msgstr)); + bool (*check) (const lex_pos_ty *pos, void *msgid_descr, void *msgstr_descr, bool equality, bool noisy, const char *pretty_msgstr); }; /* Format string parsers, each defined in its own file. */ @@ -79,6 +79,6 @@ struct interval size_t startpos; size_t endpos; }; -extern void get_c99_format_directives PARAMS ((const char *string, struct interval **intervalsp, size_t *lengthp)); +extern void get_c99_format_directives (const char *string, struct interval **intervalsp, size_t *lengthp); #endif /* _FORMAT_H */ diff --git a/src/gettext.c b/src/gettext.c index a9590153d..78ea862b4 100644 --- a/src/gettext.c +++ b/src/gettext.c @@ -55,19 +55,16 @@ static const struct option long_options[] = { NULL, 0, NULL, 0 } }; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static void usage PARAMS ((int status)) +/* Forward declaration of local functions. */ +static void usage (int status) #if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2) __attribute__ ((noreturn)) #endif ; -static const char *expand_escape PARAMS ((const char *str)); +static const char *expand_escape (const char *str); int -main (argc, argv) - int argc; - char *argv[]; +main (int argc, char *argv[]) { int optchar; const char *msgid; @@ -233,8 +230,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ /* Display usage information and exit. */ static void -usage (status) - int status; +usage (int status) { if (status != EXIT_SUCCESS) fprintf (stderr, _("Try `%s --help' for more information.\n"), @@ -283,8 +279,7 @@ Standard search directory: %s\n"), /* Expand some escape sequences found in the argument string. */ static const char * -expand_escape (str) - const char *str; +expand_escape (const char *str) { char *retval, *rp; const char *cp = str; diff --git a/src/hostname.c b/src/hostname.c index 5380999e4..0bcbe413c 100644 --- a/src/hostname.c +++ b/src/hostname.c @@ -103,20 +103,16 @@ static const struct option long_options[] = }; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static void usage PARAMS ((int status)) +/* Forward declaration of local functions. */ +static void usage (int status) #if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2) __attribute__ ((noreturn)) #endif ; -static char * xgethostname PARAMS ((void)); -static void print_hostname PARAMS ((void)); +static void print_hostname (void); int -main (argc, argv) - int argc; - char *argv[]; +main (int argc, char *argv[]) { int optchar; bool do_help; @@ -197,8 +193,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ /* Display usage information and exit. */ static void -usage (status) - int status; +usage (int status) { if (status != EXIT_SUCCESS) fprintf (stderr, _("Try `%s --help' for more information.\n"), diff --git a/src/message.c b/src/message.c index 59d975b63..d49d0ca35 100644 --- a/src/message.c +++ b/src/message.c @@ -32,12 +32,6 @@ #include "xmalloc.h" -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static message_ty *message_list_search_fuzzy_inner PARAMS (( - message_list_ty *mlp, const char *msgid, double *best_weight_p)); - - const char *const format_language[NFORMATS] = { /* format_c */ "c", @@ -72,20 +66,16 @@ const char *const format_language_pretty[NFORMATS] = bool -possible_format_p (is_format) - enum is_format is_format; +possible_format_p (enum is_format is_format) { return is_format == possible || is_format == yes; } message_ty * -message_alloc (msgid, msgid_plural, msgstr, msgstr_len, pp) - const char *msgid; - const char *msgid_plural; - const char *msgstr; - size_t msgstr_len; - const lex_pos_ty *pp; +message_alloc (const char *msgid, const char *msgid_plural, + const char *msgstr, size_t msgstr_len, + const lex_pos_ty *pp) { message_ty *mp; size_t i; @@ -111,8 +101,7 @@ message_alloc (msgid, msgid_plural, msgstr, msgstr_len, pp) void -message_free (mp) - message_ty *mp; +message_free (message_ty *mp) { size_t j; @@ -133,9 +122,7 @@ message_free (mp) void -message_comment_append (mp, s) - message_ty *mp; - const char *s; +message_comment_append (message_ty *mp, const char *s) { if (mp->comment == NULL) mp->comment = string_list_alloc (); @@ -144,9 +131,7 @@ message_comment_append (mp, s) void -message_comment_dot_append (mp, s) - message_ty *mp; - const char *s; +message_comment_dot_append (message_ty *mp, const char *s) { if (mp->comment_dot == NULL) mp->comment_dot = string_list_alloc (); @@ -155,10 +140,7 @@ message_comment_dot_append (mp, s) void -message_comment_filepos (mp, name, line) - message_ty *mp; - const char *name; - size_t line; +message_comment_filepos (message_ty *mp, const char *name, size_t line) { size_t j; size_t nbytes; @@ -184,8 +166,7 @@ message_comment_filepos (mp, name, line) message_ty * -message_copy (mp) - message_ty *mp; +message_copy (message_ty *mp) { message_ty *result; size_t j, i; @@ -217,8 +198,7 @@ message_copy (mp) message_list_ty * -message_list_alloc (use_hashtable) - bool use_hashtable; +message_list_alloc (bool use_hashtable) { message_list_ty *mlp; @@ -233,8 +213,7 @@ message_list_alloc (use_hashtable) void -message_list_free (mlp) - message_list_ty *mlp; +message_list_free (message_list_ty *mlp) { size_t j; @@ -249,9 +228,7 @@ message_list_free (mlp) void -message_list_append (mlp, mp) - message_list_ty *mlp; - message_ty *mp; +message_list_append (message_list_ty *mlp, message_ty *mp) { if (mlp->nitems >= mlp->nitems_max) { @@ -272,9 +249,7 @@ message_list_append (mlp, mp) void -message_list_prepend (mlp, mp) - message_list_ty *mlp; - message_ty *mp; +message_list_prepend (message_list_ty *mlp, message_ty *mp) { size_t j; @@ -301,9 +276,7 @@ message_list_prepend (mlp, mp) #if 0 /* unused */ void -message_list_delete_nth (mlp, n) - message_list_ty *mlp; - size_t n; +message_list_delete_nth (message_list_ty *mlp, size_t n) { size_t j; @@ -325,9 +298,8 @@ message_list_delete_nth (mlp, n) void -message_list_remove_if_not (mlp, predicate) - message_list_ty *mlp; - message_predicate_ty *predicate; +message_list_remove_if_not (message_list_ty *mlp, + message_predicate_ty *predicate) { size_t i, j; @@ -345,9 +317,7 @@ message_list_remove_if_not (mlp, predicate) message_ty * -message_list_search (mlp, msgid) - message_list_ty *mlp; - const char *msgid; +message_list_search (message_list_ty *mlp, const char *msgid) { if (mlp->use_hashtable) { @@ -376,10 +346,8 @@ message_list_search (mlp, msgid) static message_ty * -message_list_search_fuzzy_inner (mlp, msgid, best_weight_p) - message_list_ty *mlp; - const char *msgid; - double *best_weight_p; +message_list_search_fuzzy_inner (message_list_ty *mlp, const char *msgid, + double *best_weight_p) { size_t j; message_ty *best_mp; @@ -406,9 +374,7 @@ message_list_search_fuzzy_inner (mlp, msgid, best_weight_p) message_ty * -message_list_search_fuzzy (mlp, msgid) - message_list_ty *mlp; - const char *msgid; +message_list_search_fuzzy (message_list_ty *mlp, const char *msgid) { double best_weight; @@ -432,8 +398,7 @@ message_list_list_alloc () #if 0 /* unused */ void -message_list_list_free (mllp) - message_list_list_ty *mllp; +message_list_list_free (message_list_list_ty *mllp) { size_t j; @@ -447,9 +412,7 @@ message_list_list_free (mllp) void -message_list_list_append (mllp, mlp) - message_list_list_ty *mllp; - message_list_ty *mlp; +message_list_list_append (message_list_list_ty *mllp, message_list_ty *mlp) { if (mllp->nitems >= mllp->nitems_max) { @@ -464,9 +427,8 @@ message_list_list_append (mllp, mlp) void -message_list_list_append_list (mllp, mllp2) - message_list_list_ty *mllp; - message_list_list_ty *mllp2; +message_list_list_append_list (message_list_list_ty *mllp, + message_list_list_ty *mllp2) { size_t j; @@ -476,9 +438,7 @@ message_list_list_append_list (mllp, mllp2) message_ty * -message_list_list_search (mllp, msgid) - message_list_list_ty *mllp; - const char *msgid; +message_list_list_search (message_list_list_ty *mllp, const char *msgid) { message_ty *best_mp; int best_weight; /* 0: not found, 1: found without msgstr, 2: translated */ @@ -508,9 +468,7 @@ message_list_list_search (mllp, msgid) message_ty * -message_list_list_search_fuzzy (mllp, msgid) - message_list_list_ty *mllp; - const char *msgid; +message_list_list_search_fuzzy (message_list_list_ty *mllp, const char *msgid) { size_t j; double best_weight; @@ -533,9 +491,7 @@ message_list_list_search_fuzzy (mllp, msgid) msgdomain_ty* -msgdomain_alloc (domain, use_hashtable) - const char *domain; - bool use_hashtable; +msgdomain_alloc (const char *domain, bool use_hashtable) { msgdomain_ty *mdp; @@ -547,8 +503,7 @@ msgdomain_alloc (domain, use_hashtable) void -msgdomain_free (mdp) - msgdomain_ty *mdp; +msgdomain_free (msgdomain_ty *mdp) { message_list_free (mdp->messages); free (mdp); @@ -556,8 +511,7 @@ msgdomain_free (mdp) msgdomain_list_ty * -msgdomain_list_alloc (use_hashtable) - bool use_hashtable; +msgdomain_list_alloc (bool use_hashtable) { msgdomain_list_ty *mdlp; @@ -576,8 +530,7 @@ msgdomain_list_alloc (use_hashtable) #if 0 /* unused */ void -msgdomain_list_free (mdlp) - msgdomain_list_ty *mdlp; +msgdomain_list_free (msgdomain_list_ty *mdlp) { size_t j; @@ -591,9 +544,7 @@ msgdomain_list_free (mdlp) void -msgdomain_list_append (mdlp, mdp) - msgdomain_list_ty *mdlp; - msgdomain_ty *mdp; +msgdomain_list_append (msgdomain_list_ty *mdlp, msgdomain_ty *mdp) { if (mdlp->nitems >= mdlp->nitems_max) { @@ -609,9 +560,7 @@ msgdomain_list_append (mdlp, mdp) #if 0 /* unused */ void -msgdomain_list_append_list (mdlp, mdlp2) - msgdomain_list_ty *mdlp; - msgdomain_list_ty *mdlp2; +msgdomain_list_append_list (msgdomain_list_ty *mdlp, msgdomain_list_ty *mdlp2) { size_t j; @@ -622,10 +571,8 @@ msgdomain_list_append_list (mdlp, mdlp2) message_list_ty * -msgdomain_list_sublist (mdlp, domain, create) - msgdomain_list_ty *mdlp; - const char *domain; - bool create; +msgdomain_list_sublist (msgdomain_list_ty *mdlp, const char *domain, + bool create) { size_t j; @@ -646,9 +593,7 @@ msgdomain_list_sublist (mdlp, domain, create) #if 0 /* unused */ message_ty * -msgdomain_list_search (mdlp, msgid) - msgdomain_list_ty *mdlp; - const char *msgid; +msgdomain_list_search (msgdomain_list_ty *mdlp, const char *msgid) { size_t j; @@ -669,9 +614,7 @@ msgdomain_list_search (mdlp, msgid) #if 0 /* unused */ message_ty * -msgdomain_list_search_fuzzy (mdlp, msgid) - msgdomain_list_ty *mdlp; - const char *msgid; +msgdomain_list_search_fuzzy (msgdomain_list_ty *mdlp, const char *msgid) { size_t j; double best_weight; diff --git a/src/message.h b/src/message.h index ffec3ee08..fe506d789 100644 --- a/src/message.h +++ b/src/message.h @@ -62,7 +62,7 @@ enum is_format }; extern bool - possible_format_p PARAMS ((enum is_format)); + possible_format_p (enum is_format); /* Is current msgid wrappable? */ @@ -140,21 +140,19 @@ struct message_ty }; extern message_ty * - message_alloc PARAMS ((const char *msgid, const char *msgid_plural, - const char *msgstr, size_t msgstr_len, - const lex_pos_ty *pp)); + message_alloc (const char *msgid, const char *msgid_plural, + const char *msgstr, size_t msgstr_len, + const lex_pos_ty *pp); extern void - message_free PARAMS ((message_ty *mp)); + message_free (message_ty *mp); extern void - message_comment_append PARAMS ((message_ty *mp, const char *comment)); + message_comment_append (message_ty *mp, const char *comment); extern void - message_comment_dot_append PARAMS ((message_ty *mp, - const char *comment)); + message_comment_dot_append (message_ty *mp, const char *comment); extern void - message_comment_filepos PARAMS ((message_ty *mp, - const char *name, size_t line)); + message_comment_filepos (message_ty *mp, const char *name, size_t line); extern message_ty * - message_copy PARAMS ((message_ty *mp)); + message_copy (message_ty *mp); typedef struct message_list_ty message_list_ty; @@ -172,24 +170,23 @@ struct message_list_ty message_list_search(). USE_HASHTABLE can only be set to true if it is known that the message list will not contain duplicate msgids. */ extern message_list_ty * - message_list_alloc PARAMS ((bool use_hashtable)); + message_list_alloc (bool use_hashtable); extern void - message_list_free PARAMS ((message_list_ty *mlp)); + message_list_free (message_list_ty *mlp); extern void - message_list_append PARAMS ((message_list_ty *mlp, message_ty *mp)); + message_list_append (message_list_ty *mlp, message_ty *mp); extern void - message_list_prepend PARAMS ((message_list_ty *mlp, message_ty *mp)); + message_list_prepend (message_list_ty *mlp, message_ty *mp); extern void - message_list_delete_nth PARAMS ((message_list_ty *mlp, size_t n)); -typedef bool message_predicate_ty PARAMS ((const message_ty *mp)); + message_list_delete_nth (message_list_ty *mlp, size_t n); +typedef bool message_predicate_ty (const message_ty *mp); extern void - message_list_remove_if_not PARAMS ((message_list_ty *mlp, - message_predicate_ty *predicate)); + message_list_remove_if_not (message_list_ty *mlp, + message_predicate_ty *predicate); extern message_ty * - message_list_search PARAMS ((message_list_ty *mlp, const char *msgid)); + message_list_search (message_list_ty *mlp, const char *msgid); extern message_ty * - message_list_search_fuzzy PARAMS ((message_list_ty *mlp, - const char *msgid)); + message_list_search_fuzzy (message_list_ty *mlp, const char *msgid); typedef struct message_list_list_ty message_list_list_ty; @@ -201,21 +198,21 @@ struct message_list_list_ty }; extern message_list_list_ty * - message_list_list_alloc PARAMS ((void)); + message_list_list_alloc (void); extern void - message_list_list_free PARAMS ((message_list_list_ty *mllp)); + message_list_list_free (message_list_list_ty *mllp); extern void - message_list_list_append PARAMS ((message_list_list_ty *mllp, - message_list_ty *mlp)); + message_list_list_append (message_list_list_ty *mllp, + message_list_ty *mlp); extern void - message_list_list_append_list PARAMS ((message_list_list_ty *mllp, - message_list_list_ty *mllp2)); + message_list_list_append_list (message_list_list_ty *mllp, + message_list_list_ty *mllp2); extern message_ty * - message_list_list_search PARAMS ((message_list_list_ty *mllp, - const char *msgid)); + message_list_list_search (message_list_list_ty *mllp, + const char *msgid); extern message_ty * - message_list_list_search_fuzzy PARAMS ((message_list_list_ty *mllp, - const char *msgid)); + message_list_list_search_fuzzy (message_list_list_ty *mllp, + const char *msgid); typedef struct msgdomain_ty msgdomain_ty; @@ -226,9 +223,9 @@ struct msgdomain_ty }; extern msgdomain_ty * - msgdomain_alloc PARAMS ((const char *domain, bool use_hashtable)); + msgdomain_alloc (const char *domain, bool use_hashtable); extern void - msgdomain_free PARAMS ((msgdomain_ty *mdp)); + msgdomain_free (msgdomain_ty *mdp); typedef struct msgdomain_list_ty msgdomain_list_ty; @@ -241,24 +238,21 @@ struct msgdomain_list_ty }; extern msgdomain_list_ty * - msgdomain_list_alloc PARAMS ((bool use_hashtable)); + msgdomain_list_alloc (bool use_hashtable); extern void - msgdomain_list_free PARAMS ((msgdomain_list_ty *mdlp)); + msgdomain_list_free (msgdomain_list_ty *mdlp); extern void - msgdomain_list_append PARAMS ((msgdomain_list_ty *mdlp, - msgdomain_ty *mdp)); + msgdomain_list_append (msgdomain_list_ty *mdlp, msgdomain_ty *mdp); extern void - msgdomain_list_append_list PARAMS ((msgdomain_list_ty *mdlp, - msgdomain_list_ty *mdlp2)); + msgdomain_list_append_list (msgdomain_list_ty *mdlp, + msgdomain_list_ty *mdlp2); extern message_list_ty * - msgdomain_list_sublist PARAMS ((msgdomain_list_ty *mdlp, - const char *domain, bool create)); + msgdomain_list_sublist (msgdomain_list_ty *mdlp, const char *domain, + bool create); extern message_ty * - msgdomain_list_search PARAMS ((msgdomain_list_ty *mdlp, - const char *msgid)); + msgdomain_list_search (msgdomain_list_ty *mdlp, const char *msgid); extern message_ty * - msgdomain_list_search_fuzzy PARAMS ((msgdomain_list_ty *mdlp, - const char *msgid)); + msgdomain_list_search_fuzzy (msgdomain_list_ty *mdlp, const char *msgid); #endif /* message.h */ diff --git a/src/msgattrib.c b/src/msgattrib.c index 05622a328..37b59c011 100644 --- a/src/msgattrib.c +++ b/src/msgattrib.c @@ -99,19 +99,17 @@ static const struct option long_options[] = }; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static void usage PARAMS ((int status)); -static bool is_message_selected PARAMS ((const message_ty *mp)); -static void process_message_list PARAMS ((message_list_ty *mlp)); -static msgdomain_list_ty * - process_msgdomain_list PARAMS ((msgdomain_list_ty *mdlp)); +/* Forward declaration of local functions. */ +static void usage (int status) +#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2) + __attribute__ ((noreturn)) +#endif +; +static msgdomain_list_ty *process_msgdomain_list (msgdomain_list_ty *mdlp); int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { int optchar; bool do_help; @@ -320,8 +318,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ /* Display usage information and exit. */ static void -usage (status) - int status; +usage (int status) { if (status != EXIT_SUCCESS) fprintf (stderr, _("Try `%s --help' for more information.\n"), @@ -416,8 +413,7 @@ Informative output:\n\ /* Return true if a message should be kept. */ static bool -is_message_selected (mp) - const message_ty *mp; +is_message_selected (const message_ty *mp) { /* Always keep the header entry. */ if (mp->msgid[0] == '\0') @@ -446,8 +442,7 @@ is_message_selected (mp) static void -process_message_list (mlp) - message_list_ty *mlp; +process_message_list (message_list_ty *mlp) { /* Keep only the selected messages. */ message_list_remove_if_not (mlp, is_message_selected); @@ -476,8 +471,7 @@ process_message_list (mlp) static msgdomain_list_ty * -process_msgdomain_list (mdlp) - msgdomain_list_ty *mdlp; +process_msgdomain_list (msgdomain_list_ty *mdlp) { size_t k; diff --git a/src/msgcat.c b/src/msgcat.c index 35b94e0aa..2ad5fa6fe 100644 --- a/src/msgcat.c +++ b/src/msgcat.c @@ -77,15 +77,16 @@ static const struct option long_options[] = }; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static void usage PARAMS ((int status)); +/* Forward declaration of local functions. */ +static void usage (int status) +#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2) + __attribute__ ((noreturn)) +#endif +; int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { int cnt; int optchar; @@ -288,8 +289,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ /* Display usage information and exit. */ static void -usage (status) - int status; +usage (int status) { if (status != EXIT_SUCCESS) fprintf (stderr, _("Try `%s --help' for more information.\n"), diff --git a/src/msgcmp.c b/src/msgcmp.c index 0919f5283..8505e6e8b 100644 --- a/src/msgcmp.c +++ b/src/msgcmp.c @@ -57,21 +57,17 @@ static const struct option long_options[] = }; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static void usage PARAMS ((int status)); -static bool is_message_selected PARAMS ((const message_ty *mp)); -static msgdomain_list_ty * remove_obsoletes PARAMS ((msgdomain_list_ty *mdlp)); -static void match_domain PARAMS ((const char *fn1, const char *fn2, - message_list_ty *defmlp, - message_list_ty *refmlp, int *nerrors)); -static void compare PARAMS ((const char *, const char *)); +/* Forward declaration of local functions. */ +static void usage (int status) +#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2) + __attribute__ ((noreturn)) +#endif +; +static void compare (const char *fn1, const char *fn2); int -main (argc, argv) - int argc; - char *argv[]; +main (int argc, char *argv[]) { int optchar; bool do_help; @@ -159,8 +155,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ /* Display usage information and exit. */ static void -usage (status) - int status; +usage (int status) { if (status != EXIT_SUCCESS) fprintf (stderr, _("Try `%s --help' for more information.\n"), @@ -217,8 +212,7 @@ Informative output:\n\ /* Return true if a message should be kept. */ static bool -is_message_selected (mp) - const message_ty *mp; +is_message_selected (const message_ty *mp) { /* Always keep the header entry. */ if (mp->msgid[0] == '\0') @@ -230,8 +224,7 @@ is_message_selected (mp) /* Remove obsolete messages from a message list. Return the modified list. */ static msgdomain_list_ty * -remove_obsoletes (mdlp) - msgdomain_list_ty *mdlp; +remove_obsoletes (msgdomain_list_ty *mdlp) { size_t k; @@ -243,12 +236,9 @@ remove_obsoletes (mdlp) static void -match_domain (fn1, fn2, defmlp, refmlp, nerrors) - const char *fn1; - const char *fn2; - message_list_ty *defmlp; - message_list_ty *refmlp; - int *nerrors; +match_domain (const char *fn1, const char *fn2, + message_list_ty *defmlp, message_list_ty *refmlp, + int *nerrors) { size_t j; @@ -287,9 +277,7 @@ this message is used but not defined in %s"), fn1); static void -compare (fn1, fn2) - const char *fn1; - const char *fn2; +compare (const char *fn1, const char *fn2) { msgdomain_list_ty *def; msgdomain_list_ty *ref; diff --git a/src/msgcomm.c b/src/msgcomm.c index 92542c0be..62c58ba67 100644 --- a/src/msgcomm.c +++ b/src/msgcomm.c @@ -80,9 +80,8 @@ static const struct option long_options[] = }; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static void usage PARAMS ((int status)) +/* Forward declaration of local functions. */ +static void usage (int status) #if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ > 4) || __GNUC__ > 2) __attribute__ ((noreturn)) #endif @@ -90,9 +89,7 @@ static void usage PARAMS ((int status)) int -main (argc, argv) - int argc; - char *argv[]; +main (int argc, char *argv[]) { int cnt; int optchar; @@ -304,8 +301,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ /* Display usage information and exit. */ static void -usage (status) - int status; +usage (int status) { if (status != EXIT_SUCCESS) fprintf (stderr, _("Try `%s --help' for more information.\n"), diff --git a/src/msgconv.c b/src/msgconv.c index 4447aef50..a95094662 100644 --- a/src/msgconv.c +++ b/src/msgconv.c @@ -40,7 +40,7 @@ #define _(str) gettext (str) -extern const char * locale_charset PARAMS ((void)); +extern const char * locale_charset (void); /* Force output of PO file even if empty. */ @@ -72,15 +72,16 @@ static const struct option long_options[] = }; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static void usage PARAMS ((int status)); +/* Forward declaration of local functions. */ +static void usage (int status) +#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2) + __attribute__ ((noreturn)) +#endif +; int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { int opt; bool do_help; @@ -241,8 +242,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ /* Display usage information and exit. */ static void -usage (status) - int status; +usage (int status) { if (status != EXIT_SUCCESS) fprintf (stderr, _("Try `%s --help' for more information.\n"), diff --git a/src/msgen.c b/src/msgen.c index be800b4d7..add0f658c 100644 --- a/src/msgen.c +++ b/src/msgen.c @@ -66,15 +66,16 @@ static const struct option long_options[] = }; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static void usage PARAMS ((int status)); +/* Forward declaration of local functions. */ +static void usage (int status) +#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2) + __attribute__ ((noreturn)) +#endif +; int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { int opt; bool do_help; @@ -225,8 +226,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ /* Display usage information and exit. */ static void -usage (status) - int status; +usage (int status) { if (status != EXIT_SUCCESS) fprintf (stderr, _("Try `%s --help' for more information.\n"), diff --git a/src/msgexec.c b/src/msgexec.c index 50bfc1195..2de37cd07 100644 --- a/src/msgexec.c +++ b/src/msgexec.c @@ -80,23 +80,17 @@ static const struct option long_options[] = }; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static void usage PARAMS ((int status)); -#ifdef EINTR -static inline int nonintr_close PARAMS ((int fd)); +/* Forward declaration of local functions. */ +static void usage (int status) +#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2) + __attribute__ ((noreturn)) #endif -static void process_string PARAMS ((const message_ty *mp, - const char *str, size_t len)); -static void process_message PARAMS ((const message_ty *mp)); -static void process_message_list PARAMS ((const message_list_ty *mlp)); -static void process_msgdomain_list PARAMS ((const msgdomain_list_ty *mdlp)); +; +static void process_msgdomain_list (const msgdomain_list_ty *mdlp); int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { int opt; bool do_help; @@ -216,8 +210,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ /* Display usage information and exit. */ static void -usage (status) - int status; +usage (int status) { if (status != EXIT_SUCCESS) fprintf (stderr, _("Try `%s --help' for more information.\n"), @@ -279,8 +272,7 @@ Informative output:\n\ signal handlers set up, namely when we get interrupted via SIGSTOP. */ static inline int -nonintr_close (fd) - int fd; +nonintr_close (int fd) { int retval; @@ -298,10 +290,7 @@ nonintr_close (fd) /* Pipe a string STR of size LEN bytes to the subprogram. The byte after STR is known to be a '\0' byte. */ static void -process_string (mp, str, len) - const message_ty *mp; - const char *str; - size_t len; +process_string (const message_ty *mp, const char *str, size_t len) { ssize_t nwritten; @@ -347,8 +336,7 @@ process_string (mp, str, len) static void -process_message (mp) - const message_ty *mp; +process_message (const message_ty *mp) { const char *msgstr = mp->msgstr; size_t msgstr_len = mp->msgstr_len; @@ -367,8 +355,7 @@ process_message (mp) static void -process_message_list (mlp) - const message_list_ty *mlp; +process_message_list (const message_list_ty *mlp) { size_t j; @@ -378,8 +365,7 @@ process_message_list (mlp) static void -process_msgdomain_list (mdlp) - const msgdomain_list_ty *mdlp; +process_msgdomain_list (const msgdomain_list_ty *mdlp) { size_t k; diff --git a/src/msgfilter.c b/src/msgfilter.c index 7391b69f1..90bf192b8 100644 --- a/src/msgfilter.c +++ b/src/msgfilter.c @@ -112,32 +112,17 @@ static const struct option long_options[] = }; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static void usage PARAMS ((int status)); -#ifdef EINTR -static inline int nonintr_close PARAMS ((int fd)); -static inline ssize_t nonintr_read PARAMS ((int fd, void *buf, size_t count)); -static inline ssize_t nonintr_write PARAMS ((int fd, const void *buf, - size_t count)); -#if HAVE_SELECT -static inline int nonintr_select PARAMS ((int n, fd_set *readfds, - fd_set *writefds, fd_set *exceptfds, - struct timeval *timeout)); +/* Forward declaration of local functions. */ +static void usage (int status) +#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2) + __attribute__ ((noreturn)) #endif -#endif -static void process_string PARAMS ((const char *str, size_t len, - char **resultp, size_t *lengthp)); -static void process_message PARAMS ((message_ty *mp)); -static void process_message_list PARAMS ((message_list_ty *mlp)); -static msgdomain_list_ty * - process_msgdomain_list PARAMS ((msgdomain_list_ty *mdlp)); +; +static msgdomain_list_ty *process_msgdomain_list (msgdomain_list_ty *mdlp); int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { int opt; bool do_help; @@ -344,8 +329,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ /* Display usage information and exit. */ static void -usage (status) - int status; +usage (int status) { if (status != EXIT_SUCCESS) fprintf (stderr, _("Try `%s --help' for more information.\n"), @@ -438,8 +422,7 @@ Informative output:\n\ signal handlers set up, namely when we get interrupted via SIGSTOP. */ static inline int -nonintr_close (fd) - int fd; +nonintr_close (int fd) { int retval; @@ -452,10 +435,7 @@ nonintr_close (fd) #define close nonintr_close static inline ssize_t -nonintr_read (fd, buf, count) - int fd; - void *buf; - size_t count; +nonintr_read (int fd, void *buf, size_t count) { ssize_t retval; @@ -468,10 +448,7 @@ nonintr_read (fd, buf, count) #define read nonintr_read static inline ssize_t -nonintr_write (fd, buf, count) - int fd; - const void *buf; - size_t count; +nonintr_write (int fd, const void *buf, size_t count) { ssize_t retval; @@ -486,12 +463,8 @@ nonintr_write (fd, buf, count) # if HAVE_SELECT static inline int -nonintr_select (n, readfds, writefds, exceptfds, timeout) - int n; - fd_set *readfds; - fd_set *writefds; - fd_set *exceptfds; - struct timeval *timeout; +nonintr_select (int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, + struct timeval *timeout) { int retval; @@ -527,11 +500,7 @@ nonintr_select (n, readfds, writefds, exceptfds, timeout) Store the freshly allocated result at *RESULTP and its length at *LENGTHP. */ static void -process_string (str, len, resultp, lengthp) - const char *str; - size_t len; - char **resultp; - size_t *lengthp; +process_string (const char *str, size_t len, char **resultp, size_t *lengthp) { pid_t child; int fd[2]; @@ -682,8 +651,7 @@ process_string (str, len, resultp, lengthp) static void -process_message (mp) - message_ty *mp; +process_message (message_ty *mp) { const char *msgstr = mp->msgstr; size_t msgstr_len = mp->msgstr_len; @@ -738,8 +706,7 @@ process_message (mp) static void -process_message_list (mlp) - message_list_ty *mlp; +process_message_list (message_list_ty *mlp) { size_t j; @@ -749,8 +716,7 @@ process_message_list (mlp) static msgdomain_list_ty * -process_msgdomain_list (mdlp) - msgdomain_list_ty *mdlp; +process_msgdomain_list (msgdomain_list_ty *mdlp) { size_t k; diff --git a/src/msgfmt.c b/src/msgfmt.c index 9f4091f06..191d6989d 100644 --- a/src/msgfmt.c +++ b/src/msgfmt.c @@ -177,51 +177,21 @@ static const struct option long_options[] = }; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static void usage PARAMS ((int status)) +/* Forward declaration of local functions. */ +static void usage (int status) #if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2) __attribute__ ((noreturn)) #endif ; -static const char *add_mo_suffix PARAMS ((const char *)); -static struct msg_domain *new_domain PARAMS ((const char *name, - const char *file_name)); -static bool is_nonobsolete PARAMS ((const message_ty *mp)); -#if USE_SIGINFO -static void sigfpe_handler PARAMS ((int sig, siginfo_t *sip, void *scp)); -#else -static void sigfpe_handler PARAMS ((int sig)); -#endif -static void install_sigfpe_handler PARAMS ((void)); -static void uninstall_sigfpe_handler PARAMS ((void)); -static void check_plural_eval PARAMS ((struct expression *plural_expr, - unsigned long nplurals_value, - const lex_pos_ty *header_pos)); -static void check_plural PARAMS ((message_list_ty *mlp)); -static void check_pair PARAMS ((const char *msgid, const lex_pos_ty *msgid_pos, - const char *msgid_plural, - const char *msgstr, size_t msgstr_len, - const lex_pos_ty *msgstr_pos, - enum is_format is_format[NFORMATS])); -static void check_header_entry PARAMS ((const char *msgstr_string)); -static void format_constructor PARAMS ((po_ty *that)); -static void format_debrief PARAMS ((po_ty *)); -static void format_directive_domain PARAMS ((po_ty *pop, char *name)); -static void format_directive_message PARAMS ((po_ty *pop, char *msgid, - lex_pos_ty *msgid_pos, - char *msgid_plural, - char *msgstr, size_t msgstr_len, - lex_pos_ty *msgstr_pos, - bool obsolete)); -static void format_comment_special PARAMS ((po_ty *pop, const char *s)); -static void read_po_file PARAMS ((char *filename)); +static const char *add_mo_suffix (const char *); +static struct msg_domain *new_domain (const char *name, const char *file_name); +static bool is_nonobsolete (const message_ty *mp); +static void check_plural (message_list_ty *mlp); +static void read_po_file (char *filename); int -main (argc, argv) - int argc; - char *argv[]; +main (int argc, char *argv[]) { int opt; bool do_help = false; @@ -521,8 +491,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ /* Display usage information and exit. */ static void -usage (status) - int status; +usage (int status) { if (status != EXIT_SUCCESS) fprintf (stderr, _("Try `%s --help' for more information.\n"), @@ -627,8 +596,7 @@ Informative output:\n\ static const char * -add_mo_suffix (fname) - const char *fname; +add_mo_suffix (const char *fname) { size_t len; char *result; @@ -645,9 +613,7 @@ add_mo_suffix (fname) static struct msg_domain * -new_domain (name, file_name) - const char *name; - const char *file_name; +new_domain (const char *name, const char *file_name) { struct msg_domain **p_dom = &domain_list; @@ -671,8 +637,7 @@ new_domain (name, file_name) static bool -is_nonobsolete (mp) - const message_ty *mp; +is_nonobsolete (const message_ty *mp) { return !mp->obsolete; } @@ -687,10 +652,7 @@ static int sigfpe_code; /* Signal handler called in case of arithmetic exception (e.g. division by zero) during plural_eval. */ static void -sigfpe_handler (sig, sip, scp) - int sig; - siginfo_t *sip; - void *scp; +sigfpe_handler (int sig, siginfo_t *sip, void *scp) { sigfpe_code = sip->si_code; siglongjmp (sigfpe_exit, 1); @@ -701,8 +663,7 @@ sigfpe_handler (sig, sip, scp) /* Signal handler called in case of arithmetic exception (e.g. division by zero) during plural_eval. */ static void -sigfpe_handler (sig) - int sig; +sigfpe_handler (int sig) { siglongjmp (sigfpe_exit, 1); } @@ -739,10 +700,9 @@ uninstall_sigfpe_handler () /* Check the values returned by plural_eval. */ static void -check_plural_eval (plural_expr, nplurals_value, header_pos) - struct expression *plural_expr; - unsigned long nplurals_value; - const lex_pos_ty *header_pos; +check_plural_eval (struct expression *plural_expr, + unsigned long nplurals_value, + const lex_pos_ty *header_pos) { if (sigsetjmp (sigfpe_exit, 1) == 0) { @@ -825,8 +785,7 @@ check_plural_eval (plural_expr, nplurals_value, header_pos) /* Perform plural expression checking. */ static void -check_plural (mlp) - message_list_ty *mlp; +check_plural (message_list_ty *mlp) { const lex_pos_ty *has_plural; unsigned long min_nplurals; @@ -1034,15 +993,11 @@ check_plural (mlp) /* Perform miscellaneous checks on a message. */ static void -check_pair (msgid, msgid_pos, msgid_plural, msgstr, msgstr_len, msgstr_pos, - is_format) - const char *msgid; - const lex_pos_ty *msgid_pos; - const char *msgid_plural; - const char *msgstr; - size_t msgstr_len; - const lex_pos_ty *msgstr_pos; - enum is_format is_format[NFORMATS]; +check_pair (const char *msgid, + const lex_pos_ty *msgid_pos, + const char *msgid_plural, + const char *msgstr, size_t msgstr_len, + const lex_pos_ty *msgstr_pos, enum is_format is_format[NFORMATS]) { int has_newline; size_t i; @@ -1258,8 +1213,7 @@ check_pair (msgid, msgid_pos, msgid_plural, msgstr, msgstr_len, msgstr_pos, /* Perform miscellaneous checks on a header entry. */ static void -check_header_entry (msgstr_string) - const char *msgstr_string; +check_header_entry (const char *msgstr_string) { static const char *required_fields[] = { @@ -1323,8 +1277,7 @@ field `%s' still has initial default value\n"), /* Prepare for first message. */ static void -format_constructor (that) - po_ty *that; +format_constructor (po_ty *that) { msgfmt_class_ty *this = (msgfmt_class_ty *) that; size_t i; @@ -1340,8 +1293,7 @@ format_constructor (that) /* Some checks after whole file is read. */ static void -format_debrief (that) - po_ty *that; +format_debrief (po_ty *that) { msgfmt_class_ty *this = (msgfmt_class_ty *) that; @@ -1375,9 +1327,7 @@ warning: older versions of msgfmt will give an error on this\n"))); /* Process `domain' directive from .po file. */ static void -format_directive_domain (pop, name) - po_ty *pop; - char *name; +format_directive_domain (po_ty *pop, char *name) { /* If no output file was given, we change it with each `domain' directive. */ @@ -1417,16 +1367,13 @@ domain name \"%s\" not suitable as file name: will use prefix"), name); /* Process `msgid'/`msgstr' pair from .po file. */ static void -format_directive_message (that, msgid_string, msgid_pos, msgid_plural, - msgstr_string, msgstr_len, msgstr_pos, obsolete) - po_ty *that; - char *msgid_string; - lex_pos_ty *msgid_pos; - char *msgid_plural; - char *msgstr_string; - size_t msgstr_len; - lex_pos_ty *msgstr_pos; - bool obsolete; +format_directive_message (po_ty *that, + char *msgid_string, + lex_pos_ty *msgid_pos, + char *msgid_plural, + char *msgstr_string, size_t msgstr_len, + lex_pos_ty *msgstr_pos, + bool obsolete) { msgfmt_class_ty *this = (msgfmt_class_ty *) that; message_ty *mp; @@ -1535,9 +1482,7 @@ format_directive_message (that, msgid_string, msgid_pos, msgid_plural, /* Test for `#, fuzzy' comments and warn. */ static void -format_comment_special (that, s) - po_ty *that; - const char *s; +format_comment_special (po_ty *that, const char *s) { msgfmt_class_ty *this = (msgfmt_class_ty *) that; bool fuzzy; @@ -1585,8 +1530,7 @@ static po_method_ty format_methods = /* Read .po file FILENAME and store translation pairs. */ static void -read_po_file (filename) - char *filename; +read_po_file (char *filename) { po_ty *pop; diff --git a/src/msggrep.c b/src/msggrep.c index 0b8fbdbd7..9197bb8ee 100644 --- a/src/msggrep.c +++ b/src/msggrep.c @@ -106,28 +106,22 @@ static const struct option long_options[] = }; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static void no_pass PARAMS ((int opt)); -static void usage PARAMS ((int status)); -static bool filename_list_match PARAMS ((const string_list_ty *slp, - const char *filename)); -#ifdef EINTR -static inline int nonintr_close PARAMS ((int fd)); +/* Forward declaration of local functions. */ +static void no_pass (int opt) +#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2) + __attribute__ ((noreturn)) #endif -static bool is_string_selected PARAMS ((int grep_pass, const char *str, - size_t len)); -static bool is_message_selected PARAMS ((const message_ty *mp)); -static void process_message_list PARAMS ((const char *domain, - message_list_ty *mlp)); -static msgdomain_list_ty * - process_msgdomain_list PARAMS ((msgdomain_list_ty *mdlp)); +; +static void usage (int status) +#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2) + __attribute__ ((noreturn)) +#endif +; +static msgdomain_list_ty *process_msgdomain_list (msgdomain_list_ty *mdlp); int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { int opt; bool do_help; @@ -383,8 +377,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ static void -no_pass (opt) - int opt; +no_pass (int opt) { error (EXIT_SUCCESS, 0, _("option '%c' cannot be used before 'K' or 'T' has been specified"), @@ -395,8 +388,7 @@ no_pass (opt) /* Display usage information and exit. */ static void -usage (status) - int status; +usage (int status) { if (status != EXIT_SUCCESS) fprintf (stderr, _("Try `%s --help' for more information.\n"), @@ -500,9 +492,7 @@ Informative output:\n\ /* Return 1 if FILENAME is contained in a list of filename patterns, 0 otherwise. */ static bool -filename_list_match (slp, filename) - const string_list_ty *slp; - const char *filename; +filename_list_match (const string_list_ty *slp, const char *filename) { size_t j; @@ -520,8 +510,7 @@ filename_list_match (slp, filename) signal handlers set up, namely when we get interrupted via SIGSTOP. */ static inline int -nonintr_close (fd) - int fd; +nonintr_close (int fd) { int retval; @@ -539,10 +528,7 @@ nonintr_close (fd) /* Process a string STR of size LEN bytes through grep, and return true if it matches. */ static bool -is_string_selected (grep_pass, str, len) - int grep_pass; - const char *str; - size_t len; +is_string_selected (int grep_pass, const char *str, size_t len) { if (grep_args[grep_pass]->nitems > 0) { @@ -573,8 +559,7 @@ is_string_selected (grep_pass, str, len) /* Return true if a message matches. */ static bool -is_message_selected (mp) - const message_ty *mp; +is_message_selected (const message_ty *mp) { size_t i; const char *msgstr; @@ -646,9 +631,7 @@ is_message_selected (mp) static void -process_message_list (domain, mlp) - const char *domain; - message_list_ty *mlp; +process_message_list (const char *domain, message_list_ty *mlp) { if (string_list_member (domain_names, domain)) /* Keep all the messages in the list. */ @@ -660,8 +643,7 @@ process_message_list (domain, mlp) static msgdomain_list_ty * -process_msgdomain_list (mdlp) - msgdomain_list_ty *mdlp; +process_msgdomain_list (msgdomain_list_ty *mdlp) { size_t k; diff --git a/src/msginit.c b/src/msginit.c index d443c2ad0..07b7e026c 100644 --- a/src/msginit.c +++ b/src/msginit.c @@ -94,10 +94,9 @@ #define SIZEOF(a) (sizeof(a) / sizeof(a[0])) -extern const char * locale_charset PARAMS ((void)); -extern const char * _nl_locale_name PARAMS ((int category, - const char *categoryname)); -extern const char * _nl_expand_alias PARAMS ((const char *name)); +extern const char * locale_charset (void); +extern const char * _nl_locale_name (int category, const char *categoryname); +extern const char * _nl_expand_alias (const char *name); /* Locale name. */ static const char *locale; @@ -125,48 +124,21 @@ static const struct option long_options[] = { NULL, 0, NULL, 0 } }; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static void usage PARAMS ((int status)) +/* Forward declaration of local functions. */ +static void usage (int status) #if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2) __attribute__ ((noreturn)) #endif ; -static const char *find_pot PARAMS ((void)); -static const char *catalogname_for_locale PARAMS ((const char *locale)); -static const char *language_of_locale PARAMS ((const char *locale)); -static const char *canonical_locale_charset PARAMS ((void)); -static const char *englishname_of_language PARAMS ((void)); -static const char *project_id PARAMS ((void)); -static const char *project_id_version PARAMS ((void)); -static const char *po_revision_date PARAMS ((const char *header)); -static struct passwd *get_user_pwd PARAMS ((void)); -static const char *get_user_fullname PARAMS ((void)); -static const char *get_user_email PARAMS ((void)); -static const char *last_translator PARAMS ((void)); -static const char *language_team_address PARAMS ((void)); -static const char *language_team PARAMS ((void)); -static const char *mime_version PARAMS ((void)); -static const char *content_type PARAMS ((const char *header)); -static const char *content_transfer_encoding PARAMS ((void)); -static const char *plural_forms PARAMS ((void)); -static char *get_field PARAMS ((const char *header, const char *field)); -static char *put_field PARAMS ((const char *old_header, const char *field, - const char *value)); -static const char *get_title PARAMS ((void)); -static const char *subst_string PARAMS ((const char *str, - unsigned int nsubst, - const char *(*subst)[2])); -static void subst_string_list PARAMS ((string_list_ty *slp, - unsigned int nsubst, - const char *(*subst)[2])); -static msgdomain_list_ty *fill_header PARAMS ((msgdomain_list_ty *mdlp)); +static const char *find_pot (void); +static const char *catalogname_for_locale (const char *locale); +static const char *language_of_locale (const char *locale); +static char *get_field (const char *header, const char *field); +static msgdomain_list_ty *fill_header (msgdomain_list_ty *mdlp); int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { int opt; bool do_help; @@ -342,8 +314,7 @@ the output .po file through the --output-file option.\n"), /* Display usage information and exit. */ static void -usage (status) - int status; +usage (int status) { if (status != EXIT_SUCCESS) fprintf (stderr, _("Try `%s --help' for more information.\n"), @@ -473,8 +444,7 @@ Please specify the input .pot file through the --input option.\n"))); because the resulting catalog can be used as a default for all "de_XX", such as "de_AT". */ static const char * -catalogname_for_locale (locale) - const char *locale; +catalogname_for_locale (const char *locale) { static const char *locales_with_principal_territory[] = { /* Language Main territory */ @@ -624,8 +594,7 @@ catalogname_for_locale (locale) /* Return the language of a locale. */ static const char * -language_of_locale (locale) - const char *locale; +language_of_locale (const char *locale) { const char *language_end; @@ -982,8 +951,7 @@ project_id_version () /* Construct the value for the PO-Revision-Date field. */ static const char * -po_revision_date (header) - const char *header; +po_revision_date (const char *header) { if (no_translator) /* Because the PO file is automatically generated, we use the @@ -1214,8 +1182,7 @@ mime_version () /* Construct the value for the Content-Type field. */ static const char * -content_type (header) - const char *header; +content_type (const char *header) { bool was_utf8; const char *old_field; @@ -1272,8 +1239,8 @@ plural_forms () static struct { const char *name; - const char * (*getter0) PARAMS ((void)); - const char * (*getter1) PARAMS ((const char *header)); + const char * (*getter0) (void); + const char * (*getter1) (const char *header); } fields[] = { @@ -1293,9 +1260,7 @@ fields[] = /* Retrieve a freshly allocated copy of a field's value. */ static char * -get_field (header, field) - const char *header; - const char *field; +get_field (const char *header, const char *field) { size_t len = strlen (field); const char *line; @@ -1333,10 +1298,7 @@ get_field (header, field) /* Add a field with value to a header, and return the new header. */ static char * -put_field (old_header, field, value) - const char *old_header; - const char *field; - const char *value; +put_field (const char *old_header, const char *field, const char *value) { size_t len = strlen (field); const char *line; @@ -1491,10 +1453,8 @@ get_title () string. When subst[j][0] found, it is replaced with subst[j][1]. subst[j][0] must not be the empty string. */ static const char * -subst_string (str, nsubst, subst) - const char *str; - unsigned int nsubst; - const char *(*subst)[2]; +subst_string (const char *str, + unsigned int nsubst, const char *(*subst)[2]) { if (nsubst > 0) { @@ -1544,10 +1504,8 @@ subst_string (str, nsubst, subst) When subst[j][0] found, it is replaced with subst[j][1]. subst[j][0] must not be the empty string. */ static void -subst_string_list (slp, nsubst, subst) - string_list_ty *slp; - unsigned int nsubst; - const char *(*subst)[2]; +subst_string_list (string_list_ty *slp, + unsigned int nsubst, const char *(*subst)[2]) { size_t j; @@ -1558,8 +1516,7 @@ subst_string_list (slp, nsubst, subst) /* Fill the templates in all fields of the header entry. */ static msgdomain_list_ty * -fill_header (mdlp) - msgdomain_list_ty *mdlp; +fill_header (msgdomain_list_ty *mdlp) { /* Cache the strings filled in, for use when there are multiple domains and a header entry for each domain. */ diff --git a/src/msgl-ascii.c b/src/msgl-ascii.c index b43aca7e0..90c401b5f 100644 --- a/src/msgl-ascii.c +++ b/src/msgl-ascii.c @@ -31,8 +31,7 @@ bool -is_ascii_string (string) - const char *string; +is_ascii_string (const char *string) { for (; *string; string++) if (!c_isascii ((unsigned char) *string)) @@ -41,8 +40,7 @@ is_ascii_string (string) } bool -is_ascii_string_list (slp) - string_list_ty *slp; +is_ascii_string_list (string_list_ty *slp) { size_t i; @@ -54,8 +52,7 @@ is_ascii_string_list (slp) } bool -is_ascii_message (mp) - message_ty *mp; +is_ascii_message (message_ty *mp) { const char *p = mp->msgstr; const char *p_end = p + mp->msgstr_len; @@ -80,8 +77,7 @@ is_ascii_message (mp) } bool -is_ascii_message_list (mlp) - message_list_ty *mlp; +is_ascii_message_list (message_list_ty *mlp) { size_t j; diff --git a/src/msgl-ascii.h b/src/msgl-ascii.h index fcb47b2b1..c4e9bd2d4 100644 --- a/src/msgl-ascii.h +++ b/src/msgl-ascii.h @@ -1,5 +1,5 @@ /* Message list test for ASCII character set. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -24,12 +24,12 @@ #include extern bool - is_ascii_string PARAMS ((const char *string)); + is_ascii_string (const char *string); extern bool - is_ascii_string_list PARAMS ((string_list_ty *slp)); + is_ascii_string_list (string_list_ty *slp); extern bool - is_ascii_message PARAMS ((message_ty *mp)); + is_ascii_message (message_ty *mp); extern bool - is_ascii_message_list PARAMS ((message_list_ty *mlp)); + is_ascii_message_list (message_list_ty *mlp); #endif /* _MSGL_ASCII_H */ diff --git a/src/msgl-cat.c b/src/msgl-cat.c index d1807e378..659e1d403 100644 --- a/src/msgl-cat.c +++ b/src/msgl-cat.c @@ -63,16 +63,8 @@ bool msgcomm_mode = false; bool omit_header = false; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static bool is_message_selected PARAMS ((const message_ty *tmp)); -static bool is_message_needed PARAMS ((const message_ty *tmp)); -static bool is_message_first_needed PARAMS ((const message_ty *tmp)); - - static bool -is_message_selected (tmp) - const message_ty *tmp; +is_message_selected (const message_ty *tmp) { int used = (tmp->used >= 0 ? tmp->used : - tmp->used); @@ -83,8 +75,7 @@ is_message_selected (tmp) static bool -is_message_needed (mp) - const message_ty *mp; +is_message_needed (const message_ty *mp) { if (!msgcomm_mode && ((mp->msgid[0] != '\0' && mp->is_fuzzy) || mp->msgstr[0] == '\0')) @@ -98,8 +89,7 @@ is_message_needed (mp) /* The use_first logic. */ static bool -is_message_first_needed (mp) - const message_ty *mp; +is_message_first_needed (const message_ty *mp) { if (mp->tmp->obsolete && is_message_needed (mp)) { @@ -112,9 +102,7 @@ is_message_first_needed (mp) msgdomain_list_ty * -catenate_msgdomain_list (file_list, to_code) - string_list_ty *file_list; - const char *to_code; +catenate_msgdomain_list (string_list_ty *file_list, const char *to_code) { const char * const *files = file_list->item; size_t nfiles = file_list->nitems; diff --git a/src/msgl-cat.h b/src/msgl-cat.h index 3a76b5846..7b6f97477 100644 --- a/src/msgl-cat.h +++ b/src/msgl-cat.h @@ -1,5 +1,5 @@ /* Message list concatenation and duplicate handling. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -41,7 +41,7 @@ extern bool msgcomm_mode; extern bool omit_header; extern msgdomain_list_ty * - catenate_msgdomain_list PARAMS ((string_list_ty *file_list, - const char *to_code)); + catenate_msgdomain_list (string_list_ty *file_list, + const char *to_code); #endif /* _MSGL_CAT_H */ diff --git a/src/msgl-charset.c b/src/msgl-charset.c index 850ddc801..269c4e905 100644 --- a/src/msgl-charset.c +++ b/src/msgl-charset.c @@ -1,5 +1,5 @@ /* Message list charset and locale charset handling. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -40,11 +40,10 @@ #define _(str) gettext (str) -extern const char * locale_charset PARAMS ((void)); +extern const char * locale_charset (void); void -compare_po_locale_charsets (mdlp) - const msgdomain_list_ty *mdlp; +compare_po_locale_charsets (const msgdomain_list_ty *mdlp) { const char *locale_code; const char *canon_locale_code; diff --git a/src/msgl-charset.h b/src/msgl-charset.h index 6c29df23c..7fe28b385 100644 --- a/src/msgl-charset.h +++ b/src/msgl-charset.h @@ -1,5 +1,5 @@ /* Message list charset and locale charset handling. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -22,6 +22,6 @@ #include "message.h" extern void - compare_po_locale_charsets PARAMS ((const msgdomain_list_ty *mdlp)); + compare_po_locale_charsets (const msgdomain_list_ty *mdlp); #endif /* _MSGL_CHARSET_H */ diff --git a/src/msgl-english.c b/src/msgl-english.c index 9a07071f9..8c92df628 100644 --- a/src/msgl-english.c +++ b/src/msgl-english.c @@ -1,5 +1,5 @@ /* Message translation initialization for English. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -30,8 +30,7 @@ msgdomain_list_ty * -msgdomain_list_english (mdlp) - msgdomain_list_ty *mdlp; +msgdomain_list_english (msgdomain_list_ty *mdlp) { size_t j, k; diff --git a/src/msgl-english.h b/src/msgl-english.h index dec694825..c3f1128f2 100644 --- a/src/msgl-english.h +++ b/src/msgl-english.h @@ -1,5 +1,5 @@ /* Message translation initialization for English. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -22,6 +22,6 @@ #include "message.h" extern msgdomain_list_ty * - msgdomain_list_english PARAMS ((msgdomain_list_ty *mdlp)); + msgdomain_list_english (msgdomain_list_ty *mdlp); #endif /* _MSGL_ENGLISH_H */ diff --git a/src/msgl-equal.c b/src/msgl-equal.c index 1252af9e5..b1ab7b7fa 100644 --- a/src/msgl-equal.c +++ b/src/msgl-equal.c @@ -28,40 +28,17 @@ #include -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static inline bool msgstr_equal PARAMS ((const char *msgstr1, - size_t msgstr1_len, - const char *msgstr2, - size_t msgstr2_len)); -static inline bool msgstr_equal_ignoring_potcdate PARAMS ((const char *msgstr1, - size_t msgstr1_len, - const char *msgstr2, - size_t msgstr2_len)); -static inline bool pos_equal PARAMS ((const lex_pos_ty *pos1, - const lex_pos_ty *pos2)); -static inline bool msgdomain_equal PARAMS ((const msgdomain_ty *mdp1, - const msgdomain_ty *mdp2, - bool ignore_potcdate)); - - static inline bool -msgstr_equal (msgstr1, msgstr1_len, msgstr2, msgstr2_len) - const char *msgstr1; - size_t msgstr1_len; - const char *msgstr2; - size_t msgstr2_len; +msgstr_equal (const char *msgstr1, size_t msgstr1_len, + const char *msgstr2, size_t msgstr2_len) { return (msgstr1_len == msgstr2_len && memcmp (msgstr1, msgstr2, msgstr1_len) == 0); } static bool -msgstr_equal_ignoring_potcdate (msgstr1, msgstr1_len, msgstr2, msgstr2_len) - const char *msgstr1; - size_t msgstr1_len; - const char *msgstr2; - size_t msgstr2_len; +msgstr_equal_ignoring_potcdate (const char *msgstr1, size_t msgstr1_len, + const char *msgstr2, size_t msgstr2_len) { const char *msgstr1_end = msgstr1 + msgstr1_len; const char *msgstr2_end = msgstr2 + msgstr2_len; @@ -131,9 +108,7 @@ msgstr_equal_ignoring_potcdate (msgstr1, msgstr1_len, msgstr2, msgstr2_len) } static inline bool -pos_equal (pos1, pos2) - const lex_pos_ty *pos1; - const lex_pos_ty *pos2; +pos_equal (const lex_pos_ty *pos1, const lex_pos_ty *pos2) { return ((pos1->file_name == pos2->file_name || strcmp (pos1->file_name, pos2->file_name) == 0) @@ -141,9 +116,7 @@ pos_equal (pos1, pos2) } bool -string_list_equal (slp1, slp2) - const string_list_ty *slp1; - const string_list_ty *slp2; +string_list_equal (const string_list_ty *slp1, const string_list_ty *slp2) { size_t i, i1, i2; @@ -158,10 +131,8 @@ string_list_equal (slp1, slp2) } bool -message_equal (mp1, mp2, ignore_potcdate) - const message_ty *mp1; - const message_ty *mp2; - bool ignore_potcdate; +message_equal (const message_ty *mp1, const message_ty *mp2, + bool ignore_potcdate) { size_t i, i1, i2; @@ -212,10 +183,8 @@ message_equal (mp1, mp2, ignore_potcdate) } bool -message_list_equal (mlp1, mlp2, ignore_potcdate) - const message_list_ty *mlp1; - const message_list_ty *mlp2; - bool ignore_potcdate; +message_list_equal (const message_list_ty *mlp1, const message_list_ty *mlp2, + bool ignore_potcdate) { size_t i, i1, i2; @@ -230,10 +199,8 @@ message_list_equal (mlp1, mlp2, ignore_potcdate) } static inline bool -msgdomain_equal (mdp1, mdp2, ignore_potcdate) - const msgdomain_ty *mdp1; - const msgdomain_ty *mdp2; - bool ignore_potcdate; +msgdomain_equal (const msgdomain_ty *mdp1, const msgdomain_ty *mdp2, + bool ignore_potcdate) { return (strcmp (mdp1->domain, mdp2->domain) == 0 && message_list_equal (mdp1->messages, mdp2->messages, @@ -241,10 +208,9 @@ msgdomain_equal (mdp1, mdp2, ignore_potcdate) } bool -msgdomain_list_equal (mdlp1, mdlp2, ignore_potcdate) - const msgdomain_list_ty *mdlp1; - const msgdomain_list_ty *mdlp2; - bool ignore_potcdate; +msgdomain_list_equal (const msgdomain_list_ty *mdlp1, + const msgdomain_list_ty *mdlp2, + bool ignore_potcdate) { size_t i, i1, i2; diff --git a/src/msgl-equal.h b/src/msgl-equal.h index c131b2ded..5eafa00ef 100644 --- a/src/msgl-equal.h +++ b/src/msgl-equal.h @@ -24,22 +24,22 @@ #include extern bool - string_list_equal PARAMS ((const string_list_ty *slp1, - const string_list_ty *slp2)); + string_list_equal (const string_list_ty *slp1, + const string_list_ty *slp2); /* Test whether the written representation of two messages / message lists would be the same. */ extern bool - message_equal PARAMS ((const message_ty *mp1, const message_ty *mp2, - bool ignore_potcdate)); + message_equal (const message_ty *mp1, const message_ty *mp2, + bool ignore_potcdate); extern bool - message_list_equal PARAMS ((const message_list_ty *mlp1, - const message_list_ty *mlp2, - bool ignore_potcdate)); + message_list_equal (const message_list_ty *mlp1, + const message_list_ty *mlp2, + bool ignore_potcdate); extern bool - msgdomain_list_equal PARAMS ((const msgdomain_list_ty *mdlp1, - const msgdomain_list_ty *mdlp2, - bool ignore_potcdate)); + msgdomain_list_equal (const msgdomain_list_ty *mdlp1, + const msgdomain_list_ty *mdlp2, + bool ignore_potcdate); #endif /* _MSGL_EQUAL_H */ diff --git a/src/msgl-iconv.c b/src/msgl-iconv.c index 61633b5e1..97616d692 100644 --- a/src/msgl-iconv.c +++ b/src/msgl-iconv.c @@ -48,29 +48,13 @@ #define _(str) gettext (str) -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -#if HAVE_ICONV -static int iconv_string PARAMS ((iconv_t cd, - const char *start, const char *end, - char **resultp, size_t *lengthp)); -static void convert_string_list PARAMS ((iconv_t cd, string_list_ty *slp)); -static void convert_msgid PARAMS ((iconv_t cd, message_ty *mp)); -static void convert_msgstr PARAMS ((iconv_t cd, message_ty *mp)); -#endif - - #if HAVE_ICONV /* Converts an entire string from one encoding to another, using iconv. Return value: 0 if successful, otherwise -1 and errno set. */ static int -iconv_string (cd, start, end, resultp, lengthp) - iconv_t cd; - const char *start; - const char *end; - char **resultp; - size_t *lengthp; +iconv_string (iconv_t cd, const char *start, const char *end, + char **resultp, size_t *lengthp) { #define tmpbufsize 4096 size_t length; @@ -185,9 +169,7 @@ iconv_string (cd, start, end, resultp, lengthp) } char * -convert_string (cd, string) - iconv_t cd; - const char *string; +convert_string (iconv_t cd, const char *string) { size_t len = strlen (string) + 1; char *result = NULL; @@ -205,9 +187,7 @@ convert_string (cd, string) } static void -convert_string_list (cd, slp) - iconv_t cd; - string_list_ty *slp; +convert_string_list (iconv_t cd, string_list_ty *slp) { size_t i; @@ -217,9 +197,7 @@ convert_string_list (cd, slp) } static void -convert_msgid (cd, mp) - iconv_t cd; - message_ty *mp; +convert_msgid (iconv_t cd, message_ty *mp) { mp->msgid = convert_string (cd, mp->msgid); if (mp->msgid_plural != NULL) @@ -227,9 +205,7 @@ convert_msgid (cd, mp) } static void -convert_msgstr (cd, mp) - iconv_t cd; - message_ty *mp; +convert_msgstr (iconv_t cd, message_ty *mp) { char *result = NULL; size_t resultlen; @@ -270,11 +246,9 @@ convert_msgstr (cd, mp) void -iconv_message_list (mlp, canon_from_code, canon_to_code, from_filename) - message_list_ty *mlp; - const char *canon_from_code; - const char *canon_to_code; - const char *from_filename; +iconv_message_list (message_list_ty *mlp, + const char *canon_from_code, const char *canon_to_code, + const char *from_filename) { bool canon_from_code_overridden = (canon_from_code != NULL); size_t j; @@ -402,10 +376,9 @@ This version was built without iconv()."), } msgdomain_list_ty * -iconv_msgdomain_list (mdlp, to_code, from_filename) - msgdomain_list_ty *mdlp; - const char *to_code; - const char *from_filename; +iconv_msgdomain_list (msgdomain_list_ty *mdlp, + const char *to_code, + const char *from_filename) { const char *canon_to_code; size_t k; diff --git a/src/msgl-iconv.h b/src/msgl-iconv.h index 976427ada..0428452f9 100644 --- a/src/msgl-iconv.h +++ b/src/msgl-iconv.h @@ -27,7 +27,7 @@ #if HAVE_ICONV /* Converts the STRING through the conversion descriptor CD. */ -extern char *convert_string PARAMS ((iconv_t cd, const char *string)); +extern char *convert_string (iconv_t cd, const char *string); #endif /* Converts the message list MLP to the (already canonicalized) encoding @@ -35,15 +35,15 @@ extern char *convert_string PARAMS ((iconv_t cd, const char *string)); can be passed as CANON_FROM_CODE; if NULL is passed instead, the encoding is looked up in the header entry. */ extern void - iconv_message_list PARAMS ((message_list_ty *mlp, - const char *canon_from_code, - const char *canon_to_code, - const char *from_filename)); + iconv_message_list (message_list_ty *mlp, + const char *canon_from_code, + const char *canon_to_code, + const char *from_filename); /* Converts all the message lists in MDLP to the encoding TO_CODE. */ extern msgdomain_list_ty * - iconv_msgdomain_list PARAMS ((msgdomain_list_ty *mdlp, - const char *to_code, - const char *from_filename)); + iconv_msgdomain_list (msgdomain_list_ty *mdlp, + const char *to_code, + const char *from_filename); #endif /* _MSGL_ICONV_H */ diff --git a/src/msgmerge.c b/src/msgmerge.c index adae8060e..90fa9726f 100644 --- a/src/msgmerge.c +++ b/src/msgmerge.c @@ -113,30 +113,19 @@ struct statistics }; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static void usage PARAMS ((int status)); -static void compendium PARAMS ((const char *filename)); -static bool msgfmt_check_pair_fails PARAMS ((const lex_pos_ty *pos, - const char *msgid, - const char *msgid_plural, - const char *msgstr, - size_t msgstr_len, size_t fmt)); -static message_ty *message_merge PARAMS ((message_ty *def, message_ty *ref)); -static void match_domain PARAMS ((const char *fn1, const char *fn2, - message_list_list_ty *definitions, - message_list_ty *refmlp, - message_list_ty *resultmlp, - struct statistics *stats, - unsigned int *processed)); -static msgdomain_list_ty *merge PARAMS ((const char *fn1, const char *fn2, - msgdomain_list_ty **defp)); +/* Forward declaration of local functions. */ +static void usage (int status) +#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2) + __attribute__ ((noreturn)) +#endif +; +static void compendium (const char *filename); +static msgdomain_list_ty *merge (const char *fn1, const char *fn2, + msgdomain_list_ty **defp); int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { int opt; bool do_help; @@ -382,8 +371,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ /* Display usage information and exit. */ static void -usage (status) - int status; +usage (int status) { if (status != EXIT_SUCCESS) fprintf (stderr, _("Try `%s --help' for more information.\n"), @@ -495,8 +483,7 @@ Informative output:\n\ static void -compendium (filename) - const char *filename; +compendium (const char *filename) { msgdomain_list_ty *mdlp; size_t k; @@ -510,13 +497,10 @@ compendium (filename) static bool -msgfmt_check_pair_fails (pos, msgid, msgid_plural, msgstr, msgstr_len, fmt) - const lex_pos_ty *pos; - const char *msgid; - const char *msgid_plural; - const char *msgstr; - size_t msgstr_len; - size_t fmt; +msgfmt_check_pair_fails (const lex_pos_ty *pos, + const char *msgid, const char *msgid_plural, + const char *msgstr, size_t msgstr_len, + size_t fmt) { bool failure; struct formatstring_parser *parser = formatstring_parsers[fmt]; @@ -554,9 +538,7 @@ msgfmt_check_pair_fails (pos, msgid, msgid_plural, msgstr, msgstr_len, fmt) static message_ty * -message_merge (def, ref) - message_ty *def; - message_ty *ref; +message_merge (message_ty *def, message_ty *ref) { const char *msgstr; size_t msgstr_len; @@ -804,14 +786,10 @@ message_merge (def, ref) #define DOT_FREQUENCY 10 static void -match_domain (fn1, fn2, definitions, refmlp, resultmlp, stats, processed) - const char *fn1; - const char *fn2; - message_list_list_ty *definitions; - message_list_ty *refmlp; - message_list_ty *resultmlp; - struct statistics *stats; - unsigned int *processed; +match_domain (const char *fn1, const char *fn2, + message_list_list_ty *definitions, message_list_ty *refmlp, + message_list_ty *resultmlp, + struct statistics *stats, unsigned int *processed) { size_t j; @@ -977,10 +955,7 @@ this message should not define plural forms")); } static msgdomain_list_ty * -merge (fn1, fn2, defp) - const char *fn1; /* definitions */ - const char *fn2; /* references */ - msgdomain_list_ty **defp; /* return definition list */ +merge (const char *fn1, const char *fn2, msgdomain_list_ty **defp) { msgdomain_list_ty *def; msgdomain_list_ty *ref; diff --git a/src/msgunfmt.c b/src/msgunfmt.c index fcfbabd9a..eb650b16d 100644 --- a/src/msgunfmt.c +++ b/src/msgunfmt.c @@ -81,15 +81,16 @@ static const struct option long_options[] = }; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static void usage PARAMS ((int status)); +/* Forward declaration of local functions. */ +static void usage (int status) +#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2) + __attribute__ ((noreturn)) +#endif +; int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { int optchar; bool do_help = false; @@ -307,8 +308,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ /* Display usage information and exit. */ static void -usage (status) - int status; +usage (int status) { if (status != EXIT_SUCCESS) fprintf (stderr, _("Try `%s --help' for more information.\n"), diff --git a/src/msguniq.c b/src/msguniq.c index bc88e7eeb..29b8748f3 100644 --- a/src/msguniq.c +++ b/src/msguniq.c @@ -74,15 +74,16 @@ static const struct option long_options[] = }; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static void usage PARAMS ((int status)); +/* Forward declaration of local functions. */ +static void usage (int status) +#if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2) + __attribute__ ((noreturn)) +#endif +; int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { int optchar; bool do_help; @@ -267,8 +268,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ /* Display usage information and exit. */ static void -usage (status) - int status; +usage (int status) { if (status != EXIT_SUCCESS) fprintf (stderr, _("Try `%s --help' for more information.\n"), diff --git a/src/ngettext.c b/src/ngettext.c index b266a6b7f..989e0ff66 100644 --- a/src/ngettext.c +++ b/src/ngettext.c @@ -51,19 +51,16 @@ static const struct option long_options[] = { NULL, 0, NULL, 0 } }; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static void usage PARAMS ((int status)) +/* Forward declaration of local functions. */ +static void usage (int status) #if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2) __attribute__ ((noreturn)) #endif ; -static const char *expand_escape PARAMS ((const char *str)); +static const char *expand_escape (const char *str); int -main (argc, argv) - int argc; - char *argv[]; +main (int argc, char *argv[]) { int optchar; const char *msgid; @@ -203,8 +200,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ /* Display usage information and exit. */ static void -usage (status) - int status; +usage (int status) { if (status != EXIT_SUCCESS) fprintf (stderr, _("Try `%s --help' for more information.\n"), @@ -250,8 +246,7 @@ Standard search directory: %s\n"), /* Expand some escape sequences found in the argument string. */ static const char * -expand_escape (str) - const char *str; +expand_escape (const char *str) { char *retval, *rp; const char *cp = str; diff --git a/src/open-po.c b/src/open-po.c index b1aa0f6fc..70a1e31ae 100644 --- a/src/open-po.c +++ b/src/open-po.c @@ -44,9 +44,7 @@ file's pathname is returned in *REAL_FILE_NAME_P, for error message purposes. */ FILE * -open_po_file (input_name, real_file_name_p) - const char *input_name; - char **real_file_name_p; +open_po_file (const char *input_name, char **real_file_name_p) { static const char *extension[] = { "", ".po", ".pot", }; char *file_name; diff --git a/src/open-po.h b/src/open-po.h index 556168a00..1a4d25375 100644 --- a/src/open-po.h +++ b/src/open-po.h @@ -1,5 +1,5 @@ /* Opening PO files. - Copyright (C) 1995, 1996, 1997, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1995-1997, 2000-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,7 +25,6 @@ not found, the list of directories in "dir-list.h" is searched. The file's pathname is returned in *REAL_FILE_NAME_P, for error message purposes. */ -extern FILE *open_po_file PARAMS ((const char *input_name, - char **real_file_name_p)); +extern FILE *open_po_file (const char *input_name, char **real_file_name_p); #endif /* _OPEN_PO_H */ diff --git a/src/po-charset.c b/src/po-charset.c index f3d73686d..79cfbeea7 100644 --- a/src/po-charset.c +++ b/src/po-charset.c @@ -51,8 +51,7 @@ const char *po_charset_utf8 = utf8; /* Canonicalize an encoding name. */ const char * -po_charset_canonicalize (charset) - const char *charset; +po_charset_canonicalize (const char *charset) { /* The list of charsets supported by glibc's iconv() and by the portable iconv() across platforms. Taken from intl/config.charset. */ @@ -113,8 +112,7 @@ po_charset_canonicalize (charset) /* Test for ASCII compatibility. */ bool -po_charset_ascii_compatible (canon_charset) - const char *canon_charset; +po_charset_ascii_compatible (const char *canon_charset) { /* There are only a few exceptions to ASCII compatibility. */ if (strcmp (canon_charset, "SHIFT_JIS") == 0 @@ -127,8 +125,7 @@ po_charset_ascii_compatible (canon_charset) /* Test for a weird encoding, i.e. an encoding which has double-byte characters ending in 0x5C. */ -bool po_is_charset_weird (canon_charset) - const char *canon_charset; +bool po_is_charset_weird (const char *canon_charset) { static const char *weird_charsets[] = { @@ -151,8 +148,7 @@ bool po_is_charset_weird (canon_charset) An encoding has CJK structure if every valid character stream is composed of single bytes in the range 0x{00..7F} and of byte pairs in the range 0x{80..FF}{30..FF}. */ -bool po_is_charset_weird_cjk (canon_charset) - const char *canon_charset; +bool po_is_charset_weird_cjk (const char *canon_charset) { static const char *weird_cjk_charsets[] = { /* single bytes double bytes */ @@ -194,9 +190,7 @@ po_lex_charset_init () } void -po_lex_charset_set (header_entry, filename) - const char *header_entry; - const char *filename; +po_lex_charset_set (const char *header_entry, const char *filename) { /* Verify the validity of CHARSET. It is necessary 1. for the correct treatment of multibyte characters containing diff --git a/src/po-charset.h b/src/po-charset.h index dfc7f6f05..9b03a0dfc 100644 --- a/src/po-charset.h +++ b/src/po-charset.h @@ -28,7 +28,7 @@ /* Canonicalize an encoding name. The results of this function are statically allocated and can be compared using ==. */ -extern const char *po_charset_canonicalize PARAMS ((const char *charset)); +extern const char *po_charset_canonicalize (const char *charset); /* The canonicalized encoding name for ASCII. */ extern const char *po_charset_ascii; @@ -37,17 +37,17 @@ extern const char *po_charset_ascii; extern const char *po_charset_utf8; /* Test for ASCII compatibility. */ -extern bool po_charset_ascii_compatible PARAMS ((const char *canon_charset)); +extern bool po_charset_ascii_compatible (const char *canon_charset); /* Test for a weird encoding, i.e. an encoding which has double-byte characters ending in 0x5C. */ -extern bool po_is_charset_weird PARAMS ((const char *canon_charset)); +extern bool po_is_charset_weird (const char *canon_charset); /* Test for a weird CJK encoding, i.e. a weird encoding with CJK structure. An encoding has CJK structure if every valid character stream is composed of single bytes in the range 0x{00..7F} and of byte pairs in the range 0x{80..FF}{30..FF}. */ -extern bool po_is_charset_weird_cjk PARAMS ((const char *canon_charset)); +extern bool po_is_charset_weird_cjk (const char *canon_charset); /* The PO file's encoding, as specified in the header entry. */ @@ -62,13 +62,13 @@ extern iconv_t po_lex_iconv; extern bool po_lex_weird_cjk; /* Initialize the PO file's encoding. */ -extern void po_lex_charset_init PARAMS ((void)); +extern void po_lex_charset_init (void); /* Set the PO file's encoding from the header entry. */ -extern void po_lex_charset_set PARAMS ((const char *header_entry, - const char *filename)); +extern void po_lex_charset_set (const char *header_entry, + const char *filename); /* Finish up with the PO file's encoding. */ -extern void po_lex_charset_close PARAMS ((void)); +extern void po_lex_charset_close (void); #endif /* _PO_CHARSET_H */ diff --git a/src/po-gram.h b/src/po-gram.h index 83424e80d..99c0975a4 100644 --- a/src/po-gram.h +++ b/src/po-gram.h @@ -1,5 +1,5 @@ /* GNU gettext - internationalization aids - Copyright (C) 1995 Free Software Foundation, Inc. + Copyright (C) 1995, 2002 Free Software Foundation, Inc. This file was written by Peter Miller @@ -23,6 +23,6 @@ /* Include some fundamental headers. */ #include -extern int po_gram_parse PARAMS ((void)); +extern int po_gram_parse (void); #endif diff --git a/src/po-hash-gen.y b/src/po-hash-gen.y index c27fc6717..ff611570e 100644 --- a/src/po-hash-gen.y +++ b/src/po-hash-gen.y @@ -1,5 +1,5 @@ /* GNU gettext - internationalization aids - Copyright (C) 1995, 1996, 1998, 2001 Free Software Foundation, Inc. + Copyright (C) 1995-1996, 1998, 2001-2002 Free Software Foundation, Inc. This file was written by Peter Miller @@ -112,15 +112,14 @@ static const char *cur; -void yyerror PARAMS ((char *)); -int yylex PARAMS ((void)); +void yyerror (char *); +int yylex (void); int -po_hash (s) - const char *s; +po_hash (const char *s) { - extern int yyparse PARAMS ((void)); + extern int yyparse (void); cur = s; return yyparse (); @@ -128,8 +127,7 @@ po_hash (s) void -yyerror (s) - char *s; +yyerror (char *s) { /* Do nothing, the grammar is used as a recogniser. */ } diff --git a/src/po-hash.h b/src/po-hash.h index df46618f3..98f4c2158 100644 --- a/src/po-hash.h +++ b/src/po-hash.h @@ -1,5 +1,5 @@ /* GNU gettext - internationalization aids - Copyright (C) 1995, 1996, 1998, 2001 Free Software Foundation, Inc. + Copyright (C) 1995-1996, 1998, 2001-2002 Free Software Foundation, Inc. This file was written by Peter Miller @@ -20,6 +20,6 @@ #ifndef _PO_HASH_H #define _PO_HASH_H -extern int po_hash PARAMS ((const char *string)); +extern int po_hash (const char *string); #endif /* _PO_HASH_H */ diff --git a/src/po-lex.c b/src/po-lex.c index adcb398a3..e183a3386 100644 --- a/src/po-lex.c +++ b/src/po-lex.c @@ -31,6 +31,7 @@ #include #include #include +#include #if HAVE_ICONV # include @@ -39,7 +40,6 @@ #include "c-ctype.h" #include "linebreak.h" #include "vasprintf.h" -#include "libstdarg.h" #include "gettext.h" #include "po-charset.h" #include "xmalloc.h" @@ -60,12 +60,6 @@ # define getc getc_unlocked #endif -#if HAVE_C_BACKSLASH_A -# define ALERT_CHAR '\a' -#else -# define ALERT_CHAR '\7' -#endif - /* Current position within the PO file. */ lex_pos_ty gram_pos; @@ -84,15 +78,12 @@ int gram_pos_column; /* VARARGS1 */ void -po_gram_error VA_PARAMS ((const char *fmt, ...), - (fmt, va_alist) - const char *fmt; - va_dcl) +po_gram_error (const char *fmt, ...) { va_list ap; char *buffer; - VA_START (ap, fmt); + va_start (ap, fmt); if (vasprintf (&buffer, fmt, ap) < 0) error (EXIT_FAILURE, 0, _("memory exhausted")); va_end (ap); @@ -116,16 +107,12 @@ po_gram_error VA_PARAMS ((const char *fmt, ...), /* VARARGS2 */ void -po_gram_error_at_line VA_PARAMS ((const lex_pos_ty *pp, const char *fmt, ...), - (pp, fmt, va_alist) - const lex_pos_ty *pp; - const char *fmt; - va_dcl) +po_gram_error_at_line (const lex_pos_ty *pp, const char *fmt, ...) { va_list ap; char *buffer; - VA_START (ap, fmt); + va_start (ap, fmt); if (vasprintf (&buffer, fmt, ap) < 0) error (EXIT_FAILURE, 0, _("memory exhausted")); va_end (ap); @@ -178,30 +165,9 @@ struct mbchar therefore we use an array type. */ typedef struct mbchar mbchar_t[1]; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static inline void memcpy_small PARAMS ((void *dst, const void *src, size_t n)); -static inline bool mb_iseof PARAMS ((const mbchar_t mbc)); -static inline const char *mb_ptr PARAMS ((const mbchar_t mbc)); -static inline size_t mb_len PARAMS ((const mbchar_t mbc)); -static inline bool mb_iseq PARAMS ((const mbchar_t mbc, - /*promote: char*/ int sc)); -static inline bool mb_isnul PARAMS ((const mbchar_t mbc)); -static inline int mb_cmp PARAMS ((const mbchar_t mbc1, const mbchar_t mbc2)); -static inline bool mb_equal PARAMS ((const mbchar_t mbc1, const mbchar_t mbc2)); -static inline bool mb_isascii PARAMS ((const mbchar_t mbc)); -static int mb_width PARAMS ((const mbchar_t mbc)); -static inline void mb_putc PARAMS ((const mbchar_t mbc, FILE *stream)); -static inline void mb_setascii PARAMS ((mbchar_t mbc, - /*promote: char*/ int sc)); -static inline void mb_copy PARAMS ((mbchar_t new, const mbchar_t old)); - /* A version of memcpy optimized for the case n <= 1. */ static inline void -memcpy_small (dst, src, n) - void *dst; - const void *src; - size_t n; +memcpy_small (void *dst, const void *src, size_t n) { if (n > 0) { @@ -217,22 +183,19 @@ memcpy_small (dst, src, n) /* EOF (not a real character) is represented with bytes = 0 and uc_valid = false. */ static inline bool -mb_iseof (mbc) - const mbchar_t mbc; +mb_iseof (const mbchar_t mbc) { return (mbc->bytes == 0); } /* Access the current character. */ static inline const char * -mb_ptr (mbc) - const mbchar_t mbc; +mb_ptr (const mbchar_t mbc) { return mbc->buf; } static inline size_t -mb_len (mbc) - const mbchar_t mbc; +mb_len (const mbchar_t mbc) { return mbc->bytes; } @@ -240,9 +203,7 @@ mb_len (mbc) /* Comparison of characters. */ static inline bool -mb_iseq (mbc, sc) - const mbchar_t mbc; - char sc; +mb_iseq (const mbchar_t mbc, char sc) { /* Note: It is wrong to compare only mbc->uc, because when the encoding is SHIFT_JIS, mbc->buf[0] == '\\' corresponds to mbc->uc == 0x00A5, but we @@ -257,8 +218,7 @@ mb_iseq (mbc, sc) } static inline bool -mb_isnul (mbc) - const mbchar_t mbc; +mb_isnul (const mbchar_t mbc) { #if HAVE_ICONV if (mbc->uc_valid) @@ -269,9 +229,7 @@ mb_isnul (mbc) } static inline int -mb_cmp (mbc1, mbc2) - const mbchar_t mbc1; - const mbchar_t mbc2; +mb_cmp (const mbchar_t mbc1, const mbchar_t mbc2) { #if HAVE_ICONV if (mbc1->uc_valid && mbc2->uc_valid) @@ -286,9 +244,7 @@ mb_cmp (mbc1, mbc2) } static inline bool -mb_equal (mbc1, mbc2) - const mbchar_t mbc1; - const mbchar_t mbc2; +mb_equal (const mbchar_t mbc1, const mbchar_t mbc2) { #if HAVE_ICONV if (mbc1->uc_valid && mbc2->uc_valid) @@ -302,8 +258,7 @@ mb_equal (mbc1, mbc2) /* , classification. */ static inline bool -mb_isascii (mbc) - const mbchar_t mbc; +mb_isascii (const mbchar_t mbc) { #if HAVE_ICONV if (mbc->uc_valid) @@ -326,8 +281,7 @@ mb_isascii (mbc) #define MB_UNPRINTABLE_WIDTH 1 static int -mb_width (mbc) - const mbchar_t mbc; +mb_width (const mbchar_t mbc) { #if HAVE_ICONV if (mbc->uc_valid) @@ -370,18 +324,14 @@ mb_width (mbc) /* Output. */ static inline void -mb_putc (mbc, stream) - const mbchar_t mbc; - FILE *stream; +mb_putc (const mbchar_t mbc, FILE *stream) { fwrite (mbc->buf, 1, mbc->bytes, stream); } /* Assignment. */ static inline void -mb_setascii (mbc, sc) - mbchar_t mbc; - char sc; +mb_setascii (mbchar_t mbc, char sc) { mbc->bytes = 1; #if HAVE_ICONV @@ -393,9 +343,7 @@ mb_setascii (mbc, sc) /* Copying a character. */ static inline void -mb_copy (new, old) - mbchar_t new; - const mbchar_t old; +mb_copy (mbchar_t new, const mbchar_t old) { memcpy_small (&new->buf[0], &old->buf[0], old->bytes); new->bytes = old->bytes; @@ -431,16 +379,8 @@ typedef struct mbfile mbfile_t[1]; or silently tolerated. */ static bool signal_eilseq; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static inline void mbfile_init PARAMS ((mbfile_t mbf, FILE *stream)); -static void mbfile_getc PARAMS ((mbchar_t mbc, mbfile_t mbf)); -static void mbfile_ungetc PARAMS ((const mbchar_t mbc, mbfile_t mbf)); - static inline void -mbfile_init (mbf, stream) - mbfile_t mbf; - FILE *stream; +mbfile_init (mbfile_t mbf, FILE *stream) { mbf->fp = stream; mbf->eof_seen = false; @@ -449,9 +389,7 @@ mbfile_init (mbf, stream) } static void -mbfile_getc (mbc, mbf) - mbchar_t mbc; - mbfile_t mbf; +mbfile_getc (mbchar_t mbc, mbfile_t mbf) { size_t bytes; @@ -642,9 +580,7 @@ eof: } static void -mbfile_ungetc (mbc, mbf) - const mbchar_t mbc; - mbfile_t mbf; +mbfile_ungetc (const mbchar_t mbc, mbfile_t mbf) { if (mbf->have_pushback >= NPUSHBACK) abort (); @@ -662,20 +598,9 @@ static bool pass_comments = false; bool pass_obsolete_entries = false; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static void lex_getc PARAMS ((mbchar_t mbc)); -static void lex_ungetc PARAMS ((const mbchar_t mbc)); -static int keyword_p PARAMS ((const char *s)); -static int control_sequence PARAMS ((void)); - - /* Prepare lexical analysis. */ void -lex_start (fp, real_filename, logical_filename) - FILE *fp; - const char *real_filename; - const char *logical_filename; +lex_start (FILE *fp, const char *real_filename, const char *logical_filename) { /* Ignore the logical_filename, because PO file entries already have their file names attached. But use real_filename for error messages. */ @@ -718,8 +643,7 @@ lex_end () /* Open the PO file FNAME and prepare its lexical analysis. */ void -lex_open (fname) - const char *fname; +lex_open (const char *fname) { char *real_filename; FILE *fp = open_po_file (fname, &real_filename); @@ -746,8 +670,7 @@ lex_close () /* Read a single character, dealing with backslash-newline. Also keep track of the current line number and column number. */ static void -lex_getc (mbc) - mbchar_t mbc; +lex_getc (mbchar_t mbc) { for (;;) { @@ -793,8 +716,7 @@ lex_getc (mbc) static void -lex_ungetc (mbc) - const mbchar_t mbc; +lex_ungetc (const mbchar_t mbc) { if (!mb_iseof (mbc)) { @@ -811,8 +733,7 @@ lex_ungetc (mbc) static int -keyword_p (s) - const char *s; +keyword_p (const char *s) { if (!strcmp (s, "domain")) return DOMAIN; @@ -857,7 +778,7 @@ control_sequence () return '\v'; case 'a': - return ALERT_CHAR; + return '\a'; case '\\': case '"': @@ -1192,8 +1113,7 @@ po_gram_lex () /* po_gram_lex() can return comments as COMMENT. Switch this on or off. */ void -po_lex_pass_comments (flag) - bool flag; +po_lex_pass_comments (bool flag) { pass_comments = flag; } @@ -1202,8 +1122,7 @@ po_lex_pass_comments (flag) /* po_gram_lex() can return obsolete entries as if they were normal entries. Switch this on or off. */ void -po_lex_pass_obsolete_entries (flag) - bool flag; +po_lex_pass_obsolete_entries (bool flag) { pass_obsolete_entries = flag; } diff --git a/src/po-lex.h b/src/po-lex.h index f984b3d73..002a481f3 100644 --- a/src/po-lex.h +++ b/src/po-lex.h @@ -46,28 +46,28 @@ extern bool pass_obsolete_entries; /* Prepare lexical analysis. */ -extern void lex_start PARAMS ((FILE *fp, const char *real_filename, - const char *logical_filename)); +extern void lex_start (FILE *fp, const char *real_filename, + const char *logical_filename); /* Terminate lexical analysis. */ -extern FILE *lex_end PARAMS ((void)); +extern FILE *lex_end (void); /* Open the PO file FNAME and prepare its lexical analysis. */ -extern void lex_open PARAMS ((const char *fname)); +extern void lex_open (const char *fname); /* Terminate lexical analysis and close the current PO file. */ -extern void lex_close PARAMS ((void)); +extern void lex_close (void); /* Return the next token in the PO file. The return codes are defined in "po-gram-gen2.h". Associated data is put in 'po_gram_lval. */ -extern int po_gram_lex PARAMS ((void)); +extern int po_gram_lex (void); /* po_gram_lex() can return comments as COMMENT. Switch this on or off. */ -extern void po_lex_pass_comments PARAMS ((bool flag)); +extern void po_lex_pass_comments (bool flag); /* po_gram_lex() can return obsolete entries as if they were normal entries. Switch this on or off. */ -extern void po_lex_pass_obsolete_entries PARAMS ((bool flag)); +extern void po_lex_pass_obsolete_entries (bool flag); /* ISO C 99 is smart enough to allow optimizations like this. */ @@ -142,9 +142,8 @@ extern void po_lex_pass_obsolete_entries PARAMS ((bool flag)); } while (0) #else -extern void po_gram_error PARAMS ((const char *fmt, ...)); -extern void po_gram_error_at_line PARAMS ((const lex_pos_ty *pos, - const char *fmt, ...)); +extern void po_gram_error (const char *fmt, ...); +extern void po_gram_error_at_line (const lex_pos_ty *pos, const char *fmt, ...); #endif diff --git a/src/po-time.c b/src/po-time.c index 75b680db3..6583395e4 100644 --- a/src/po-time.c +++ b/src/po-time.c @@ -1,5 +1,5 @@ /* PO/POT file timestamps. - Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc. Written by Ulrich Drepper , April 1995. This program is free software; you can redistribute it and/or modify @@ -26,18 +26,11 @@ #include "xerror.h" -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static long difftm PARAMS ((const struct tm *a, const struct tm *b)); - - #define TM_YEAR_ORIGIN 1900 /* Yield A - B, measured in seconds. */ static long -difftm (a, b) - const struct tm *a; - const struct tm *b; +difftm (const struct tm *a, const struct tm *b) { int ay = a->tm_year + TM_YEAR_ORIGIN - 1; int by = b->tm_year + TM_YEAR_ORIGIN - 1; @@ -59,8 +52,7 @@ difftm (a, b) char * -po_strftime (tp) - const time_t *tp; +po_strftime (const time_t *tp) { struct tm local_time; char tz_sign; diff --git a/src/po-time.h b/src/po-time.h index 3a81c1e32..941309a12 100644 --- a/src/po-time.h +++ b/src/po-time.h @@ -1,5 +1,5 @@ /* PO/POT file timestamps. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -23,6 +23,6 @@ /* Return a freshly allocated string containing the given time in the format YYYY-MM-DD HH:MM+TZOFF. */ -extern char *po_strftime PARAMS ((const time_t *tp)); +extern char *po_strftime (const time_t *tp); #endif /* _PO_TIME_H */ diff --git a/src/po.c b/src/po.c index 26a4bbf81..20caa306b 100644 --- a/src/po.c +++ b/src/po.c @@ -1,5 +1,5 @@ /* GNU gettext - internationalization aids - Copyright (C) 1995-1996, 1998, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1995-1996, 1998, 2000-2002 Free Software Foundation, Inc. This file was written by Peter Miller @@ -29,35 +29,16 @@ #include #include "po-charset.h" +#include "po-gram.h" #include "po-hash.h" #include "xmalloc.h" -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static void po_parse_brief PARAMS ((po_ty *pop)); -static void po_parse_debrief PARAMS ((po_ty *pop)); - -/* Methods used indirectly by po_scan. */ -static void po_directive_domain PARAMS ((po_ty *pop, char *name)); -static void po_directive_message PARAMS ((po_ty *pop, char *msgid, - lex_pos_ty *msgid_pos, - char *msgid_plural, - char *msgstr, size_t msgstr_len, - lex_pos_ty *msgstr_pos, - bool obsolete)); -static void po_comment PARAMS ((po_ty *pop, const char *s)); -static void po_comment_dot PARAMS ((po_ty *pop, const char *s)); -static void po_comment_filepos PARAMS ((po_ty *pop, const char *name, - size_t line)); -static void po_comment_special PARAMS ((po_ty *pop, const char *s)); - /* Local variables. */ static po_ty *callback_arg; po_ty * -po_alloc (pomp) - po_method_ty *pomp; +po_alloc (po_method_ty *pomp) { po_ty *pop; @@ -70,8 +51,7 @@ po_alloc (pomp) void -po_free (pop) - po_ty *pop; +po_free (po_ty *pop) { if (pop->method->destructor) pop->method->destructor (pop); @@ -79,15 +59,26 @@ po_free (pop) } -void -po_scan (pop, fp, real_filename, logical_filename) - po_ty *pop; - FILE *fp; - const char *real_filename; - const char *logical_filename; +static void +po_parse_brief (po_ty *pop) +{ + if (pop->method->parse_brief) + pop->method->parse_brief (pop); +} + + +static void +po_parse_debrief (po_ty *pop) { - extern int po_gram_parse PARAMS ((void)); + if (pop->method->parse_debrief) + pop->method->parse_debrief (pop); +} + +void +po_scan (po_ty *pop, FILE *fp, + const char *real_filename, const char *logical_filename) +{ /* The parse will call the po_callback_... functions (see below) when the various directive are recognised. The callback_arg variable is used to tell these functions which instance is to @@ -105,12 +96,8 @@ po_scan (pop, fp, real_filename, logical_filename) void -po_scan_file (pop, filename) - po_ty *pop; - const char *filename; +po_scan_file (po_ty *pop, const char *filename) { - extern int po_gram_parse PARAMS ((void)); - /* The parse will call the po_callback_... functions (see below) when the various directive are recognised. The callback_arg variable is used to tell these functions which instance is to @@ -128,27 +115,7 @@ po_scan_file (pop, filename) static void -po_parse_brief (pop) - po_ty *pop; -{ - if (pop->method->parse_brief) - pop->method->parse_brief (pop); -} - - -static void -po_parse_debrief (pop) - po_ty *pop; -{ - if (pop->method->parse_debrief) - pop->method->parse_debrief (pop); -} - - -static void -po_directive_domain (pop, name) - po_ty *pop; - char *name; +po_directive_domain (po_ty *pop, char *name) { if (pop->method->directive_domain) pop->method->directive_domain (pop, name); @@ -156,8 +123,7 @@ po_directive_domain (pop, name) void -po_callback_domain (name) - char *name; +po_callback_domain (char *name) { /* assert(callback_arg); */ po_directive_domain (callback_arg, name); @@ -165,16 +131,13 @@ po_callback_domain (name) static void -po_directive_message (pop, msgid, msgid_pos, msgid_plural, - msgstr, msgstr_len, msgstr_pos, obsolete) - po_ty *pop; - char *msgid; - lex_pos_ty *msgid_pos; - char *msgid_plural; - char *msgstr; - size_t msgstr_len; - lex_pos_ty *msgstr_pos; - bool obsolete; +po_directive_message (po_ty *pop, + char *msgid, + lex_pos_ty *msgid_pos, + char *msgid_plural, + char *msgstr, size_t msgstr_len, + lex_pos_ty *msgstr_pos, + bool obsolete) { if (pop->method->directive_message) pop->method->directive_message (pop, msgid, msgid_pos, msgid_plural, @@ -183,16 +146,9 @@ po_directive_message (pop, msgid, msgid_pos, msgid_plural, void -po_callback_message (msgid, msgid_pos, msgid_plural, - msgstr, msgstr_len, msgstr_pos, - obsolete) - char *msgid; - lex_pos_ty *msgid_pos; - char *msgid_plural; - char *msgstr; - size_t msgstr_len; - lex_pos_ty *msgstr_pos; - bool obsolete; +po_callback_message (char *msgid, lex_pos_ty *msgid_pos, char *msgid_plural, + char *msgstr, size_t msgstr_len, lex_pos_ty *msgstr_pos, + bool obsolete) { /* assert(callback_arg); */ @@ -206,9 +162,7 @@ po_callback_message (msgid, msgid_pos, msgid_plural, static void -po_comment_special (pop, s) - po_ty *pop; - const char *s; +po_comment_special (po_ty *pop, const char *s) { if (pop->method->comment_special != NULL) pop->method->comment_special (pop, s); @@ -216,9 +170,7 @@ po_comment_special (pop, s) static void -po_comment (pop, s) - po_ty *pop; - const char *s; +po_comment (po_ty *pop, const char *s) { if (pop->method->comment != NULL) pop->method->comment (pop, s); @@ -226,9 +178,7 @@ po_comment (pop, s) static void -po_comment_dot (pop, s) - po_ty *pop; - const char *s; +po_comment_dot (po_ty *pop, const char *s) { if (pop->method->comment_dot != NULL) pop->method->comment_dot (pop, s); @@ -239,8 +189,7 @@ po_comment_dot (pop, s) seen. It analyzes the comment to see what sort it is, and then dispatces it to the appropriate method. */ void -po_callback_comment (s) - const char *s; +po_callback_comment (const char *s) { /* assert(callback_arg); */ if (*s == '.') @@ -279,10 +228,7 @@ po_callback_comment (s) static void -po_comment_filepos (pop, name, line) - po_ty *pop; - const char *name; - size_t line; +po_comment_filepos (po_ty *pop, const char *name, size_t line) { if (pop->method->comment_filepos) pop->method->comment_filepos (pop, name, line); @@ -290,9 +236,7 @@ po_comment_filepos (pop, name, line) void -po_callback_comment_filepos (name, line) - const char *name; - size_t line; +po_callback_comment_filepos (const char *name, size_t line) { /* assert(callback_arg); */ po_comment_filepos (callback_arg, name, line); @@ -301,11 +245,9 @@ po_callback_comment_filepos (name, line) /* Parse a special comment and put the result in *fuzzyp, formatp, *wrapp. */ void -po_parse_comment_special (s, fuzzyp, formatp, wrapp) - const char *s; - bool *fuzzyp; - enum is_format formatp[NFORMATS]; - enum is_wrap *wrapp; +po_parse_comment_special (const char *s, + bool *fuzzyp, enum is_format formatp[NFORMATS], + enum is_wrap *wrapp) { size_t i; diff --git a/src/po.h b/src/po.h index f1b3c3a92..a088ff01a 100644 --- a/src/po.h +++ b/src/po.h @@ -1,5 +1,5 @@ /* GNU gettext - internationalization aids - Copyright (C) 1995, 1996, 1998, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1995-1996, 1998, 2000-2002 Free Software Foundation, Inc. This file was written by Peter Miller @@ -49,54 +49,53 @@ struct po_method_ty size_t size; /* what to do immediately after the instance is malloc()ed */ - void (*constructor) PARAMS ((struct po_ty *pop)); + void (*constructor) (struct po_ty *pop); /* what to do immediately before the instance is free()ed */ - void (*destructor) PARAMS ((struct po_ty *pop)); + void (*destructor) (struct po_ty *pop); /* what to do with a domain directive */ - void (*directive_domain) PARAMS ((struct po_ty *pop, char *name)); + void (*directive_domain) (struct po_ty *pop, char *name); /* what to do with a message directive */ - void (*directive_message) PARAMS ((struct po_ty *pop, - char *msgid, lex_pos_ty *msgid_pos, - char *msgid_plural, - char *msgstr, size_t msgstr_len, - lex_pos_ty *msgstr_pos, - bool obsolete)); + void (*directive_message) (struct po_ty *pop, + char *msgid, lex_pos_ty *msgid_pos, + char *msgid_plural, + char *msgstr, size_t msgstr_len, + lex_pos_ty *msgstr_pos, + bool obsolete); /* This method is invoked before the parse, but after the file is opened by the lexer. */ - void (*parse_brief) PARAMS ((struct po_ty *pop)); + void (*parse_brief) (struct po_ty *pop); /* This method is invoked after the parse, but before the file is closed by the lexer. The intention is to make consistency checks against the file here, and emit the errors through the lex_error* functions. */ - void (*parse_debrief) PARAMS ((struct po_ty *pop)); + void (*parse_debrief) (struct po_ty *pop); /* What to do with a plain-vanilla comment - the expectation is that they will be accumulated, and added to the next message definition seen. Or completely ignored. */ - void (*comment) PARAMS ((struct po_ty *pop, const char *s)); + void (*comment) (struct po_ty *pop, const char *s); /* What to do with a comment that starts with a dot (i.e. extracted by xgettext) - the expectation is that they will be accumulated, and added to the next message definition seen. Or completely ignored. */ - void (*comment_dot) PARAMS ((struct po_ty *pop, const char *s)); + void (*comment_dot) (struct po_ty *pop, const char *s); /* What to do with a file position seen in a comment (i.e. a message location comment extracted by xgettext) - the expectation is that they will be accumulated, and added to the next message definition seen. Or completely ignored. */ - void (*comment_filepos) PARAMS ((struct po_ty *pop, const char *s, - size_t line)); + void (*comment_filepos) (struct po_ty *pop, const char *s, size_t line); /* What to do with a comment that starts with a `!' - this is a special comment. One of the possible uses is to indicate a inexact translation. */ - void (*comment_special) PARAMS ((struct po_ty *pop, const char *s)); + void (*comment_special) (struct po_ty *pop, const char *s); }; @@ -121,37 +120,37 @@ struct po_ty /* Allocate a fresh po_ty (or derived class) instance and call its constructor. */ -extern po_ty *po_alloc PARAMS ((po_method_ty *jtable)); +extern po_ty *po_alloc (po_method_ty *jtable); /* Read a PO file from a stream, and dispatch to the various po_method_ty methods. */ -extern void po_scan PARAMS ((po_ty *pop, FILE *fp, const char *real_filename, - const char *logical_filename)); +extern void po_scan (po_ty *pop, FILE *fp, const char *real_filename, + const char *logical_filename); /* Locate a PO file, open it, read it, dispatching to the various po_method_ty methods, and close it. */ -extern void po_scan_file PARAMS ((po_ty *pop, const char *filename)); +extern void po_scan_file (po_ty *pop, const char *filename); /* Call the destructor and deallocate a po_ty (or derived class) instance. */ -extern void po_free PARAMS ((po_ty *pop)); +extern void po_free (po_ty *pop); /* Callbacks used by po-gram.y or po-hash.y or po-lex.c, indirectly from po_scan. */ -extern void po_callback_domain PARAMS ((char *name)); -extern void po_callback_message PARAMS ((char *msgid, lex_pos_ty *msgid_pos, - char *msgid_plural, - char *msgstr, size_t msgstr_len, - lex_pos_ty *msgstr_pos, - bool obsolete)); -extern void po_callback_comment PARAMS ((const char *s)); -extern void po_callback_comment_dot PARAMS ((const char *s)); -extern void po_callback_comment_filepos PARAMS ((const char *s, size_t line)); +extern void po_callback_domain (char *name); +extern void po_callback_message (char *msgid, lex_pos_ty *msgid_pos, + char *msgid_plural, + char *msgstr, size_t msgstr_len, + lex_pos_ty *msgstr_pos, + bool obsolete); +extern void po_callback_comment (const char *s); +extern void po_callback_comment_dot (const char *s); +extern void po_callback_comment_filepos (const char *s, size_t line); /* Parse a special comment and put the result in *fuzzyp, formatp, *wrapp. */ -extern void po_parse_comment_special PARAMS ((const char *s, bool *fuzzyp, - enum is_format formatp[NFORMATS], - enum is_wrap *wrapp)); +extern void po_parse_comment_special (const char *s, bool *fuzzyp, + enum is_format formatp[NFORMATS], + enum is_wrap *wrapp); #endif /* _PO_H */ diff --git a/src/read-java.c b/src/read-java.c index 3528bec60..b9f376eb5 100644 --- a/src/read-java.c +++ b/src/read-java.c @@ -40,14 +40,6 @@ #define _(str) gettext (str) -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static bool execute_and_read_po_output PARAMS ((const char *progname, - const char *prog_path, - char **prog_argv, - void *private_data)); - - /* A Java resource name can only be manipulated by a Java virtual machine. So we start a JVM to execute the DumpResource program, and read its output, which is .po format without comments. */ @@ -59,11 +51,9 @@ struct locals }; static bool -execute_and_read_po_output (progname, prog_path, prog_argv, private_data) - const char *progname; - const char *prog_path; - char **prog_argv; - void *private_data; +execute_and_read_po_output (const char *progname, + const char *prog_path, char **prog_argv, + void *private_data) { struct locals *l = (struct locals *) private_data; pid_t child; @@ -95,9 +85,7 @@ execute_and_read_po_output (progname, prog_path, prog_argv, private_data) msgdomain_list_ty * -msgdomain_read_java (resource_name, locale_name) - const char *resource_name; - const char *locale_name; +msgdomain_read_java (const char *resource_name, const char *locale_name) { const char *class_name = "gnu.gettext.DumpResource"; const char *gettextjexedir; diff --git a/src/read-java.h b/src/read-java.h index 9b9e079a8..62559bb92 100644 --- a/src/read-java.h +++ b/src/read-java.h @@ -1,5 +1,5 @@ /* Reading Java ResourceBundles. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -24,7 +24,7 @@ /* Read the Java resource given by resource_name and locale_name. Returns a list of messages. */ extern msgdomain_list_ty * - msgdomain_read_java PARAMS ((const char *resource_name, - const char *locale_name)); + msgdomain_read_java (const char *resource_name, + const char *locale_name); #endif /* _READ_JAVA_H */ diff --git a/src/read-mo.c b/src/read-mo.c index 998e7e0ed..e6fc2d1d1 100644 --- a/src/read-mo.c +++ b/src/read-mo.c @@ -52,26 +52,10 @@ struct binary_mo_file }; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static void read_binary_mo_file PARAMS ((struct binary_mo_file *bfp, - FILE *fp, const char *filename)); -static nls_uint32 get_uint32 PARAMS ((const struct binary_mo_file *bfp, - size_t offset)); -static char * get_string PARAMS ((const struct binary_mo_file *bfp, - size_t offset, size_t *lengthp)); -static char * get_sysdep_string PARAMS ((const struct binary_mo_file *bfp, - size_t offset, - const struct mo_file_header *header, - size_t *lengthp)); - - /* Read the contents of the given input stream. */ static void -read_binary_mo_file (bfp, fp, filename) - struct binary_mo_file *bfp; - FILE *fp; - const char *filename; +read_binary_mo_file (struct binary_mo_file *bfp, + FILE *fp, const char *filename) { char *buf = NULL; size_t alloc = 0; @@ -106,9 +90,7 @@ read_binary_mo_file (bfp, fp, filename) /* Get a 32-bit number from the file, at the given file position. */ static nls_uint32 -get_uint32 (bfp, offset) - const struct binary_mo_file *bfp; - size_t offset; +get_uint32 (const struct binary_mo_file *bfp, size_t offset) { nls_uint32 b0, b1, b2, b3; @@ -127,10 +109,7 @@ get_uint32 (bfp, offset) /* Get a static string from the file, at the given file position. */ static char * -get_string (bfp, offset, lengthp) - const struct binary_mo_file *bfp; - size_t offset; - size_t *lengthp; +get_string (const struct binary_mo_file *bfp, size_t offset, size_t *lengthp) { /* See 'struct string_desc'. */ nls_uint32 s_length = get_uint32 (bfp, offset); @@ -149,11 +128,8 @@ get_string (bfp, offset, lengthp) /* Get a system dependent string from the file, at the given file position. */ static char * -get_sysdep_string (bfp, offset, header, lengthp) - const struct binary_mo_file *bfp; - size_t offset; - const struct mo_file_header *header; - size_t *lengthp; +get_sysdep_string (const struct binary_mo_file *bfp, size_t offset, + const struct mo_file_header *header, size_t *lengthp) { /* See 'struct sysdep_string'. */ size_t length; @@ -244,9 +220,7 @@ get_sysdep_string (bfp, offset, header, lengthp) /* Reads an existing .mo file and adds the messages to mlp. */ void -read_mo_file (mlp, fn) - message_list_ty *mlp; - const char *fn; +read_mo_file (message_list_ty *mlp, const char *fn) { FILE *fp; struct binary_mo_file bf; diff --git a/src/read-mo.h b/src/read-mo.h index de732862a..88e969939 100644 --- a/src/read-mo.h +++ b/src/read-mo.h @@ -1,5 +1,5 @@ /* Reading binary .mo files. - Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc. Written by Ulrich Drepper , April 1995. This program is free software; you can redistribute it and/or modify @@ -22,6 +22,6 @@ #include "message.h" /* Reads an existing .mo file and adds the messages to mlp. */ -extern void read_mo_file PARAMS ((message_list_ty *mlp, const char *fn)); +extern void read_mo_file (message_list_ty *mlp, const char *fn); #endif /* _READ_MO_H */ diff --git a/src/read-po.c b/src/read-po.c index 75215f17f..772f87629 100644 --- a/src/read-po.c +++ b/src/read-po.c @@ -1,5 +1,5 @@ /* Reading PO files. - Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc. This file was written by Peter Miller This program is free software; you can redistribute it and/or modify @@ -76,29 +76,9 @@ struct readall_class_ty }; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static void readall_constructor PARAMS ((po_ty *that)); -static void readall_destructor PARAMS ((po_ty *that)); -static void readall_directive_domain PARAMS ((po_ty *that, char *name)); -static void readall_directive_message PARAMS ((po_ty *that, char *msgid, - lex_pos_ty *msgid_pos, - char *msgid_plural, - char *msgstr, size_t msgstr_len, - lex_pos_ty *msgstr_pos, - bool obsolete)); -static void readall_parse_brief PARAMS ((po_ty *that)); -static void readall_comment PARAMS ((po_ty *that, const char *s)); -static void readall_comment_dot PARAMS ((po_ty *that, const char *s)); -static void readall_comment_special PARAMS ((po_ty *that, const char *s)); -static void readall_comment_filepos PARAMS ((po_ty *that, const char *name, - size_t line)); - - /* Prepare for first message. */ static void -readall_constructor (that) - po_ty *that; +readall_constructor (po_ty *that) { readall_class_ty *this = (readall_class_ty *) that; size_t i; @@ -118,8 +98,7 @@ readall_constructor (that) static void -readall_destructor (that) - po_ty *that; +readall_destructor (po_ty *that) { readall_class_ty *this = (readall_class_ty *) that; size_t j; @@ -138,9 +117,7 @@ readall_destructor (that) /* Process 'domain' directive from .po file. */ static void -readall_directive_domain (that, name) - po_ty *that; - char *name; +readall_directive_domain (po_ty *that, char *name) { size_t j; @@ -172,16 +149,13 @@ readall_directive_domain (that, name) /* Process 'msgid'/'msgstr' pair from .po file. */ static void -readall_directive_message (that, msgid, msgid_pos, msgid_plural, - msgstr, msgstr_len, msgstr_pos, obsolete) - po_ty *that; - char *msgid; - lex_pos_ty *msgid_pos; - char *msgid_plural; - char *msgstr; - size_t msgstr_len; - lex_pos_ty *msgstr_pos; - bool obsolete; +readall_directive_message (po_ty *that, + char *msgid, + lex_pos_ty *msgid_pos, + char *msgid_plural, + char *msgstr, size_t msgstr_len, + lex_pos_ty *msgstr_pos, + bool obsolete) { readall_class_ty *this = (readall_class_ty *) that; message_ty *mp; @@ -253,17 +227,14 @@ readall_directive_message (that, msgid, msgid_pos, msgid_plural, static void -readall_parse_brief (that) - po_ty *that; +readall_parse_brief (po_ty *that) { po_lex_pass_comments (true); } static void -readall_comment (that, s) - po_ty *that; - const char *s; +readall_comment (po_ty *that, const char *s) { readall_class_ty *this = (readall_class_ty *) that; @@ -274,9 +245,7 @@ readall_comment (that, s) static void -readall_comment_dot (that, s) - po_ty *that; - const char *s; +readall_comment_dot (po_ty *that, const char *s) { readall_class_ty *this = (readall_class_ty *) that; @@ -288,9 +257,7 @@ readall_comment_dot (that, s) /* Test for '#, fuzzy' comments and warn. */ static void -readall_comment_special (that, s) - po_ty *that; - const char *s; +readall_comment_special (po_ty *that, const char *s) { readall_class_ty *this = (readall_class_ty *) that; @@ -300,10 +267,7 @@ readall_comment_special (that, s) static void -readall_comment_filepos (that, name, line) - po_ty *that; - const char *name; - size_t line; +readall_comment_filepos (po_ty *that, const char *name, size_t line) { readall_class_ty *this = (readall_class_ty *) that; size_t nbytes; @@ -342,10 +306,7 @@ static po_method_ty readall_methods = msgdomain_list_ty * -read_po (fp, real_filename, logical_filename) - FILE *fp; - const char *real_filename; - const char *logical_filename; +read_po (FILE *fp, const char *real_filename, const char *logical_filename) { po_ty *pop; msgdomain_list_ty *mdlp; @@ -360,8 +321,7 @@ read_po (fp, real_filename, logical_filename) msgdomain_list_ty * -read_po_file (filename) - const char *filename; +read_po_file (const char *filename) { po_ty *pop; msgdomain_list_ty *mdlp; diff --git a/src/read-po.h b/src/read-po.h index 455f957a2..a75f817a9 100644 --- a/src/read-po.h +++ b/src/read-po.h @@ -1,5 +1,5 @@ /* Reading PO files. - Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc. This file was written by Bruno Haible . This program is free software; you can redistribute it and/or modify @@ -34,13 +34,13 @@ extern int line_comment; extern bool allow_duplicates; /* Read the input file from a stream. Returns a list of messages. */ -extern msgdomain_list_ty *read_po PARAMS ((FILE *fp, const char *real_filename, - const char *logical_filename)); +extern msgdomain_list_ty *read_po (FILE *fp, const char *real_filename, + const char *logical_filename); /* Read the input file with the name INPUT_NAME. The ending .po is added if necessary. If INPUT_NAME is not an absolute file name and the file is not found, the list of directories in "dir-list.h" is searched. Returns a list of messages. */ -extern msgdomain_list_ty *read_po_file PARAMS ((const char *input_name)); +extern msgdomain_list_ty *read_po_file (const char *input_name); #endif /* _READ_PO_H */ diff --git a/src/read-tcl.c b/src/read-tcl.c index 49c0aed05..c312ef9ff 100644 --- a/src/read-tcl.c +++ b/src/read-tcl.c @@ -46,9 +46,7 @@ the msgid/msgstr pair to us, instead of storing it in the hash table. */ msgdomain_list_ty * -msgdomain_read_tcl (locale_name, directory) - const char *locale_name; - const char *directory; +msgdomain_read_tcl (const char *locale_name, const char *directory) { const char *gettextdatadir; char *tclscript; diff --git a/src/read-tcl.h b/src/read-tcl.h index 5ffcfaf11..e20722d95 100644 --- a/src/read-tcl.h +++ b/src/read-tcl.h @@ -24,7 +24,6 @@ /* Read the Tcl msg file given by locale_name and directory. Returns a list of messages. */ extern msgdomain_list_ty * - msgdomain_read_tcl PARAMS ((const char *locale_name, - const char *directory)); + msgdomain_read_tcl (const char *locale_name, const char *directory); #endif /* _READ_TCL_H */ diff --git a/src/str-list.c b/src/str-list.c index 887ebc121..71c221165 100644 --- a/src/str-list.c +++ b/src/str-list.c @@ -1,5 +1,5 @@ /* GNU gettext - internationalization aids - Copyright (C) 1995, 1998, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1995, 1998, 2000-2002 Free Software Foundation, Inc. This file was written by Peter Miller @@ -33,8 +33,7 @@ /* Initialize an empty list of strings. */ void -string_list_init (slp) - string_list_ty *slp; +string_list_init (string_list_ty *slp) { slp->item = NULL; slp->nitems = 0; @@ -59,9 +58,7 @@ string_list_alloc () /* Append a single string to the end of a list of strings. */ void -string_list_append (slp, s) - string_list_ty *slp; - const char *s; +string_list_append (string_list_ty *slp, const char *s) { /* Grow the list. */ if (slp->nitems >= slp->nitems_max) @@ -81,9 +78,7 @@ string_list_append (slp, s) /* Append a single string to the end of a list of strings, unless it is already contained in the list. */ void -string_list_append_unique (slp, s) - string_list_ty *slp; - const char *s; +string_list_append_unique (string_list_ty *slp, const char *s) { size_t j; @@ -108,8 +103,7 @@ string_list_append_unique (slp, s) /* Destroy a list of strings. */ void -string_list_destroy (slp) - string_list_ty *slp; +string_list_destroy (string_list_ty *slp) { size_t j; @@ -122,8 +116,7 @@ string_list_destroy (slp) /* Free a list of strings. */ void -string_list_free (slp) - string_list_ty *slp; +string_list_free (string_list_ty *slp) { size_t j; @@ -138,8 +131,7 @@ string_list_free (slp) /* Return a freshly allocated string obtained by concatenating all the strings in the list. */ char * -string_list_concat (slp) - const string_list_ty *slp; +string_list_concat (const string_list_ty *slp) { size_t len; size_t j; @@ -165,8 +157,7 @@ string_list_concat (slp) /* Return a freshly allocated string obtained by concatenating all the strings in the list, and destroy the list. */ char * -string_list_concat_destroy (slp) - string_list_ty *slp; +string_list_concat_destroy (string_list_ty *slp) { char *result; @@ -188,8 +179,7 @@ string_list_concat_destroy (slp) /* Return a freshly allocated string obtained by concatenating all the strings in the list, separated by spaces. */ char * -string_list_join (slp) - const string_list_ty *slp; +string_list_join (const string_list_ty *slp) { size_t len; size_t j; @@ -220,9 +210,7 @@ string_list_join (slp) /* Return 1 if s is contained in the list of strings, 0 otherwise. */ bool -string_list_member (slp, s) - const string_list_ty *slp; - const char *s; +string_list_member (const string_list_ty *slp, const char *s) { size_t j; diff --git a/src/str-list.h b/src/str-list.h index de6062c95..4414d510c 100644 --- a/src/str-list.h +++ b/src/str-list.h @@ -1,5 +1,5 @@ /* GNU gettext - internationalization aids - Copyright (C) 1995, 1996, 1998, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1995-1996, 1998, 2000-2002 Free Software Foundation, Inc. This file was written by Peter Miller @@ -37,39 +37,37 @@ struct string_list_ty }; /* Initialize an empty list of strings. */ -extern void string_list_init PARAMS ((string_list_ty *slp)); +extern void string_list_init (string_list_ty *slp); /* Return a fresh, empty list of strings. */ -extern string_list_ty *string_list_alloc PARAMS ((void)); +extern string_list_ty *string_list_alloc (void); /* Append a single string to the end of a list of strings. */ -extern void string_list_append PARAMS ((string_list_ty *slp, const char *s)); +extern void string_list_append (string_list_ty *slp, const char *s); /* Append a single string to the end of a list of strings, unless it is already contained in the list. */ -extern void string_list_append_unique PARAMS ((string_list_ty *slp, - const char *s)); +extern void string_list_append_unique (string_list_ty *slp, const char *s); /* Destroy a list of strings. */ -extern void string_list_destroy PARAMS ((string_list_ty *slp)); +extern void string_list_destroy (string_list_ty *slp); /* Free a list of strings. */ -extern void string_list_free PARAMS ((string_list_ty *slp)); +extern void string_list_free (string_list_ty *slp); /* Return a freshly allocated string obtained by concatenating all the strings in the list. */ -extern char *string_list_concat PARAMS ((const string_list_ty *slp)); +extern char *string_list_concat (const string_list_ty *slp); /* Return a freshly allocated string obtained by concatenating all the strings in the list, and destroy the list. */ -extern char *string_list_concat_destroy PARAMS ((string_list_ty *slp)); +extern char *string_list_concat_destroy (string_list_ty *slp); /* Return a freshly allocated string obtained by concatenating all the strings in the list, separated by spaces. */ -extern char *string_list_join PARAMS ((const string_list_ty *slp)); +extern char *string_list_join (const string_list_ty *slp); /* Return 1 if s is contained in the list of strings, 0 otherwise. */ -extern bool string_list_member PARAMS ((const string_list_ty *slp, - const char *s)); +extern bool string_list_member (const string_list_ty *slp, const char *s); #endif /* _STR_LIST_H */ diff --git a/src/urlget.c b/src/urlget.c index 4776ccdcf..823627335 100644 --- a/src/urlget.c +++ b/src/urlget.c @@ -70,24 +70,17 @@ static const struct option long_options[] = }; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static void usage PARAMS ((int status)) +/* Forward declaration of local functions. */ +static void usage (int status) #if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2) __attribute__ ((noreturn)) #endif ; -static void cat_file PARAMS ((const char *src_filename)); -static bool execute_it PARAMS ((const char *progname, - const char *prog_path, char **prog_argv, - void *private_data)); -static void fetch PARAMS ((const char *url, const char *file)); +static void fetch (const char *url, const char *file); int -main (argc, argv) - int argc; - char *argv[]; +main (int argc, char *argv[]) { int optchar; bool do_help; @@ -157,8 +150,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ /* Display usage information and exit. */ static void -usage (status) - int status; +usage (int status) { if (status != EXIT_SUCCESS) fprintf (stderr, _("Try `%s --help' for more information.\n"), @@ -192,8 +184,7 @@ Informative output:\n\ /* Copy a file's contents to stdout. */ static void -cat_file (src_filename) - const char *src_filename; +cat_file (const char *src_filename) { int src_fd; char buf[4096]; @@ -227,11 +218,9 @@ cat_file (src_filename) } static bool -execute_it (progname, prog_path, prog_argv, private_data) - const char *progname; - const char *prog_path; - char **prog_argv; - void *private_data; +execute_it (const char *progname, + const char *prog_path, char **prog_argv, + void *private_data) { (void) private_data; @@ -241,9 +230,7 @@ execute_it (progname, prog_path, prog_argv, private_data) /* Fetch the URL. Upon error, use the FILE as fallback. */ static void -fetch (url, file) - const char *url; - const char *file; +fetch (const char *url, const char *file) { /* First try: using Java. */ { diff --git a/src/write-java.c b/src/write-java.c index c53370ecd..c9eef8027 100644 --- a/src/write-java.c +++ b/src/write-java.c @@ -81,41 +81,11 @@ #define _(str) gettext (str) -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static int check_resource_name PARAMS ((const char *name)); -static unsigned int string_hashcode PARAMS ((const char *str)); -static unsigned int compute_hashsize PARAMS ((message_list_ty *mlp, - bool *collisionp)); -static int compare_index PARAMS ((const void *pval1, const void *pval2)); -static struct table_item * compute_table_items PARAMS ((message_list_ty *mlp, - unsigned int hashsize)); -static void write_java_string PARAMS ((FILE *stream, const char *str)); -static void write_java_msgstr PARAMS ((FILE *stream, message_ty *mp)); -static void write_lookup_code PARAMS ((FILE *stream, unsigned int hashsize, - bool collisions)); -static bool is_expression_boolean PARAMS ((struct expression *exp)); -static void write_java_expression PARAMS ((FILE *stream, - struct expression *exp, - bool as_boolean)); -static void write_java_code PARAMS ((FILE *stream, const char *class_name, - message_list_ty *mlp, bool assume_java2)); -static void uninstall_handlers PARAMS ((void)); -static void cleanup PARAMS ((int sig)); -static void install_handlers PARAMS ((void)); -#if HAVE_POSIX_SIGNALBLOCKING -static void init_signal_set PARAMS ((void)); -static void block PARAMS ((void)); -static void unblock PARAMS ((void)); -#endif - - /* Check that the resource name is a valid Java class name. To simplify things, we allow only ASCII characters in the class name. Return the number of dots in the class name, or -1 if not OK. */ static int -check_resource_name (name) - const char *name; +check_resource_name (const char *name) { int ndots = 0; const char *p = name; @@ -148,8 +118,7 @@ check_resource_name (name) this removes one bit but greatly simplifies the following "mod hash_size" and "mod (hash_size - 2)" operations. */ static unsigned int -string_hashcode (str) - const char *str; +string_hashcode (const char *str) { const char *str_limit = str + strlen (str); int hash = 0; @@ -175,9 +144,7 @@ string_hashcode (str) /* Compute a good hash table size for the given set of msgids. */ static unsigned int -compute_hashsize (mlp, collisionp) - message_list_ty *mlp; - bool *collisionp; +compute_hashsize (message_list_ty *mlp, bool *collisionp) { /* This is an O(n^2) algorithm, but should be sufficient because few programs have more than 1000 messages in a single domain. */ @@ -310,9 +277,7 @@ compute_hashsize (mlp, collisionp) struct table_item { unsigned int index; message_ty *mp; }; static int -compare_index (pval1, pval2) - const void *pval1; - const void *pval2; +compare_index (const void *pval1, const void *pval2) { return (int)((const struct table_item *) pval1)->index - (int)((const struct table_item *) pval2)->index; @@ -321,9 +286,7 @@ compare_index (pval1, pval2) /* Compute the list of messages and table indices, sorted according to the indices. */ static struct table_item * -compute_table_items (mlp, hashsize) - message_list_ty *mlp; - unsigned int hashsize; +compute_table_items (message_list_ty *mlp, unsigned int hashsize) { unsigned int n = mlp->nitems; struct table_item *arr = @@ -366,9 +329,7 @@ compute_table_items (mlp, hashsize) /* Write a string in Java Unicode notation to the given stream. */ static void -write_java_string (stream, str) - FILE *stream; - const char *str; +write_java_string (FILE *stream, const char *str) { static const char hexdigit[] = "0123456789abcdef"; const char *str_limit = str + strlen (str); @@ -417,9 +378,7 @@ write_java_string (stream, str) has plural forms, it is an expression of type String[], otherwise it is an expression of type String. */ static void -write_java_msgstr (stream, mp) - FILE *stream; - message_ty *mp; +write_java_msgstr (FILE *stream, message_ty *mp) { if (mp->msgid_plural != NULL) { @@ -450,10 +409,7 @@ write_java_msgstr (stream, mp) /* Writes the body of the function which returns the local value for a key named 'msgid'. */ static void -write_lookup_code (stream, hashsize, collisions) - FILE *stream; - unsigned int hashsize; - bool collisions; +write_lookup_code (FILE *stream, unsigned int hashsize, bool collisions) { fprintf (stream, " int hash_val = msgid.hashCode() & 0x7fffffff;\n"); fprintf (stream, " int idx = (hash_val %% %d) << 1;\n", hashsize); @@ -492,8 +448,7 @@ write_lookup_code (stream, hashsize, collisions) /* Tests whether a plural expression, evaluated according to the C rules, can only produce the values 0 and 1. */ static bool -is_expression_boolean (exp) - struct expression *exp; +is_expression_boolean (struct expression *exp) { switch (exp->operation) { @@ -528,10 +483,7 @@ is_expression_boolean (exp) /* Write Java code that evaluates a plural expression according to the C rules. The variable is called 'n'. */ static void -write_java_expression (stream, exp, as_boolean) - FILE *stream; - struct expression *exp; - bool as_boolean; +write_java_expression (FILE *stream, struct expression *exp, bool as_boolean) { /* We use parentheses everywhere. This frees us from tracking the priority of arithmetic operators. */ @@ -712,11 +664,8 @@ write_java_expression (stream, exp, as_boolean) because applications can have their own classes called X.Y.ResourceBundle or X.Y.String. */ static void -write_java_code (stream, class_name, mlp, assume_java2) - FILE *stream; - const char *class_name; - message_list_ty *mlp; - bool assume_java2; +write_java_code (FILE *stream, const char *class_name, message_list_ty *mlp, + bool assume_java2) { const char *last_dot; unsigned int plurals; @@ -963,8 +912,7 @@ uninstall_handlers () /* The signal handler. It gets called asynchronously. */ static void -cleanup (sig) - int sig; +cleanup (int sig) { unsigned int i; @@ -1070,12 +1018,10 @@ unblock () int -msgdomain_write_java (mlp, resource_name, locale_name, directory, assume_java2) - message_list_ty *mlp; - const char *resource_name; - const char *locale_name; - const char *directory; - bool assume_java2; +msgdomain_write_java (message_list_ty *mlp, + const char *resource_name, const char *locale_name, + const char *directory, + bool assume_java2) { int retval; char *template; diff --git a/src/write-java.h b/src/write-java.h index 3cec77452..37e1947b7 100644 --- a/src/write-java.h +++ b/src/write-java.h @@ -1,5 +1,5 @@ /* Writing Java ResourceBundles. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -29,10 +29,10 @@ separators) or NULL, directory is the base directory. Return 0 if ok, nonzero on error. */ extern int - msgdomain_write_java PARAMS ((message_list_ty *mlp, - const char *resource_name, - const char *locale_name, - const char *directory, - bool assume_java2)); + msgdomain_write_java (message_list_ty *mlp, + const char *resource_name, + const char *locale_name, + const char *directory, + bool assume_java2); #endif /* _WRITE_JAVA_H */ diff --git a/src/write-mo.c b/src/write-mo.c index 9db7f180a..ee1cb6aaf 100644 --- a/src/write-mo.c +++ b/src/write-mo.c @@ -66,12 +66,6 @@ size_t alignment; bool no_hash_table; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static int compare_id PARAMS ((const void *pval1, const void *pval2)); -static void write_table PARAMS ((FILE *output_file, message_list_ty *mlp)); - - /* Indices into the strings contained in 'struct pre_message' and 'struct pre_sysdep_message'. */ enum @@ -96,9 +90,7 @@ struct pre_message }; static int -compare_id (pval1, pval2) - const void *pval1; - const void *pval2; +compare_id (const void *pval1, const void *pval2) { return strcmp (((struct pre_message *) pval1)->str[M_ID].pointer, ((struct pre_message *) pval2)->str[M_ID].pointer); @@ -138,9 +130,7 @@ struct pre_sysdep_message /* Write the message list to the given open file. */ static void -write_table (output_file, mlp) - FILE *output_file; - message_list_ty *mlp; +write_table (FILE *output_file, message_list_ty *mlp) { size_t nstrings; struct pre_message *msg_arr; @@ -678,10 +668,9 @@ write_table (output_file, mlp) int -msgdomain_write_mo (mlp, domain_name, file_name) - message_list_ty *mlp; - const char *domain_name; - const char *file_name; +msgdomain_write_mo (message_list_ty *mlp, + const char *domain_name, + const char *file_name) { FILE *output_file; diff --git a/src/write-mo.h b/src/write-mo.h index cbae7efb8..b0b492300 100644 --- a/src/write-mo.h +++ b/src/write-mo.h @@ -1,5 +1,5 @@ /* Writing binary .mo files. - Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc. Written by Ulrich Drepper , April 1995. This program is free software; you can redistribute it and/or modify @@ -34,8 +34,8 @@ extern bool no_hash_table; domain_name is the domain name, file_name is the desired file name. Return 0 if ok, nonzero on error. */ extern int - msgdomain_write_mo PARAMS ((message_list_ty *mlp, - const char *domain_name, - const char *file_name)); + msgdomain_write_mo (message_list_ty *mlp, + const char *domain_name, + const char *file_name); #endif /* _WRITE_MO_H */ diff --git a/src/write-po.c b/src/write-po.c index 5fec37756..5424661ae 100644 --- a/src/write-po.c +++ b/src/write-po.c @@ -55,40 +55,13 @@ #endif -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static const char *make_format_description_string PARAMS ((enum is_format, - const char *lang, - bool debug)); -static bool significant_format_p PARAMS ((enum is_format is_format)); -static bool has_significant_format_p - PARAMS ((const enum is_format is_format[NFORMATS])); -static const char *make_c_width_description_string PARAMS ((enum is_wrap)); -static inline void memcpy_small PARAMS ((void *dst, const void *src, size_t n)); -static void wrap PARAMS ((FILE *fp, const char *line_prefix, const char *name, - const char *value, enum is_wrap do_wrap, - const char *charset)); -static void print_blank_line PARAMS ((FILE *fp)); -static void message_print PARAMS ((const message_ty *mp, FILE *fp, - const char *charset, bool blank_line, - bool debug)); -static void message_print_obsolete PARAMS ((const message_ty *mp, FILE *fp, - const char *charset, - bool blank_line)); -static int cmp_by_msgid PARAMS ((const void *va, const void *vb)); -static int cmp_filepos PARAMS ((const void *va, const void *vb)); -static void msgdomain_list_sort_filepos PARAMS ((msgdomain_list_ty *mdlp)); -static int cmp_by_filepos PARAMS ((const void *va, const void *vb)); - - /* This variable controls the page width when printing messages. Defaults to PAGE_WIDTH if not set. Zero (0) given to message_page_- width_set will result in no wrapping being performed. */ static size_t page_width = PAGE_WIDTH; void -message_page_width_set (n) - size_t n; +message_page_width_set (size_t n) { if (n == 0) { @@ -134,8 +107,7 @@ message_print_style_uniforum () } void -message_print_style_escape (flag) - bool flag; +message_print_style_escape (bool flag) { escape = flag; } @@ -145,10 +117,8 @@ message_print_style_escape (flag) static const char * -make_format_description_string (is_format, lang, debug) - enum is_format is_format; - const char *lang; - bool debug; +make_format_description_string (enum is_format is_format, const char *lang, + bool debug) { static char result[100]; @@ -177,16 +147,14 @@ make_format_description_string (is_format, lang, debug) static bool -significant_format_p (is_format) - enum is_format is_format; +significant_format_p (enum is_format is_format) { return is_format != undecided && is_format != impossible; } static bool -has_significant_format_p (is_format) - const enum is_format is_format[NFORMATS]; +has_significant_format_p (const enum is_format is_format[NFORMATS]) { size_t i; @@ -198,8 +166,7 @@ has_significant_format_p (is_format) static const char * -make_c_width_description_string (do_wrap) - enum is_wrap do_wrap; +make_c_width_description_string (enum is_wrap do_wrap) { const char *result = NULL; @@ -221,10 +188,7 @@ make_c_width_description_string (do_wrap) /* A version of memcpy optimized for the case n <= 1. */ static inline void -memcpy_small (dst, src, n) - void *dst; - const void *src; - size_t n; +memcpy_small (void *dst, const void *src, size_t n) { if (n > 0) { @@ -239,13 +203,8 @@ memcpy_small (dst, src, n) static void -wrap (fp, line_prefix, name, value, do_wrap, charset) - FILE *fp; - const char *line_prefix; - const char *name; - const char *value; - enum is_wrap do_wrap; - const char *charset; +wrap (FILE *fp, const char *line_prefix, const char *name, const char *value, + enum is_wrap do_wrap, const char *charset) { const char *canon_charset; const char *s; @@ -613,8 +572,7 @@ internationalized messages should not contain the `\\%c' escape sequence"), static void -print_blank_line (fp) - FILE *fp; +print_blank_line (FILE *fp) { if (uniforum) fputs ("#\n", fp); @@ -623,12 +581,8 @@ print_blank_line (fp) } static void -message_print (mp, fp, charset, blank_line, debug) - const message_ty *mp; - FILE *fp; - const char *charset; - bool blank_line; - bool debug; +message_print (const message_ty *mp, FILE *fp, const char *charset, + bool blank_line, bool debug) { size_t j; @@ -810,11 +764,8 @@ different from yours. Consider using a pure ASCII msgid instead.\n\ static void -message_print_obsolete (mp, fp, charset, blank_line) - const message_ty *mp; - FILE *fp; - const char *charset; - bool blank_line; +message_print_obsolete (const message_ty *mp, FILE *fp, const char *charset, + bool blank_line) { size_t j; @@ -905,11 +856,8 @@ different from yours. Consider using a pure ASCII msgid instead.\n\ void -msgdomain_list_print (mdlp, filename, force, debug) - msgdomain_list_ty *mdlp; - const char *filename; - bool force; - bool debug; +msgdomain_list_print (msgdomain_list_ty *mdlp, const char *filename, + bool force, bool debug) { FILE *fp; size_t j, k; @@ -1031,9 +979,7 @@ msgdomain_list_print (mdlp, filename, force, debug) static int -cmp_by_msgid (va, vb) - const void *va; - const void *vb; +cmp_by_msgid (const void *va, const void *vb) { const message_ty *a = *(const message_ty **) va; const message_ty *b = *(const message_ty **) vb; @@ -1045,8 +991,7 @@ cmp_by_msgid (va, vb) void -msgdomain_list_sort_by_msgid (mdlp) - msgdomain_list_ty *mdlp; +msgdomain_list_sort_by_msgid (msgdomain_list_ty *mdlp) { size_t k; @@ -1063,9 +1008,7 @@ msgdomain_list_sort_by_msgid (mdlp) /* Sort the file positions of every message. */ static int -cmp_filepos (va, vb) - const void *va; - const void *vb; +cmp_filepos (const void *va, const void *vb) { const lex_pos_ty *a = (const lex_pos_ty *) va; const lex_pos_ty *b = (const lex_pos_ty *) vb; @@ -1079,8 +1022,7 @@ cmp_filepos (va, vb) } static void -msgdomain_list_sort_filepos (mdlp) - msgdomain_list_ty *mdlp; +msgdomain_list_sort_filepos (msgdomain_list_ty *mdlp) { size_t j, k; @@ -1103,9 +1045,7 @@ msgdomain_list_sort_filepos (mdlp) /* Sort the messages according to the file position. */ static int -cmp_by_filepos (va, vb) - const void *va; - const void *vb; +cmp_by_filepos (const void *va, const void *vb) { const message_ty *a = *(const message_ty **) va; const message_ty *b = *(const message_ty **) vb; @@ -1139,8 +1079,7 @@ cmp_by_filepos (va, vb) void -msgdomain_list_sort_by_filepos (mdlp) - msgdomain_list_ty *mdlp; +msgdomain_list_sort_by_filepos (msgdomain_list_ty *mdlp) { size_t k; diff --git a/src/write-po.h b/src/write-po.h index 3896c97b5..ffebda4ad 100644 --- a/src/write-po.h +++ b/src/write-po.h @@ -25,23 +25,23 @@ #include extern void - message_page_width_set PARAMS ((size_t width)); + message_page_width_set (size_t width); extern void - message_page_width_ignore PARAMS ((void)); + message_page_width_ignore (void); extern void - message_print_style_indent PARAMS ((void)); + message_print_style_indent (void); extern void - message_print_style_uniforum PARAMS ((void)); + message_print_style_uniforum (void); extern void - message_print_style_escape PARAMS ((bool flag)); + message_print_style_escape (bool flag); extern void - msgdomain_list_print PARAMS ((msgdomain_list_ty *mdlp, - const char *filename, - bool force, bool debug)); + msgdomain_list_print (msgdomain_list_ty *mdlp, + const char *filename, + bool force, bool debug); extern void - msgdomain_list_sort_by_msgid PARAMS ((msgdomain_list_ty *mdlp)); + msgdomain_list_sort_by_msgid (msgdomain_list_ty *mdlp); extern void - msgdomain_list_sort_by_filepos PARAMS ((msgdomain_list_ty *mdlp)); + msgdomain_list_sort_by_filepos (msgdomain_list_ty *mdlp); #endif /* _WRITE_PO_H */ diff --git a/src/write-tcl.c b/src/write-tcl.c index 9533a1108..729942e89 100644 --- a/src/write-tcl.c +++ b/src/write-tcl.c @@ -43,13 +43,6 @@ #define _(str) gettext (str) -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static void write_tcl_string PARAMS ((FILE *stream, const char *str)); -static void write_msg PARAMS ((FILE *output_file, message_list_ty *mlp, - const char *locale_name)); - - /* Write a string in Tcl Unicode notation to the given stream. Tcl 8 uses Unicode for its internal string representation. In tcl-8.3.3, the .msg files are read in using the locale dependent @@ -57,9 +50,7 @@ static void write_msg PARAMS ((FILE *output_file, message_list_ty *mlp, form is the \unnnn notation. Newer tcl versions have this fixed: they read the .msg files in UTF-8 encoding. */ static void -write_tcl_string (stream, str) - FILE *stream; - const char *str; +write_tcl_string (FILE *stream, const char *str) { static const char hexdigit[] = "0123456789abcdef"; const char *str_limit = str + strlen (str); @@ -115,10 +106,7 @@ write_tcl_string (stream, str) static void -write_msg (output_file, mlp, locale_name) - FILE *output_file; - message_list_ty *mlp; - const char *locale_name; +write_msg (FILE *output_file, message_list_ty *mlp, const char *locale_name) { size_t j; @@ -145,10 +133,9 @@ write_msg (output_file, mlp, locale_name) } int -msgdomain_write_tcl (mlp, locale_name, directory) - message_list_ty *mlp; - const char *locale_name; - const char *directory; +msgdomain_write_tcl (message_list_ty *mlp, + const char *locale_name, + const char *directory) { /* If no entry for this domain don't even create the file. */ if (mlp->nitems == 0) diff --git a/src/write-tcl.h b/src/write-tcl.h index 0ccb4425a..2b135db67 100644 --- a/src/write-tcl.h +++ b/src/write-tcl.h @@ -26,8 +26,8 @@ the base directory. Return 0 if ok, nonzero on error. */ extern int - msgdomain_write_tcl PARAMS ((message_list_ty *mlp, - const char *locale_name, - const char *directory)); + msgdomain_write_tcl (message_list_ty *mlp, + const char *locale_name, + const char *directory); #endif /* _WRITE_TCL_H */ diff --git a/src/x-awk.c b/src/x-awk.c index e9d10843f..4d368a7fb 100644 --- a/src/x-awk.c +++ b/src/x-awk.c @@ -38,12 +38,6 @@ #define _(s) gettext(s) -#if HAVE_C_BACKSLASH_A -# define ALERT_CHAR '\a' -#else -# define ALERT_CHAR '\7' -#endif - /* The awk syntax is defined in the gawk manual page and documentation. See also gawk/awkgram.y. */ @@ -70,21 +64,6 @@ struct token_ty }; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static void init_keywords PARAMS ((void)); -static int phase1_getc PARAMS ((void)); -static void phase1_ungetc PARAMS ((int c)); -static int phase2_getc PARAMS ((void)); -static void phase2_ungetc PARAMS ((int c)); -static int phase7_getc PARAMS ((void)); -static inline void free_token PARAMS ((token_ty *tp)); -static void x_awk_lex PARAMS ((token_ty *tp)); -static bool extract_parenthesized PARAMS ((message_list_ty *mlp, - int commas_to_skip, - int plural_commas)); - - /* ====================== Keyword set customization. ====================== */ /* If true extract all strings. */ @@ -102,8 +81,7 @@ x_awk_extract_all () void -x_awk_keyword (name) - const char *name; +x_awk_keyword (const char *name) { if (name == NULL) default_keywords = false; @@ -186,8 +164,7 @@ phase1_getc () } static void -phase1_ungetc (c) - int c; +phase1_ungetc (int c) { if (c != EOF) { @@ -242,8 +219,7 @@ phase2_getc () } static void -phase2_ungetc (c) - int c; +phase2_ungetc (int c) { if (c != EOF) phase1_ungetc (c); @@ -278,7 +254,7 @@ phase7_getc () switch (c) { case 'a': - return ALERT_CHAR; + return '\a'; case 'b': return '\b'; case 'f': @@ -355,8 +331,7 @@ phase7_getc () /* Free the memory pointed to by a 'struct token_ty'. */ static inline void -free_token (tp) - token_ty *tp; +free_token (token_ty *tp) { switch (tp->type) { @@ -385,8 +360,7 @@ free_token (tp) static bool prefer_division_over_regexp; static void -x_awk_lex (tp) - token_ty *tp; +x_awk_lex (token_ty *tp) { static char *buffer; static int bufmax; @@ -688,10 +662,8 @@ x_awk_lex (tp) When no specific argument shall be extracted, COMMAS_TO_SKIP < 0. Return true upon eof, false upon closing parenthesis. */ static bool -extract_parenthesized (mlp, commas_to_skip, plural_commas) - message_list_ty *mlp; - int commas_to_skip; - int plural_commas; +extract_parenthesized (message_list_ty *mlp, + int commas_to_skip, int plural_commas) { /* Remember the message containing the msgid, for msgid_plural. */ message_ty *plural_mp = NULL; @@ -834,11 +806,9 @@ extract_parenthesized (mlp, commas_to_skip, plural_commas) void -extract_awk (f, real_filename, logical_filename, mdlp) - FILE *f; - const char *real_filename; - const char *logical_filename; - msgdomain_list_ty *mdlp; +extract_awk (FILE *f, + const char *real_filename, const char *logical_filename, + msgdomain_list_ty *mdlp) { message_list_ty *mlp = mdlp->item[0]->messages; diff --git a/src/x-awk.h b/src/x-awk.h index 0b10b0fb5..a9a2c7f56 100644 --- a/src/x-awk.h +++ b/src/x-awk.h @@ -24,9 +24,9 @@ { "awk", extract_awk, &formatstring_awk }, \ /* Scan an awk file and add its translatable strings to mdlp. */ -extern void extract_awk PARAMS ((FILE *fp, const char *real_filename, - const char *logical_filename, - msgdomain_list_ty *mdlp)); +extern void extract_awk (FILE *fp, const char *real_filename, + const char *logical_filename, + msgdomain_list_ty *mdlp); -extern void x_awk_keyword PARAMS ((const char *keyword)); -extern void x_awk_extract_all PARAMS ((void)); +extern void x_awk_keyword (const char *keyword); +extern void x_awk_extract_all (void); diff --git a/src/x-c.c b/src/x-c.c index 8f359718e..16c86c07d 100644 --- a/src/x-c.c +++ b/src/x-c.c @@ -39,12 +39,6 @@ #define _(s) gettext(s) -#if HAVE_C_BACKSLASH_A -# define ALERT_CHAR '\a' -#else -# define ALERT_CHAR '\7' -#endif - /* The ANSI C standard defines several phases of translation: @@ -137,38 +131,6 @@ struct token_ty }; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static void init_keywords PARAMS ((void)); -static int phase1_getc PARAMS ((void)); -static void phase1_ungetc PARAMS ((int c)); -static int phase2_getc PARAMS ((void)); -static void phase2_ungetc PARAMS ((int c)); -static int phase3_getc PARAMS ((void)); -static void phase3_ungetc PARAMS ((int c)); -static inline void comment_start PARAMS ((void)); -static inline void comment_add PARAMS ((int c)); -static inline void comment_line_end PARAMS ((size_t chars_to_remove)); -static int phase4_getc PARAMS ((void)); -static void phase4_ungetc PARAMS ((int c)); -static int phase7_getc PARAMS ((void)); -static void phase7_ungetc PARAMS ((int c)); -static inline void free_token PARAMS ((token_ty *tp)); -static void phase5_get PARAMS ((token_ty *tp)); -static void phase5_unget PARAMS ((token_ty *tp)); -static void phaseX_get PARAMS ((token_ty *tp)); -static void phase6_get PARAMS ((token_ty *tp)); -static void phase6_unget PARAMS ((token_ty *tp)); -static bool is_inttypes_macro PARAMS ((const char *name)); -static void phase8a_get PARAMS ((token_ty *tp)); -static void phase8a_unget PARAMS ((token_ty *tp)); -static void phase8_get PARAMS ((token_ty *tp)); -static void x_c_lex PARAMS ((xgettext_token_ty *tp)); -static bool extract_parenthesized PARAMS ((message_list_ty *mlp, - int commas_to_skip, - int plural_commas)); - - /* ========================= Lexer customization. ========================= */ static bool trigraphs = false; @@ -197,8 +159,7 @@ x_c_extract_all () void -x_c_keyword (name) - const char *name; +x_c_keyword (const char *name) { if (name == NULL) default_keywords = false; @@ -329,8 +290,7 @@ error while reading \"%s\""), real_file_name); static void -phase1_ungetc (c) - int c; +phase1_ungetc (int c) { switch (c) { @@ -405,8 +365,7 @@ phase2_getc () static void -phase2_ungetc (c) - int c; +phase2_ungetc (int c) { if (c != EOF) phase2_pushback[phase2_pushback_length++] = c; @@ -443,8 +402,7 @@ phase3_getc () static void -phase3_ungetc (c) - int c; +phase3_ungetc (int c) { if (c != EOF) phase3_pushback[phase3_pushback_length++] = c; @@ -464,8 +422,7 @@ comment_start () } static inline void -comment_add (c) - int c; +comment_add (int c) { if (buflen >= bufmax) { @@ -476,8 +433,7 @@ comment_add (c) } static inline void -comment_line_end (chars_to_remove) - size_t chars_to_remove; +comment_line_end (size_t chars_to_remove) { buflen -= chars_to_remove; while (buflen >= 1 @@ -580,8 +536,7 @@ phase4_getc () static void -phase4_ungetc (c) - int c; +phase4_ungetc (int c) { phase3_ungetc (c); } @@ -647,7 +602,7 @@ phase7_getc () return c; case 'a': - return ALERT_CHAR; + return '\a'; case 'b': return '\b'; @@ -733,8 +688,7 @@ phase7_getc () static void -phase7_ungetc (c) - int c; +phase7_ungetc (int c) { phase3_ungetc (c); } @@ -742,8 +696,7 @@ phase7_ungetc (c) /* Free the memory pointed to by a 'struct token_ty'. */ static inline void -free_token (tp) - token_ty *tp; +free_token (token_ty *tp) { if (tp->type == token_type_name || tp->type == token_type_string_literal) free (tp->string); @@ -759,8 +712,7 @@ static int phase5_pushback_length; static void -phase5_get (tp) - token_ty *tp; +phase5_get (token_ty *tp) { static char *buffer; static int bufmax; @@ -1029,8 +981,7 @@ phase5_get (tp) static void -phase5_unget (tp) - token_ty *tp; +phase5_unget (token_ty *tp) { if (tp->type != token_type_eof) phase5_pushback[phase5_pushback_length++] = *tp; @@ -1042,8 +993,7 @@ phase5_unget (tp) makes the phase 6 easier. */ static void -phaseX_get (tp) - token_ty *tp; +phaseX_get (token_ty *tp) { static bool middle; /* false at the beginning of a line, true otherwise. */ @@ -1091,8 +1041,7 @@ static int phase6_pushback_length; static void -phase6_get (tp) - token_ty *tp; +phase6_get (token_ty *tp) { static token_ty *buf; static int bufmax; @@ -1171,8 +1120,7 @@ phase6_get (tp) static void -phase6_unget (tp) - token_ty *tp; +phase6_unget (token_ty *tp) { if (tp->type != token_type_eof) phase6_pushback[phase6_pushback_length++] = *tp; @@ -1184,8 +1132,7 @@ phase6_unget (tp) /* Test for an ISO C 99 section 7.8.1 format string directive. */ static bool -is_inttypes_macro (name) - const char *name; +is_inttypes_macro (const char *name) { /* Syntax: P R I { d | i | o | u | x | X } @@ -1223,8 +1170,7 @@ is_inttypes_macro (name) } static void -phase8a_get (tp) - token_ty *tp; +phase8a_get (token_ty *tp) { phase6_get (tp); if (tp->type == token_type_name && is_inttypes_macro (tp->string)) @@ -1243,8 +1189,7 @@ phase8a_get (tp) } static void -phase8a_unget (tp) - token_ty *tp; +phase8a_unget (token_ty *tp) { phase6_unget (tp); } @@ -1255,8 +1200,7 @@ phase8a_unget (tp) will miss). */ static void -phase8_get (tp) - token_ty *tp; +phase8_get (token_ty *tp) { phase8a_get (tp); if (tp->type != token_type_string_literal) @@ -1288,8 +1232,7 @@ phase8_get (tp) discards any white space from the translation unit. */ static void -x_c_lex (tp) - xgettext_token_ty *tp; +x_c_lex (xgettext_token_ty *tp) { for (;;) { @@ -1400,10 +1343,8 @@ x_c_lex (tp) When no specific argument shall be extracted, COMMAS_TO_SKIP < 0. Return true upon eof, false upon closing parenthesis. */ static bool -extract_parenthesized (mlp, commas_to_skip, plural_commas) - message_list_ty *mlp; - int commas_to_skip; - int plural_commas; +extract_parenthesized (message_list_ty *mlp, + int commas_to_skip, int plural_commas) { /* Remember the message containing the msgid, for msgid_plural. */ message_ty *plural_mp = NULL; @@ -1516,11 +1457,9 @@ extract_parenthesized (mlp, commas_to_skip, plural_commas) void -extract_c (f, real_filename, logical_filename, mdlp) - FILE *f; - const char *real_filename; - const char *logical_filename; - msgdomain_list_ty *mdlp; +extract_c (FILE *f, + const char *real_filename, const char *logical_filename, + msgdomain_list_ty *mdlp) { message_list_ty *mlp = mdlp->item[0]->messages; diff --git a/src/x-c.h b/src/x-c.h index 72057431b..738e19f2a 100644 --- a/src/x-c.h +++ b/src/x-c.h @@ -1,5 +1,5 @@ /* xgettext C/C++/ObjectiveC backend. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -36,16 +36,16 @@ { "ObjectiveC", extract_c, &formatstring_c }, \ /* Scan a C/C++/ObjectiveC file and add its translatable strings to mdlp. */ -extern void extract_c PARAMS ((FILE *fp, const char *real_filename, - const char *logical_filename, - msgdomain_list_ty *mdlp)); +extern void extract_c (FILE *fp, const char *real_filename, + const char *logical_filename, + msgdomain_list_ty *mdlp); /* Handling of options specific to this language. */ -extern void x_c_extract_all PARAMS ((void)); +extern void x_c_extract_all (void); -extern void x_c_keyword PARAMS ((const char *name)); -extern bool x_c_any_keywords PARAMS ((void)); +extern void x_c_keyword (const char *name); +extern bool x_c_any_keywords (void); -extern void x_c_trigraphs PARAMS ((void)); +extern void x_c_trigraphs (void); diff --git a/src/x-elisp.c b/src/x-elisp.c index 9a0cf3b45..b721ce5d1 100644 --- a/src/x-elisp.c +++ b/src/x-elisp.c @@ -39,12 +39,6 @@ #define _(s) gettext(s) -#if HAVE_C_BACKSLASH_A -# define ALERT_CHAR '\a' -#else -# define ALERT_CHAR '\7' -#endif - /* Summary of Emacs Lisp syntax: - ';' starts a comment until end of line. @@ -64,29 +58,6 @@ The reader is implemented in emacs-21.1/src/lread.c. */ -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -struct token; -struct object; -static void init_keywords PARAMS ((void)); -static int do_getc PARAMS ((void)); -static void do_ungetc PARAMS ((int c)); -static inline void init_token PARAMS ((struct token *tp)); -static inline void free_token PARAMS ((struct token *tp)); -static inline void grow_token PARAMS ((struct token *tp)); -static inline bool is_integer PARAMS ((const char *p)); -static inline bool is_float PARAMS ((const char *p)); -static bool read_token PARAMS ((struct token *tp, int first)); -static inline void comment_start PARAMS ((void)); -static inline void comment_add PARAMS ((int c)); -static inline void comment_line_end PARAMS ((size_t chars_to_remove)); -static inline void free_object PARAMS ((struct object *op)); -static char * string_of_object PARAMS ((const struct object *op)); -static int do_getc_escaped PARAMS ((int c, bool in_string)); -static void read_object PARAMS ((struct object *op, - bool first_in_list, bool new_backquote_flag)); - - /* ====================== Keyword set customization. ====================== */ /* If true extract all strings. */ @@ -104,8 +75,7 @@ x_elisp_extract_all () void -x_elisp_keyword (name) - const char *name; +x_elisp_keyword (const char *name) { if (name == NULL) default_keywords = false; @@ -180,8 +150,7 @@ error while reading \"%s\""), real_file_name); /* Put back the last fetched character, not EOF. */ static void -do_ungetc (c) - int c; +do_ungetc (int c) { if (c == '\n') line_number--; @@ -202,8 +171,7 @@ struct token /* Initialize a 'struct token'. */ static inline void -init_token (tp) - struct token *tp; +init_token (struct token *tp) { tp->allocated = 10; tp->chars = (char *) xmalloc (tp->allocated * sizeof (char)); @@ -212,16 +180,14 @@ init_token (tp) /* Free the memory pointed to by a 'struct token'. */ static inline void -free_token (tp) - struct token *tp; +free_token (struct token *tp) { free (tp->chars); } /* Ensure there is enough room in the token for one more character. */ static inline void -grow_token (tp) - struct token *tp; +grow_token (struct token *tp) { if (tp->charcount == tp->allocated) { @@ -232,8 +198,7 @@ grow_token (tp) /* Test whether a token has integer syntax. */ static inline bool -is_integer (p) - const char *p; +is_integer (const char *p) { /* NB: Yes, '+.' and '-.' both designate the integer 0. */ const char *p_start = p; @@ -251,8 +216,7 @@ is_integer (p) /* Test whether a token has float syntax. */ static inline bool -is_float (p) - const char *p; +is_float (const char *p) { enum { LEAD_INT = 1, DOT_CHAR = 2, TRAIL_INT = 4, E_CHAR = 8, EXP_INT = 16 }; int state; @@ -311,9 +275,7 @@ is_float (p) /* Read the next token. 'first' is the first character, which has already been read. Returns true for a symbol, false for a number. */ static bool -read_token (tp, first) - struct token *tp; - int first; +read_token (struct token *tp, int first) { int c; bool quoted = false; @@ -373,8 +335,7 @@ comment_start () } static inline void -comment_add (c) - int c; +comment_add (int c) { if (buflen >= bufmax) { @@ -385,8 +346,7 @@ comment_add (c) } static inline void -comment_line_end (chars_to_remove) - size_t chars_to_remove; +comment_line_end (size_t chars_to_remove) { buflen -= chars_to_remove; while (buflen >= 1 @@ -439,8 +399,7 @@ struct object /* Free the memory pointed to by a 'struct object'. */ static inline void -free_object (op) - struct object *op; +free_object (struct object *op) { if (op->type == t_symbol || op->type == t_string) { @@ -451,8 +410,7 @@ free_object (op) /* Convert a t_symbol/t_string token to a char*. */ static char * -string_of_object (op) - const struct object *op; +string_of_object (const struct object *op) { char *str; int n; @@ -469,14 +427,12 @@ string_of_object (op) /* Returns the character represented by an escape sequence. */ #define IGNORABLE_ESCAPE (EOF - 1) static int -do_getc_escaped (c, in_string) - int c; - bool in_string; +do_getc_escaped (int c, bool in_string) { switch (c) { case 'a': - return ALERT_CHAR; + return '\a'; case 'b': return '\b'; case 'd': @@ -653,10 +609,7 @@ do_getc_escaped (c, in_string) 'first_in_list' and 'new_backquote_flag' are used for reading old backquote syntax and new backquote syntax. */ static void -read_object (op, first_in_list, new_backquote_flag) - struct object *op; - bool first_in_list; - bool new_backquote_flag; +read_object (struct object *op, bool first_in_list, bool new_backquote_flag) { for (;;) { @@ -1247,11 +1200,9 @@ read_object (op, first_in_list, new_backquote_flag) void -extract_elisp (f, real_filename, logical_filename, mdlp) - FILE *f; - const char *real_filename; - const char *logical_filename; - msgdomain_list_ty *mdlp; +extract_elisp (FILE *f, + const char *real_filename, const char *logical_filename, + msgdomain_list_ty *mdlp) { mlp = mdlp->item[0]->messages; diff --git a/src/x-elisp.h b/src/x-elisp.h index dce716ceb..9dfe1d658 100644 --- a/src/x-elisp.h +++ b/src/x-elisp.h @@ -24,12 +24,12 @@ { "EmacsLisp", extract_elisp, &formatstring_elisp }, \ /* Scan an Emacs Lisp file and add its translatable strings to mdlp. */ -extern void extract_elisp PARAMS ((FILE *fp, const char *real_filename, - const char *logical_filename, - msgdomain_list_ty *mdlp)); +extern void extract_elisp (FILE *fp, const char *real_filename, + const char *logical_filename, + msgdomain_list_ty *mdlp); /* Handling of options specific to this language. */ -extern void x_elisp_extract_all PARAMS ((void)); -extern void x_elisp_keyword PARAMS ((const char *name)); +extern void x_elisp_extract_all (void); +extern void x_elisp_keyword (const char *name); diff --git a/src/x-glade.c b/src/x-glade.c index 369e07759..3ba11cb88 100644 --- a/src/x-glade.c +++ b/src/x-glade.c @@ -56,11 +56,6 @@ libglade-0.16. */ -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static void init_keywords PARAMS ((void)); - - /* ====================== Keyword set customization. ====================== */ /* If true extract all strings. */ @@ -78,8 +73,7 @@ x_glade_extract_all () void -x_glade_keyword (name) - const char *name; +x_glade_keyword (const char *name) { if (name == NULL) default_keywords = false; @@ -116,29 +110,25 @@ init_keywords () #if DYNLOAD_LIBEXPAT -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static bool load_libexpat PARAMS ((void)); - typedef void *XML_Parser; typedef char XML_Char; typedef char XML_LChar; enum XML_Error { XML_ERROR_NONE }; -typedef void (*XML_StartElementHandler) PARAMS ((void *userData, const XML_Char *name, const XML_Char **atts)); -typedef void (*XML_EndElementHandler) PARAMS ((void *userData, const XML_Char *name)); -typedef void (*XML_CharacterDataHandler) PARAMS ((void *userData, const XML_Char *s, int len)); -typedef void (*XML_CommentHandler) PARAMS ((void *userData, const XML_Char *data)); - -static XML_Parser (*p_XML_ParserCreate) PARAMS ((const XML_Char *encoding)); -static void (*p_XML_SetElementHandler) PARAMS ((XML_Parser parser, XML_StartElementHandler start, XML_EndElementHandler end)); -static void (*p_XML_SetCharacterDataHandler) PARAMS ((XML_Parser parser, XML_CharacterDataHandler handler)); -static void (*p_XML_SetCommentHandler) PARAMS ((XML_Parser parser, XML_CommentHandler handler)); -static int (*p_XML_Parse) PARAMS ((XML_Parser parser, const char *s, int len, int isFinal)); -static enum XML_Error (*p_XML_GetErrorCode) PARAMS ((XML_Parser parser)); -static int (*p_XML_GetCurrentLineNumber) PARAMS ((XML_Parser parser)); -static int (*p_XML_GetCurrentColumnNumber) PARAMS ((XML_Parser parser)); -static void (*p_XML_ParserFree) PARAMS ((XML_Parser parser)); -static const XML_LChar * (*p_XML_ErrorString) PARAMS ((int code)); +typedef void (*XML_StartElementHandler) (void *userData, const XML_Char *name, const XML_Char **atts); +typedef void (*XML_EndElementHandler) (void *userData, const XML_Char *name); +typedef void (*XML_CharacterDataHandler) (void *userData, const XML_Char *s, int len); +typedef void (*XML_CommentHandler) (void *userData, const XML_Char *data); + +static XML_Parser (*p_XML_ParserCreate) (const XML_Char *encoding); +static void (*p_XML_SetElementHandler) (XML_Parser parser, XML_StartElementHandler start, XML_EndElementHandler end); +static void (*p_XML_SetCharacterDataHandler) (XML_Parser parser, XML_CharacterDataHandler handler); +static void (*p_XML_SetCommentHandler) (XML_Parser parser, XML_CommentHandler handler); +static int (*p_XML_Parse) (XML_Parser parser, const char *s, int len, int isFinal); +static enum XML_Error (*p_XML_GetErrorCode) (XML_Parser parser); +static int (*p_XML_GetCurrentLineNumber) (XML_Parser parser); +static int (*p_XML_GetCurrentColumnNumber) (XML_Parser parser); +static void (*p_XML_ParserFree) (XML_Parser parser); +static const XML_LChar * (*p_XML_ErrorString) (int code); #define XML_ParserCreate (*p_XML_ParserCreate) #define XML_SetElementHandler (*p_XML_SetElementHandler) @@ -189,20 +179,6 @@ load_libexpat () #if DYNLOAD_LIBEXPAT || HAVE_LIBEXPAT -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static void ensure_stack_size PARAMS ((size_t size)); -static void start_element_handler PARAMS ((void *userData, const char *name, - const char **attributes)); -static void end_element_handler PARAMS ((void *userData, const char *name)); -static void character_data_handler PARAMS ((void *userData, const char *s, - int len)); -static void comment_handler PARAMS ((void *userData, const char *data)); -static void do_extract_glade PARAMS ((FILE *fp, const char *real_filename, - const char *logical_filename, - msgdomain_list_ty *mdlp)); - - /* Accumulator for the extracted messages. */ static message_list_ty *mlp; @@ -225,8 +201,7 @@ static size_t stack_size; /* Ensures stack_size >= size. */ static void -ensure_stack_size (size) - size_t size; +ensure_stack_size (size_t size) { if (size > stack_size) { @@ -243,10 +218,8 @@ static size_t stack_depth; /* Callback called when is seen. */ static void -start_element_handler (userData, name, attributes) - void *userData; - const char *name; - const char **attributes; +start_element_handler (void *userData, const char *name, + const char **attributes) { struct element_state *p; void *hash_result; @@ -271,9 +244,7 @@ start_element_handler (userData, name, attributes) /* Callback called when is seen. */ static void -end_element_handler (userData, name) - void *userData; - const char *name; +end_element_handler (void *userData, const char *name) { struct element_state *p = &stack[stack_depth]; @@ -309,10 +280,7 @@ end_element_handler (userData, name) /* Callback called when some text is seen. */ static void -character_data_handler (userData, s, len) - void *userData; - const char *s; - int len; +character_data_handler (void *userData, const char *s, int len) { struct element_state *p = &stack[stack_depth]; @@ -333,9 +301,7 @@ character_data_handler (userData, s, len) /* Callback called when some comment text is seen. */ static void -comment_handler (userData, data) - void *userData; - const char *data; +comment_handler (void *userData, const char *data) { /* Split multiline comment into lines, and remove leading and trailing whitespace. */ @@ -364,11 +330,9 @@ comment_handler (userData, data) static void -do_extract_glade (fp, real_filename, logical_filename, mdlp) - FILE *fp; - const char *real_filename; - const char *logical_filename; - msgdomain_list_ty *mdlp; +do_extract_glade (FILE *fp, + const char *real_filename, const char *logical_filename, + msgdomain_list_ty *mdlp) { mlp = mdlp->item[0]->messages; @@ -424,11 +388,9 @@ error while reading \"%s\""), real_filename); #endif void -extract_glade (fp, real_filename, logical_filename, mdlp) - FILE *fp; - const char *real_filename; - const char *logical_filename; - msgdomain_list_ty *mdlp; +extract_glade (FILE *fp, + const char *real_filename, const char *logical_filename, + msgdomain_list_ty *mdlp) { #if DYNLOAD_LIBEXPAT || HAVE_LIBEXPAT if (LIBEXPAT_AVAILABLE ()) diff --git a/src/x-glade.h b/src/x-glade.h index 3d9672a5d..db6ae6f07 100644 --- a/src/x-glade.h +++ b/src/x-glade.h @@ -24,12 +24,12 @@ { "glade", extract_glade, NULL }, \ /* Scan a glade XML file and add its translatable strings to mdlp. */ -extern void extract_glade PARAMS ((FILE *fp, const char *real_filename, - const char *logical_filename, - msgdomain_list_ty *mdlp)); +extern void extract_glade (FILE *fp, const char *real_filename, + const char *logical_filename, + msgdomain_list_ty *mdlp); /* Handling of options specific to this language. */ -extern void x_glade_extract_all PARAMS ((void)); -extern void x_glade_keyword PARAMS ((const char *name)); +extern void x_glade_extract_all (void); +extern void x_glade_keyword (const char *name); diff --git a/src/x-java.h b/src/x-java.h index ddb040c8f..fd30fcd38 100644 --- a/src/x-java.h +++ b/src/x-java.h @@ -1,5 +1,5 @@ /* xgettext Java backend. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Tommy Johansson , 2001. This program is free software; you can redistribute it and/or modify @@ -22,9 +22,9 @@ #define SCANNERS_JAVA \ { "Java", extract_java, &formatstring_java }, \ -extern void extract_java PARAMS ((FILE *fp, const char *real_filename, - const char *logical_filename, - msgdomain_list_ty *mdlp)); +extern void extract_java (FILE *fp, const char *real_filename, + const char *logical_filename, + msgdomain_list_ty *mdlp); -extern void x_java_keyword PARAMS ((const char *keyword)); -extern void x_java_extract_all PARAMS ((void)); +extern void x_java_keyword (const char *keyword); +extern void x_java_extract_all (void); diff --git a/src/x-java.l b/src/x-java.l index e8d9e325a..dee61a2f4 100644 --- a/src/x-java.l +++ b/src/x-java.l @@ -91,31 +91,6 @@ typedef struct _java_keyword } java_keyword; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static char_buf *create_char_buf PARAMS ((void)); -static void append_char_buf PARAMS ((char_buf *b, int c)); -static char *get_string PARAMS ((char_buf *b)); -static void destroy_charbuf PARAMS ((char_buf *b)); -static void update_line_no PARAMS ((int c)); -static void strip_ending_spaces PARAMS ((char *str)); -static char *append_strings PARAMS ((char *a, char *b)); -static inline bool isplus PARAMS ((char *s)); -static inline bool isdot PARAMS ((char *s)); -static char *translate_esc PARAMS ((char *s)); -static object_list * object_list_alloc PARAMS ((void)); -static void object_list_destroy PARAMS ((object_list *list)); -static int get_num_objects PARAMS ((const object_list *list)); -static void * get_object PARAMS ((const object_list *list, int i)); -static void add_object PARAMS ((object_list *list, void *object)); -static java_keyword * alloc_keyword PARAMS ((const char *keyword, - int arg1, int arg2)); -static bool tailcmp PARAMS ((const char *s1, const char *s2)); -static bool do_compare PARAMS ((const char *s1, const char *s2)); -static java_keyword *is_keyword PARAMS ((const char *s)); -static void free_global PARAMS ((void)); - - #define INITIAL_CHARBUF_SIZE 500 #define CHARBUF_GROWTH 100 static char_buf * @@ -130,9 +105,7 @@ create_char_buf () } static void -append_char_buf (b, c) - char_buf *b; - int c; +append_char_buf (char_buf *b, int c) { if (b->len >= b->maxlen - 1) { @@ -144,31 +117,27 @@ append_char_buf (b, c) } static char * -get_string (b) - char_buf *b; +get_string (char_buf *b) { return xstrdup (b->data); } static void -destroy_charbuf (b) - char_buf *b; +destroy_charbuf (char_buf *b) { free (b->data); free (b); } static void -update_line_no (c) - int c; +update_line_no (int c) { if (c == '\n') parser_global->line_no++; } static void -strip_ending_spaces (str) - char *str; +strip_ending_spaces (char *str) { int len = strlen (str); @@ -252,9 +221,7 @@ ID [a-zA-Z_][a-zA-Z0-9_]* %% static char * -append_strings (a, b) - char *a; - char *b; +append_strings (char *a, char *b) { int total_size = strlen (a) + strlen (b) + 1; char *new_string = (char *) xmalloc (total_size); @@ -264,23 +231,20 @@ append_strings (a, b) } static inline bool -isplus (s) - char *s; +isplus (char *s) { return *s == '+'; } static inline bool -isdot (s) - char *s; +isdot (char *s) { return *s == '.'; } static char * -translate_esc (s) - char *s; +translate_esc (char *s) { char *n = (char *) xmalloc (strlen (s) + 1); size_t i; @@ -314,32 +278,26 @@ object_list_alloc () } static void -object_list_destroy (list) - object_list *list; +object_list_destroy (object_list *list) { free (list->objects); free (list); } static int -get_num_objects (list) - const object_list *list; +get_num_objects (const object_list *list) { return list->num_obj; } static void * -get_object (list, i) - const object_list *list; - int i; +get_object (const object_list *list, int i) { return list->objects[i]; } static void -add_object (list, object) - object_list *list; - void *object; +add_object (object_list *list, void *object) { if (list->num_obj + 1 >= list->max_num_obj) { @@ -362,10 +320,7 @@ x_java_extract_all () static java_keyword * -alloc_keyword (keyword, arg1, arg2) - const char *keyword; - int arg1; - int arg2; +alloc_keyword (const char *keyword, int arg1, int arg2) { java_keyword *jk = xmalloc (sizeof (java_keyword)); jk->keyword = xstrdup (keyword); @@ -381,9 +336,7 @@ static object_list *java_keywords = NULL; * Backwards substring match. */ static bool -tailcmp (s1, s2) - const char *s1; - const char *s2; +tailcmp (const char *s1, const char *s2) { int len1 = strlen (s1); int len2 = strlen (s2); @@ -398,9 +351,7 @@ tailcmp (s1, s2) * true substring match is used. */ static bool -do_compare (s1, s2) - const char *s1; - const char *s2; +do_compare (const char *s1, const char *s2) { if (substring_match) return strstr (s1, s2) != NULL; @@ -412,8 +363,7 @@ do_compare (s1, s2) * Check if a string is a keyword or not. */ static java_keyword * -is_keyword (s) - const char *s; +is_keyword (const char *s) { int i; int num_keywords = get_num_objects (java_keywords); @@ -433,8 +383,7 @@ is_keyword (s) * Add a keyword to the list of possible keywords. */ void -x_java_keyword (keyword) - const char *keyword; +x_java_keyword (const char *keyword) { const char *keyword_end; int arg1; @@ -499,11 +448,9 @@ free_global () * Main java keyword extract function. */ void -extract_java (f, real_filename, logical_filename, mdlp) - FILE *f; - const char *real_filename; - const char *logical_filename; - msgdomain_list_ty *mdlp; +extract_java (FILE *f, + const char *real_filename, const char *logical_filename, + msgdomain_list_ty *mdlp) { char *logical_file_name = xstrdup (logical_filename); int token; diff --git a/src/x-librep.c b/src/x-librep.c index 8cf9d1357..06cc2bf9a 100644 --- a/src/x-librep.c +++ b/src/x-librep.c @@ -39,12 +39,6 @@ #define _(s) gettext(s) -#if HAVE_C_BACKSLASH_A -# define ALERT_CHAR '\a' -#else -# define ALERT_CHAR '\7' -#endif - /* Summary of librep syntax: - ';' starts a comment until end of line. @@ -66,26 +60,6 @@ The reader is implemented in librep-0.14/src/lisp.c. */ -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -struct token; -struct object; -static void init_keywords PARAMS ((void)); -static int do_getc PARAMS ((void)); -static void do_ungetc PARAMS ((int c)); -static inline void init_token PARAMS ((struct token *tp)); -static inline void free_token PARAMS ((struct token *tp)); -static inline void grow_token PARAMS ((struct token *tp)); -static bool read_token PARAMS ((struct token *tp, const int *first)); -static inline void comment_start PARAMS ((void)); -static inline void comment_add PARAMS ((int c)); -static inline void comment_line_end PARAMS ((size_t chars_to_remove)); -static inline void free_object PARAMS ((struct object *op)); -static char * string_of_object PARAMS ((const struct object *op)); -static int do_getc_escaped PARAMS ((int c)); -static void read_object PARAMS ((struct object *op)); - - /* ====================== Keyword set customization. ====================== */ /* If true extract all strings. */ @@ -103,8 +77,7 @@ x_librep_extract_all () void -x_librep_keyword (name) - const char *name; +x_librep_keyword (const char *name) { if (name == NULL) default_keywords = false; @@ -179,8 +152,7 @@ error while reading \"%s\""), real_file_name); /* Put back the last fetched character, not EOF. */ static void -do_ungetc (c) - int c; +do_ungetc (int c) { if (c == '\n') line_number--; @@ -201,8 +173,7 @@ struct token /* Initialize a 'struct token'. */ static inline void -init_token (tp) - struct token *tp; +init_token (struct token *tp) { tp->allocated = 10; tp->chars = (char *) xmalloc (tp->allocated * sizeof (char)); @@ -211,16 +182,14 @@ init_token (tp) /* Free the memory pointed to by a 'struct token'. */ static inline void -free_token (tp) - struct token *tp; +free_token (struct token *tp) { free (tp->chars); } /* Ensure there is enough room in the token for one more character. */ static inline void -grow_token (tp) - struct token *tp; +grow_token (struct token *tp) { if (tp->charcount == tp->allocated) { @@ -233,9 +202,7 @@ grow_token (tp) character, which has already been read. Returns true for a symbol, false for a number. */ static bool -read_token (tp, first) - struct token *tp; - const int *first; +read_token (struct token *tp, const int *first) { int c; /* Variables for speculative number parsing: */ @@ -449,8 +416,7 @@ comment_start () } static inline void -comment_add (c) - int c; +comment_add (int c) { if (buflen >= bufmax) { @@ -461,8 +427,7 @@ comment_add (c) } static inline void -comment_line_end (chars_to_remove) - size_t chars_to_remove; +comment_line_end (size_t chars_to_remove) { buflen -= chars_to_remove; while (buflen >= 1 @@ -514,8 +479,7 @@ struct object /* Free the memory pointed to by a 'struct object'. */ static inline void -free_object (op) - struct object *op; +free_object (struct object *op) { if (op->type == t_symbol || op->type == t_string) { @@ -526,8 +490,7 @@ free_object (op) /* Convert a t_symbol/t_string token to a char*. */ static char * -string_of_object (op) - const struct object *op; +string_of_object (const struct object *op) { char *str; int n; @@ -543,8 +506,7 @@ string_of_object (op) /* Returns the character represented by an escape sequence. */ static int -do_getc_escaped (c) - int c; +do_getc_escaped (int c) { switch (c) { @@ -559,7 +521,7 @@ do_getc_escaped (c) case 'v': return '\v'; case 'a': - return ALERT_CHAR; + return '\a'; case '^': c = do_getc (); if (c == EOF) @@ -620,8 +582,7 @@ do_getc_escaped (c) /* Read the next object. */ static void -read_object (op) - struct object *op; +read_object (struct object *op) { for (;;) { @@ -1122,11 +1083,9 @@ read_object (op) void -extract_librep (f, real_filename, logical_filename, mdlp) - FILE *f; - const char *real_filename; - const char *logical_filename; - msgdomain_list_ty *mdlp; +extract_librep (FILE *f, + const char *real_filename, const char *logical_filename, + msgdomain_list_ty *mdlp) { mlp = mdlp->item[0]->messages; diff --git a/src/x-librep.h b/src/x-librep.h index 12ec2ece0..9280d7efd 100644 --- a/src/x-librep.h +++ b/src/x-librep.h @@ -1,5 +1,5 @@ /* xgettext librep backend. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -24,12 +24,12 @@ { "librep", extract_librep, &formatstring_librep }, \ /* Scan a librep file and add its translatable strings to mdlp. */ -extern void extract_librep PARAMS ((FILE *fp, const char *real_filename, - const char *logical_filename, - msgdomain_list_ty *mdlp)); +extern void extract_librep (FILE *fp, const char *real_filename, + const char *logical_filename, + msgdomain_list_ty *mdlp); /* Handling of options specific to this language. */ -extern void x_librep_extract_all PARAMS ((void)); -extern void x_librep_keyword PARAMS ((const char *name)); +extern void x_librep_extract_all (void); +extern void x_librep_keyword (const char *name); diff --git a/src/x-lisp.c b/src/x-lisp.c index 8ea35efa4..6bf61340a 100644 --- a/src/x-lisp.c +++ b/src/x-lisp.c @@ -75,37 +75,6 @@ */ -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -struct char_syntax; -struct token; -struct object; -static void init_keywords PARAMS ((void)); -static int do_getc PARAMS ((void)); -static void do_ungetc PARAMS ((int c)); -static inline void init_token PARAMS ((struct token *tp)); -static inline void free_token PARAMS ((struct token *tp)); -static inline void grow_token PARAMS ((struct token *tp)); -static void read_token PARAMS ((struct token *tp, - const struct char_syntax *first)); -static inline bool has_a_dot PARAMS ((const struct token *tp)); -static inline bool all_a_number PARAMS ((const struct token *tp)); -static inline void a_letter_to_digit PARAMS ((const struct token *tp, - int base)); -static inline bool has_a_digit PARAMS ((const struct token *tp)); -static inline bool has_adjacent_letters PARAMS ((const struct token *tp)); -static bool is_potential_number PARAMS ((const struct token *tp, int *basep)); -static void upcase_token PARAMS ((struct token *tp)); -static void downcase_token PARAMS ((struct token *tp)); -static void case_convert_token PARAMS ((struct token *tp)); -static inline void comment_start PARAMS ((void)); -static inline void comment_add PARAMS ((int c)); -static inline void comment_line_end PARAMS ((size_t chars_to_remove)); -static inline void free_object PARAMS ((struct object *op)); -static char * string_of_object PARAMS ((const struct object *op)); -static void read_object PARAMS ((struct object *op)); - - /* ========================= Lexer customization. ========================= */ /* 'readtable_case' is the case conversion that is applied to non-escaped @@ -149,8 +118,7 @@ x_lisp_extract_all () void -x_lisp_keyword (name) - const char *name; +x_lisp_keyword (const char *name) { if (name == NULL) default_keywords = false; @@ -244,8 +212,7 @@ error while reading \"%s\""), real_file_name); /* Put back the last fetched character, not EOF. */ static void -do_ungetc (c) - int c; +do_ungetc (int c) { if (c == '\n') line_number--; @@ -270,16 +237,9 @@ enum syntax_code syntax_nt_macro /* '#' (non-terminating macro) */ }; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static enum syntax_code - syntax_code_of PARAMS ((/*promote: unsigned char*/ int c)); -static void read_char_syntax PARAMS ((struct char_syntax *p)); - /* Returns the syntax code of a character. */ static enum syntax_code -syntax_code_of (c) - unsigned char c; +syntax_code_of (unsigned char c) { switch (c) { @@ -309,8 +269,7 @@ struct char_syntax /* Returns the next character and its syntax code. */ static void -read_char_syntax (p) - struct char_syntax *p; +read_char_syntax (struct char_syntax *p) { int c = do_getc (); @@ -343,14 +302,9 @@ enum attribute #define is_letter_attribute(a) ((a) >= a_letter) #define is_number_attribute(a) ((a) >= a_ratio) -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static enum attribute attribute_of PARAMS ((/*promote: unsigned char*/ int c)); - /* Returns the attribute of a character, assuming base 10. */ static enum attribute -attribute_of (c) - unsigned char c; +attribute_of (unsigned char c) { switch (c) { @@ -400,8 +354,7 @@ struct token /* Initialize a 'struct token'. */ static inline void -init_token (tp) - struct token *tp; +init_token (struct token *tp) { tp->allocated = 10; tp->chars = @@ -411,16 +364,14 @@ init_token (tp) /* Free the memory pointed to by a 'struct token'. */ static inline void -free_token (tp) - struct token *tp; +free_token (struct token *tp) { free (tp->chars); } /* Ensure there is enough room in the token for one more character. */ static inline void -grow_token (tp) - struct token *tp; +grow_token (struct token *tp) { if (tp->charcount == tp->allocated) { @@ -433,9 +384,7 @@ grow_token (tp) character, which has already been read. The algorithm follows CLHS 2.2 "Reader Algorithm". */ static void -read_token (tp, first) - struct token *tp; - const struct char_syntax *first; +read_token (struct token *tp, const struct char_syntax *first) { bool multiple_escape_flag; struct char_syntax curr; @@ -530,8 +479,7 @@ read_token (tp, first) */ static inline bool -has_a_dot (tp) - const struct token *tp; +has_a_dot (const struct token *tp) { int n = tp->charcount; int i; @@ -543,8 +491,7 @@ has_a_dot (tp) } static inline bool -all_a_number (tp) - const struct token *tp; +all_a_number (const struct token *tp) { int n = tp->charcount; int i; @@ -556,9 +503,7 @@ all_a_number (tp) } static inline void -a_letter_to_digit (tp, base) - const struct token *tp; - int base; +a_letter_to_digit (const struct token *tp, int base) { int n = tp->charcount; int i; @@ -577,8 +522,7 @@ a_letter_to_digit (tp, base) } static inline bool -has_a_digit (tp) - const struct token *tp; +has_a_digit (const struct token *tp) { int n = tp->charcount; int i; @@ -592,8 +536,7 @@ has_a_digit (tp) } static inline bool -has_adjacent_letters (tp) - const struct token *tp; +has_adjacent_letters (const struct token *tp) { int n = tp->charcount; int i; @@ -606,9 +549,7 @@ has_adjacent_letters (tp) } static bool -is_potential_number (tp, basep) - const struct token *tp; - int *basep; +is_potential_number (const struct token *tp, int *basep) { /* CLHS 2.3.1.1.1: "A potential number cannot contain any escape characters." */ @@ -653,14 +594,8 @@ enum number_type n_float }; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static enum number_type is_number PARAMS ((const struct token *tp, int *basep)); - static enum number_type -is_number (tp, basep) - const struct token *tp; - int *basep; +is_number (const struct token *tp, int *basep) { struct token_char *ptr_limit; struct token_char *ptr1; @@ -801,8 +736,7 @@ is_number (tp, basep) For portability, we convert only ASCII characters here. */ static void -upcase_token (tp) - struct token *tp; +upcase_token (struct token *tp) { int n = tp->charcount; int i; @@ -817,8 +751,7 @@ upcase_token (tp) } static void -downcase_token (tp) - struct token *tp; +downcase_token (struct token *tp) { int n = tp->charcount; int i; @@ -833,8 +766,7 @@ downcase_token (tp) } static void -case_convert_token (tp) - struct token *tp; +case_convert_token (struct token *tp) { int n = tp->charcount; int i; @@ -895,8 +827,7 @@ comment_start () } static inline void -comment_add (c) - int c; +comment_add (int c) { if (buflen >= bufmax) { @@ -907,8 +838,7 @@ comment_add (c) } static inline void -comment_line_end (chars_to_remove) - size_t chars_to_remove; +comment_line_end (size_t chars_to_remove) { buflen -= chars_to_remove; while (buflen >= 1 @@ -960,8 +890,7 @@ struct object /* Free the memory pointed to by a 'struct object'. */ static inline void -free_object (op) - struct object *op; +free_object (struct object *op) { if (op->type == t_symbol || op->type == t_string) { @@ -972,8 +901,7 @@ free_object (op) /* Convert a t_symbol/t_string token to a char*. */ static char * -string_of_object (op) - const struct object *op; +string_of_object (const struct object *op) { char *str; const struct token_char *p; @@ -993,8 +921,7 @@ string_of_object (op) /* Read the next object. */ static void -read_object (op) - struct object *op; +read_object (struct object *op) { for (;;) { @@ -1443,11 +1370,9 @@ read_object (op) void -extract_lisp (f, real_filename, logical_filename, mdlp) - FILE *f; - const char *real_filename; - const char *logical_filename; - msgdomain_list_ty *mdlp; +extract_lisp (FILE *f, + const char *real_filename, const char *logical_filename, + msgdomain_list_ty *mdlp) { mlp = mdlp->item[0]->messages; diff --git a/src/x-lisp.h b/src/x-lisp.h index 1c6b02b61..b7377b1f8 100644 --- a/src/x-lisp.h +++ b/src/x-lisp.h @@ -1,5 +1,5 @@ /* xgettext Lisp backend. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -24,12 +24,12 @@ { "Lisp", extract_lisp, &formatstring_lisp }, \ /* Scan a Lisp file and add its translatable strings to mdlp. */ -extern void extract_lisp PARAMS ((FILE *fp, const char *real_filename, - const char *logical_filename, - msgdomain_list_ty *mdlp)); +extern void extract_lisp (FILE *fp, const char *real_filename, + const char *logical_filename, + msgdomain_list_ty *mdlp); /* Handling of options specific to this language. */ -extern void x_lisp_extract_all PARAMS ((void)); -extern void x_lisp_keyword PARAMS ((const char *name)); +extern void x_lisp_extract_all (void); +extern void x_lisp_keyword (const char *name); diff --git a/src/x-php.c b/src/x-php.c index 63a61078d..214269594 100644 --- a/src/x-php.c +++ b/src/x-php.c @@ -61,28 +61,6 @@ struct token_ty }; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static void init_keywords PARAMS ((void)); -static int phase1_getc PARAMS ((void)); -static void phase1_ungetc PARAMS ((int c)); -static void skip_html PARAMS ((void)); -#if 0 -static int phase2_getc PARAMS ((void)); -static void phase2_ungetc PARAMS ((int c)); -#endif -static inline void comment_start PARAMS ((void)); -static inline void comment_add PARAMS ((int c)); -static inline void comment_line_end PARAMS ((size_t chars_to_remove)); -static int phase3_getc PARAMS ((void)); -static void phase3_ungetc PARAMS ((int c)); -static inline void free_token PARAMS ((token_ty *tp)); -static void x_php_lex PARAMS ((token_ty *tp)); -static bool extract_parenthesized PARAMS ((message_list_ty *mlp, - int commas_to_skip, - int plural_commas)); - - /* ====================== Keyword set customization. ====================== */ /* If true extract all strings. */ @@ -100,8 +78,7 @@ x_php_extract_all () void -x_php_keyword (name) - const char *name; +x_php_keyword (const char *name) { if (name == NULL) default_keywords = false; @@ -193,8 +170,7 @@ phase1_getc () } static void -phase1_ungetc (c) - int c; +phase1_ungetc (int c) { if (c != EOF) { @@ -535,8 +511,7 @@ phase2_getc () } static void -phase2_ungetc (c) - int c; +phase2_ungetc (int c) { if (c != EOF) phase2_pushback[phase2_pushback_length++] = c; @@ -558,8 +533,7 @@ comment_start () } static inline void -comment_add (c) - int c; +comment_add (int c) { if (buflen >= bufmax) { @@ -570,8 +544,7 @@ comment_add (c) } static inline void -comment_line_end (chars_to_remove) - size_t chars_to_remove; +comment_line_end (size_t chars_to_remove) { buflen -= chars_to_remove; while (buflen >= 1 @@ -733,8 +706,7 @@ phase3_getc () } static void -phase3_ungetc (c) - int c; +phase3_ungetc (int c) { if (c != EOF) phase3_pushback[phase3_pushback_length++] = c; @@ -743,8 +715,7 @@ phase3_ungetc (c) /* Free the memory pointed to by a 'struct token_ty'. */ static inline void -free_token (tp) - token_ty *tp; +free_token (token_ty *tp) { if (tp->type == token_type_string_literal || tp->type == token_type_symbol) free (tp->string); @@ -754,8 +725,7 @@ free_token (tp) /* 4. Combine characters into tokens. Discard whitespace. */ static void -x_php_lex (tp) - token_ty *tp; +x_php_lex (token_ty *tp) { static char *buffer; static int bufmax; @@ -1207,10 +1177,8 @@ x_php_lex (tp) When no specific argument shall be extracted, COMMAS_TO_SKIP < 0. Return true upon eof, false upon closing parenthesis. */ static bool -extract_parenthesized (mlp, commas_to_skip, plural_commas) - message_list_ty *mlp; - int commas_to_skip; - int plural_commas; +extract_parenthesized (message_list_ty *mlp, + int commas_to_skip, int plural_commas) { /* Remember the message containing the msgid, for msgid_plural. */ message_ty *plural_mp = NULL; @@ -1342,11 +1310,9 @@ extract_parenthesized (mlp, commas_to_skip, plural_commas) void -extract_php (f, real_filename, logical_filename, mdlp) - FILE *f; - const char *real_filename; - const char *logical_filename; - msgdomain_list_ty *mdlp; +extract_php (FILE *f, + const char *real_filename, const char *logical_filename, + msgdomain_list_ty *mdlp) { message_list_ty *mlp = mdlp->item[0]->messages; diff --git a/src/x-php.h b/src/x-php.h index 8583356fc..603e40079 100644 --- a/src/x-php.h +++ b/src/x-php.h @@ -26,9 +26,9 @@ { "PHP", extract_php, &formatstring_php }, \ /* Scan a PHP file and add its translatable strings to mdlp. */ -extern void extract_php PARAMS ((FILE *fp, const char *real_filename, - const char *logical_filename, - msgdomain_list_ty *mdlp)); +extern void extract_php (FILE *fp, const char *real_filename, + const char *logical_filename, + msgdomain_list_ty *mdlp); -extern void x_php_keyword PARAMS ((const char *keyword)); -extern void x_php_extract_all PARAMS ((void)); +extern void x_php_keyword (const char *keyword); +extern void x_php_extract_all (void); diff --git a/src/x-po.c b/src/x-po.c index 85f334a2e..bf7f60e26 100644 --- a/src/x-po.c +++ b/src/x-po.c @@ -1,5 +1,5 @@ /* xgettext PO backend. - Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc. This file was written by Peter Miller @@ -38,24 +38,6 @@ #define _(str) gettext (str) -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static void extract_constructor PARAMS ((po_ty *that)); -static void extract_directive_domain PARAMS ((po_ty *that, char *name)); -static void extract_directive_message PARAMS ((po_ty *that, char *msgid, - lex_pos_ty *msgid_pos, - char *msgid_plural, - char *msgstr, size_t msgstr_len, - lex_pos_ty *msgstr_pos, - bool obsolete)); -static void extract_parse_brief PARAMS ((po_ty *that)); -static void extract_comment PARAMS ((po_ty *that, const char *s)); -static void extract_comment_dot PARAMS ((po_ty *that, const char *s)); -static void extract_comment_filepos PARAMS ((po_ty *that, const char *name, - size_t line)); -static void extract_comment_special PARAMS ((po_ty *that, const char *s)); - - typedef struct extract_class_ty extract_class_ty; struct extract_class_ty { @@ -79,8 +61,7 @@ struct extract_class_ty static void -extract_constructor (that) - po_ty *that; +extract_constructor (po_ty *that) { extract_class_ty *this = (extract_class_ty *) that; size_t i; @@ -98,9 +79,7 @@ extract_constructor (that) static void -extract_directive_domain (that, name) - po_ty *that; - char *name; +extract_directive_domain (po_ty *that, char *name) { po_gram_error_at_line (&gram_pos, _("this file may not contain domain directives")); @@ -108,16 +87,13 @@ extract_directive_domain (that, name) static void -extract_directive_message (that, msgid, msgid_pos, msgid_plural, - msgstr, msgstr_len, msgstr_pos, obsolete) - po_ty *that; - char *msgid; - lex_pos_ty *msgid_pos; - char *msgid_plural; - char *msgstr; - size_t msgstr_len; - lex_pos_ty *msgstr_pos; - bool obsolete; +extract_directive_message (po_ty *that, + char *msgid, + lex_pos_ty *msgid_pos, + char *msgid_plural, + char *msgstr, size_t msgstr_len, + lex_pos_ty *msgstr_pos, + bool obsolete) { extract_class_ty *this = (extract_class_ty *)that; message_ty *mp; @@ -213,17 +189,14 @@ extract_directive_message (that, msgid, msgid_pos, msgid_plural, static void -extract_parse_brief (that) - po_ty *that; +extract_parse_brief (po_ty *that) { po_lex_pass_comments (true); } static void -extract_comment (that, s) - po_ty *that; - const char *s; +extract_comment (po_ty *that, const char *s) { extract_class_ty *this = (extract_class_ty *) that; @@ -234,9 +207,7 @@ extract_comment (that, s) static void -extract_comment_dot (that, s) - po_ty *that; - const char *s; +extract_comment_dot (po_ty *that, const char *s) { extract_class_ty *this = (extract_class_ty *) that; @@ -247,10 +218,7 @@ extract_comment_dot (that, s) static void -extract_comment_filepos (that, name, line) - po_ty *that; - const char *name; - size_t line; +extract_comment_filepos (po_ty *that, const char *name, size_t line) { extract_class_ty *this = (extract_class_ty *) that; size_t nbytes; @@ -269,9 +237,7 @@ extract_comment_filepos (that, name, line) static void -extract_comment_special (that, s) - po_ty *that; - const char *s; +extract_comment_special (po_ty *that, const char *s) { extract_class_ty *this = (extract_class_ty *) that; @@ -303,11 +269,9 @@ static po_method_ty extract_methods = void -extract_po (fp, real_filename, logical_filename, mdlp) - FILE *fp; - const char *real_filename; - const char *logical_filename; - msgdomain_list_ty *mdlp; +extract_po (FILE *fp, + const char *real_filename, const char *logical_filename, + msgdomain_list_ty *mdlp) { po_ty *pop = po_alloc (&extract_methods); ((extract_class_ty *) pop)->mlp = mdlp->item[0]->messages; diff --git a/src/x-po.h b/src/x-po.h index a851172a2..986d6e2da 100644 --- a/src/x-po.h +++ b/src/x-po.h @@ -1,5 +1,5 @@ /* xgettext PO backend. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -25,6 +25,6 @@ { "PO", extract_po, NULL }, \ /* Scan a PO file and add its translatable strings to mdlp. */ -extern void extract_po PARAMS ((FILE *fp, const char *real_filename, - const char *logical_filename, - msgdomain_list_ty *mdlp)); +extern void extract_po (FILE *fp, const char *real_filename, + const char *logical_filename, + msgdomain_list_ty *mdlp); diff --git a/src/x-python.c b/src/x-python.c index 161a10306..5efd314d6 100644 --- a/src/x-python.c +++ b/src/x-python.c @@ -45,12 +45,6 @@ #define _(s) gettext(s) -#if HAVE_C_BACKSLASH_A -# define ALERT_CHAR '\a' -#else -# define ALERT_CHAR '\7' -#endif - /* The Python syntax is defined in the Python Reference Manual /usr/share/doc/packages/python/html/ref/index.html. @@ -78,27 +72,6 @@ struct token_ty }; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static void init_keywords PARAMS ((void)); -static int phase1_getc PARAMS ((void)); -static void phase1_ungetc PARAMS ((int c)); -static inline void comment_start PARAMS ((void)); -static inline void comment_add PARAMS ((int c)); -static inline void comment_line_end PARAMS ((void)); -static int phase2_getc PARAMS ((void)); -static void phase2_ungetc PARAMS ((int c)); -static int phase7_getuc PARAMS ((int quote_char, bool triple, - bool interpret_ansic, bool interpret_unicode, - unsigned int *backslash_counter)); -static void phase5_get PARAMS ((token_ty *tp)); -static void phase5_unget PARAMS ((token_ty *tp)); -static void x_python_lex PARAMS ((token_ty *tp)); -static bool extract_parenthesized PARAMS ((message_list_ty *mlp, - int commas_to_skip, - int plural_commas)); - - /* ====================== Keyword set customization. ====================== */ /* If true extract all strings. */ @@ -116,8 +89,7 @@ x_python_extract_all () void -x_python_keyword (name) - const char *name; +x_python_keyword (const char *name) { if (name == NULL) default_keywords = false; @@ -212,8 +184,7 @@ phase1_getc () } static void -phase1_ungetc (c) - int c; +phase1_ungetc (int c) { if (c != EOF) { @@ -238,8 +209,7 @@ comment_start () } static inline void -comment_add (c) - int c; +comment_add (int c) { /* We assume the program source is in ISO-8859-1 (for consistency with Python's \ooo and \xnn syntax inside strings), but we produce a POT @@ -320,8 +290,7 @@ phase2_getc () } static void -phase2_ungetc (c) - int c; +phase2_ungetc (int c) { phase1_ungetc (c); } @@ -343,12 +312,9 @@ phase2_ungetc (c) #define P7_STRING_END (-2) static int -phase7_getuc (quote_char, triple, interpret_ansic, interpret_unicode, backslash_counter) - int quote_char; - bool triple; - bool interpret_ansic; - bool interpret_unicode; - unsigned int *backslash_counter; +phase7_getuc (int quote_char, + bool triple, bool interpret_ansic, bool interpret_unicode, + unsigned int *backslash_counter) { int c; @@ -437,7 +403,7 @@ phase7_getuc (quote_char, triple, interpret_ansic, interpret_unicode, backslash_ return c; case 'a': *backslash_counter = 0; - return ALERT_CHAR; + return '\a'; case 'b': *backslash_counter = 0; return '\b'; @@ -672,8 +638,7 @@ static token_ty phase5_pushback[2]; static int phase5_pushback_length; static void -phase5_get (tp) - token_ty *tp; +phase5_get (token_ty *tp) { int c; @@ -953,8 +918,7 @@ phase5_get (tp) } static void -phase5_unget (tp) - token_ty *tp; +phase5_unget (token_ty *tp) { if (tp->type != token_type_eof) phase5_pushback[phase5_pushback_length++] = *tp; @@ -966,8 +930,7 @@ phase5_unget (tp) belong to different logical lines will not be concatenated. */ static void -x_python_lex (tp) - token_ty *tp; +x_python_lex (token_ty *tp) { phase5_get (tp); if (tp->type != token_type_string) @@ -1016,10 +979,8 @@ x_python_lex (tp) When no specific argument shall be extracted, COMMAS_TO_SKIP < 0. Return true upon eof, false upon closing parenthesis. */ static bool -extract_parenthesized (mlp, commas_to_skip, plural_commas) - message_list_ty *mlp; - int commas_to_skip; - int plural_commas; +extract_parenthesized (message_list_ty *mlp, + int commas_to_skip, int plural_commas) { /* Remember the message containing the msgid, for msgid_plural. */ message_ty *plural_mp = NULL; @@ -1151,11 +1112,9 @@ extract_parenthesized (mlp, commas_to_skip, plural_commas) void -extract_python (f, real_filename, logical_filename, mdlp) - FILE *f; - const char *real_filename; - const char *logical_filename; - msgdomain_list_ty *mdlp; +extract_python (FILE *f, + const char *real_filename, const char *logical_filename, + msgdomain_list_ty *mdlp) { message_list_ty *mlp = mdlp->item[0]->messages; diff --git a/src/x-python.h b/src/x-python.h index 26b55ac93..e2edeeec4 100644 --- a/src/x-python.h +++ b/src/x-python.h @@ -24,9 +24,9 @@ { "Python", extract_python, &formatstring_python }, \ /* Scan a Python file and add its translatable strings to mdlp. */ -extern void extract_python PARAMS ((FILE *fp, const char *real_filename, - const char *logical_filename, - msgdomain_list_ty *mdlp)); +extern void extract_python (FILE *fp, const char *real_filename, + const char *logical_filename, + msgdomain_list_ty *mdlp); -extern void x_python_keyword PARAMS ((const char *keyword)); -extern void x_python_extract_all PARAMS ((void)); +extern void x_python_keyword (const char *keyword); +extern void x_python_extract_all (void); diff --git a/src/x-rst.c b/src/x-rst.c index cd1ac8618..63ceb7c59 100644 --- a/src/x-rst.c +++ b/src/x-rst.c @@ -1,5 +1,5 @@ /* xgettext RST backend. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. This file was written by Bruno Haible , 2001. @@ -55,11 +55,9 @@ */ void -extract_rst (f, real_filename, logical_filename, mdlp) - FILE *f; - const char *real_filename; - const char *logical_filename; - msgdomain_list_ty *mdlp; +extract_rst (FILE *f, + const char *real_filename, const char *logical_filename, + msgdomain_list_ty *mdlp) { static char *buffer; static int bufmax; diff --git a/src/x-rst.h b/src/x-rst.h index 04a9d9b2f..de0b152bf 100644 --- a/src/x-rst.h +++ b/src/x-rst.h @@ -1,5 +1,5 @@ /* xgettext RST backend. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -24,6 +24,6 @@ { "RST", extract_rst, &formatstring_pascal }, \ /* Scan an RST file and add its translatable strings to mdlp. */ -extern void extract_rst PARAMS ((FILE *fp, const char *real_filename, - const char *logical_filename, - msgdomain_list_ty *mdlp)); +extern void extract_rst (FILE *fp, const char *real_filename, + const char *logical_filename, + msgdomain_list_ty *mdlp); diff --git a/src/x-smalltalk.c b/src/x-smalltalk.c index 6537ac747..d9bdf8020 100644 --- a/src/x-smalltalk.c +++ b/src/x-smalltalk.c @@ -79,18 +79,6 @@ struct token_ty }; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static int phase1_getc PARAMS ((void)); -static void phase1_ungetc PARAMS ((int c)); -static inline void comment_start PARAMS ((void)); -static inline void comment_add PARAMS ((int c)); -static inline void comment_line_end PARAMS ((void)); -static void phase2_get PARAMS ((token_ty *tp)); -static void phase2_unget PARAMS ((token_ty *tp)); -static void x_smalltalk_lex PARAMS ((token_ty *tp)); - - /* ======================== Reading of characters. ======================== */ @@ -127,8 +115,7 @@ phase1_getc () } static void -phase1_ungetc (c) - int c; +phase1_ungetc (int c) { if (c != EOF) { @@ -153,8 +140,7 @@ comment_start () } static inline void -comment_add (c) - int c; +comment_add (int c) { if (buflen >= bufmax) { @@ -193,8 +179,7 @@ static token_ty phase2_pushback[2]; static int phase2_pushback_length; static void -phase2_get (tp) - token_ty *tp; +phase2_get (token_ty *tp) { static char *buffer; static int bufmax; @@ -446,8 +431,7 @@ phase2_get (tp) } static void -phase2_unget (tp) - token_ty *tp; +phase2_unget (token_ty *tp) { if (tp->type != token_type_eof) phase2_pushback[phase2_pushback_length++] = *tp; @@ -457,8 +441,7 @@ phase2_unget (tp) /* 3. Combine "# string_literal" and "# symbol" to a single token. */ static void -x_smalltalk_lex (tp) - token_ty *tp; +x_smalltalk_lex (token_ty *tp) { phase2_get (tp); if (tp->type == token_type_uniq) @@ -492,11 +475,9 @@ x_smalltalk_lex (tp) */ void -extract_smalltalk (f, real_filename, logical_filename, mdlp) - FILE *f; - const char *real_filename; - const char *logical_filename; - msgdomain_list_ty *mdlp; +extract_smalltalk (FILE *f, + const char *real_filename, const char *logical_filename, + msgdomain_list_ty *mdlp) { message_list_ty *mlp = mdlp->item[0]->messages; diff --git a/src/x-smalltalk.h b/src/x-smalltalk.h index 75be85f4f..ca5a9eb5f 100644 --- a/src/x-smalltalk.h +++ b/src/x-smalltalk.h @@ -24,6 +24,6 @@ { "Smalltalk", extract_smalltalk, &formatstring_smalltalk }, \ /* Scan a Smalltalk file and add its translatable strings to mdlp. */ -extern void extract_smalltalk PARAMS ((FILE *fp, const char *real_filename, - const char *logical_filename, - msgdomain_list_ty *mdlp)); +extern void extract_smalltalk (FILE *fp, const char *real_filename, + const char *logical_filename, + msgdomain_list_ty *mdlp); diff --git a/src/x-tcl.c b/src/x-tcl.c index b74463287..8cad4ead8 100644 --- a/src/x-tcl.c +++ b/src/x-tcl.c @@ -45,12 +45,6 @@ #define _(s) gettext(s) -#if HAVE_C_BACKSLASH_A -# define ALERT_CHAR '\a' -#else -# define ALERT_CHAR '\7' -#endif - /* The Tcl syntax is defined in the Tcl.n manual page. Summary of Tcl syntax: @@ -69,30 +63,6 @@ The parser is implemented in tcl8.3.3/generic/tclParse.c. */ -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -struct token; -struct word; -static void init_keywords PARAMS ((void)); -static int do_getc PARAMS ((void)); -static void do_ungetc PARAMS ((int c)); -static int phase1_getc PARAMS ((void)); -static void phase1_ungetc PARAMS ((int c)); -static int phase2_push PARAMS ((void)); -static void phase2_pop PARAMS ((int previous_depth)); -static int phase2_getc PARAMS ((void)); -static void phase2_ungetc PARAMS ((int c)); -static inline void init_token PARAMS ((struct token *tp)); -static inline void free_token PARAMS ((struct token *tp)); -static inline void grow_token PARAMS ((struct token *tp)); -static inline void comment_start PARAMS ((void)); -static inline void comment_add PARAMS ((int c)); -static inline void comment_line_end PARAMS ((void)); -static inline void free_word PARAMS ((struct word *wp)); -static char * string_of_word PARAMS ((const struct word *wp)); -static int do_getc_escaped PARAMS ((void)); - - /* ====================== Keyword set customization. ====================== */ /* If true extract all strings. */ @@ -110,8 +80,7 @@ x_tcl_extract_all () void -x_tcl_keyword (name) - const char *name; +x_tcl_keyword (const char *name) { if (name == NULL) default_keywords = false; @@ -184,8 +153,7 @@ error while reading \"%s\""), real_file_name); /* Put back the last fetched character, not EOF. */ static void -do_ungetc (c) - int c; +do_ungetc (int c) { if (c == '\n') line_number--; @@ -237,8 +205,7 @@ phase1_getc () } static void -phase1_ungetc (c) - int c; +phase1_ungetc (int c) { switch (c) { @@ -283,8 +250,7 @@ phase2_push () } static void -phase2_pop (previous_depth) - int previous_depth; +phase2_pop (int previous_depth) { brace_depth = previous_depth; } @@ -317,8 +283,7 @@ phase2_getc () } static void -phase2_ungetc (c) - int c; +phase2_ungetc (int c) { if (c != EOF) { @@ -355,8 +320,7 @@ struct token /* Initialize a 'struct token'. */ static inline void -init_token (tp) - struct token *tp; +init_token (struct token *tp) { tp->allocated = 10; tp->chars = (char *) xmalloc (tp->allocated * sizeof (char)); @@ -365,16 +329,14 @@ init_token (tp) /* Free the memory pointed to by a 'struct token'. */ static inline void -free_token (tp) - struct token *tp; +free_token (struct token *tp) { free (tp->chars); } /* Ensure there is enough room in the token for one more character. */ static inline void -grow_token (tp) - struct token *tp; +grow_token (struct token *tp) { if (tp->charcount == tp->allocated) { @@ -398,8 +360,7 @@ comment_start () } static inline void -comment_add (c) - int c; +comment_add (int c) { if (buflen >= bufmax) { @@ -461,8 +422,7 @@ struct word /* Free the memory pointed to by a 'struct word'. */ static inline void -free_word (wp) - struct word *wp; +free_word (struct word *wp) { if (wp->type == t_string) { @@ -473,8 +433,7 @@ free_word (wp) /* Convert a t_string token to a char*. */ static char * -string_of_word (wp) - const struct word *wp; +string_of_word (const struct word *wp) { char *str; int n; @@ -502,7 +461,7 @@ do_getc_escaped () case EOF: return '\\'; case 'a': - return ALERT_CHAR; + return '\a'; case 'b': return '\b'; case 'f': @@ -597,20 +556,13 @@ enum terminator te_quote /* looking for '"' */ }; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static int accumulate_word PARAMS ((struct word *wp, - enum terminator looking_for)); -static void read_word PARAMS ((struct word *wp, int looking_for)); -static enum word_type read_command PARAMS ((int looking_for)); -static enum word_type read_command_list PARAMS ((int looking_for)); +/* Forward declaration of local functions. */ +static enum word_type read_command_list (int looking_for); /* Accumulate tokens into the given word. 'looking_for' denotes a parse terminator combination. */ static int -accumulate_word (wp, looking_for) - struct word *wp; - enum terminator looking_for; +accumulate_word (struct word *wp, enum terminator looking_for) { int c; @@ -743,9 +695,7 @@ accumulate_word (wp, looking_for) /* Read the next word. 'looking_for' denotes a parse terminator, either ']' or '\0'. */ static void -read_word (wp, looking_for) - struct word *wp; - int looking_for; +read_word (struct word *wp, int looking_for) { int c; @@ -846,8 +796,7 @@ read_word (wp, looking_for) Returns the type of the word that terminated the command: t_separator or t_bracket (only if looking_for is ']') or t_brace or t_eof. */ static enum word_type -read_command (looking_for) - int looking_for; +read_command (int looking_for) { int c; @@ -979,8 +928,7 @@ read_command (looking_for) Returns the type of the word that terminated the command list: t_bracket (only if looking_for is ']') or t_brace or t_eof. */ static enum word_type -read_command_list (looking_for) - int looking_for; +read_command_list (int looking_for) { for (;;) { @@ -994,11 +942,9 @@ read_command_list (looking_for) void -extract_tcl (f, real_filename, logical_filename, mdlp) - FILE *f; - const char *real_filename; - const char *logical_filename; - msgdomain_list_ty *mdlp; +extract_tcl (FILE *f, + const char *real_filename, const char *logical_filename, + msgdomain_list_ty *mdlp) { mlp = mdlp->item[0]->messages; diff --git a/src/x-tcl.h b/src/x-tcl.h index d2b39f7d0..494171184 100644 --- a/src/x-tcl.h +++ b/src/x-tcl.h @@ -24,12 +24,12 @@ { "Tcl", extract_tcl, &formatstring_tcl }, \ /* Scan a Tcl file and add its translatable strings to mdlp. */ -extern void extract_tcl PARAMS ((FILE *fp, const char *real_filename, - const char *logical_filename, - msgdomain_list_ty *mdlp)); +extern void extract_tcl (FILE *fp, const char *real_filename, + const char *logical_filename, + msgdomain_list_ty *mdlp); /* Handling of options specific to this language. */ -extern void x_tcl_extract_all PARAMS ((void)); -extern void x_tcl_keyword PARAMS ((const char *name)); +extern void x_tcl_extract_all (void); +extern void x_tcl_keyword (const char *name); diff --git a/src/x-ycp.c b/src/x-ycp.c index d41e2b1d7..aa2c36fb1 100644 --- a/src/x-ycp.c +++ b/src/x-ycp.c @@ -81,16 +81,6 @@ static int last_comment_line; static int last_non_comment_line; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static int phase1_getc PARAMS ((void)); -static void phase1_ungetc PARAMS ((int c)); -static int phase2_getc PARAMS ((void)); -static void phase2_ungetc PARAMS ((int c)); -static int phase7_getc PARAMS ((void)); -static void x_ycp_lex PARAMS ((token_ty *tp)); - - /* 1. line_number handling. */ static int @@ -118,8 +108,7 @@ phase1_getc () } static void -phase1_ungetc (c) - int c; +phase1_ungetc (int c) { if (c != EOF) { @@ -299,8 +288,7 @@ phase2_getc () } static void -phase2_ungetc (c) - int c; +phase2_ungetc (int c) { if (c != EOF) phase2_pushback[phase2_pushback_length++] = c; @@ -382,8 +370,7 @@ phase7_getc () /* Combine characters into tokens. Discard whitespace. */ static void -x_ycp_lex (tp) - token_ty *tp; +x_ycp_lex (token_ty *tp) { static char *buffer; static int bufmax; @@ -525,11 +512,9 @@ x_ycp_lex (tp) void -extract_ycp (f, real_filename, logical_filename, mdlp) - FILE *f; - const char *real_filename; - const char *logical_filename; - msgdomain_list_ty *mdlp; +extract_ycp (FILE *f, + const char *real_filename, const char *logical_filename, + msgdomain_list_ty *mdlp) { message_list_ty *mlp = mdlp->item[0]->messages; int state; diff --git a/src/x-ycp.h b/src/x-ycp.h index 36a725c38..3cd31e491 100644 --- a/src/x-ycp.h +++ b/src/x-ycp.h @@ -1,5 +1,5 @@ /* xgettext YCP backend. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -24,6 +24,6 @@ { "YCP", extract_ycp, &formatstring_ycp }, \ /* Scan an YCP file and add its translatable strings to mdlp. */ -extern void extract_ycp PARAMS ((FILE *fp, const char *real_filename, - const char *logical_filename, - msgdomain_list_ty *mdlp)); +extern void extract_ycp (FILE *fp, const char *real_filename, + const char *logical_filename, + msgdomain_list_ty *mdlp); diff --git a/src/xgettext.c b/src/xgettext.c index 52f67477b..8b57e1201 100644 --- a/src/xgettext.c +++ b/src/xgettext.c @@ -177,41 +177,28 @@ static const struct option long_options[] = /* The extractors must all be functions returning void and taking three arguments designating the input stream and one message domain list argument in which to add the messages. */ -typedef void (*extractor_func) PARAMS ((FILE *fp, const char *real_filename, - const char *logical_filename, - msgdomain_list_ty *mdlp)); +typedef void (*extractor_func) (FILE *fp, const char *real_filename, + const char *logical_filename, + msgdomain_list_ty *mdlp); -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static void usage PARAMS ((int status)) +/* Forward declaration of local functions. */ +static void usage (int status) #if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ > 4) || __GNUC__ > 2) __attribute__ ((noreturn)) #endif ; -static void exclude_directive_domain PARAMS ((po_ty *pop, char *name)); -static void exclude_directive_message PARAMS ((po_ty *pop, char *msgid, - lex_pos_ty *msgid_pos, - char *msgid_plural, - char *msgstr, size_t msgstr_len, - lex_pos_ty *msgstr_pos, - bool obsolete)); -static void read_exclusion_file PARAMS ((char *file_name)); -static FILE *xgettext_open PARAMS ((const char *fn, char **logical_file_name_p, - char **real_file_name_p)); -static void extract_from_file PARAMS ((const char *file_name, - extractor_func extractor, - msgdomain_list_ty *mdlp)); -static message_ty *construct_header PARAMS ((void)); -static void finalize_header PARAMS ((msgdomain_list_ty *mdlp)); -static extractor_func language_to_extractor PARAMS ((const char *name)); -static const char *extension_to_language PARAMS ((const char *extension)); +static void read_exclusion_file (char *file_name); +static void extract_from_file (const char *file_name, extractor_func extractor, + msgdomain_list_ty *mdlp); +static message_ty *construct_header (void); +static void finalize_header (msgdomain_list_ty *mdlp); +static extractor_func language_to_extractor (const char *name); +static const char *extension_to_language (const char *extension); int -main (argc, argv) - int argc; - char *argv[]; +main (int argc, char *argv[]) { int cnt; int optchar; @@ -600,8 +587,7 @@ warning: file `%s' extension `%s' is unknown; will try C"), fname, extension); /* Display usage information and exit. */ static void -usage (status) - int status; +usage (int status) { if (status != EXIT_SUCCESS) fprintf (stderr, _("Try `%s --help' for more information.\n"), @@ -718,9 +704,7 @@ Informative output:\n\ static void -exclude_directive_domain (pop, name) - po_ty *pop; - char *name; +exclude_directive_domain (po_ty *pop, char *name) { po_gram_error_at_line (&gram_pos, _("this file may not contain domain directives")); @@ -728,16 +712,13 @@ exclude_directive_domain (pop, name) static void -exclude_directive_message (pop, msgid, msgid_pos, msgid_plural, - msgstr, msgstr_len, msgstr_pos, obsolete) - po_ty *pop; - char *msgid; - lex_pos_ty *msgid_pos; - char *msgid_plural; - char *msgstr; - size_t msgstr_len; - lex_pos_ty *msgstr_pos; - bool obsolete; +exclude_directive_message (po_ty *pop, + char *msgid, + lex_pos_ty *msgid_pos, + char *msgid_plural, + char *msgstr, size_t msgstr_len, + lex_pos_ty *msgstr_pos, + bool obsolete) { message_ty *mp; @@ -783,8 +764,7 @@ static po_method_ty exclude_methods = static void -read_exclusion_file (file_name) - char *file_name; +read_exclusion_file (char *file_name) { po_ty *pop; @@ -795,11 +775,8 @@ read_exclusion_file (file_name) void -split_keywordspec (spec, endp, argnum1p, argnum2p) - const char *spec; - const char **endp; - int *argnum1p; - int *argnum2p; +split_keywordspec (const char *spec, + const char **endp, int *argnum1p, int *argnum2p) { const char *p; @@ -862,8 +839,7 @@ split_keywordspec (spec, endp, argnum1p, argnum2p) static string_list_ty *comment; void -xgettext_comment_add (str) - const char *str; +xgettext_comment_add (const char *str) { if (comment == NULL) comment = string_list_alloc (); @@ -871,8 +847,7 @@ xgettext_comment_add (str) } const char * -xgettext_comment (n) - size_t n; +xgettext_comment (size_t n) { if (comment == NULL || n >= comment->nitems) return NULL; @@ -892,10 +867,8 @@ xgettext_comment_reset () static FILE * -xgettext_open (fn, logical_file_name_p, real_file_name_p) - const char *fn; - char **logical_file_name_p; - char **real_file_name_p; +xgettext_open (const char *fn, + char **logical_file_name_p, char **real_file_name_p) { FILE *fp; char *new_name; @@ -955,10 +928,8 @@ error while opening \"%s\" for reading"), new_name); static void -extract_from_file (file_name, extractor, mdlp) - const char *file_name; - extractor_func extractor; - msgdomain_list_ty *mdlp; +extract_from_file (const char *file_name, extractor_func extractor, + msgdomain_list_ty *mdlp) { char *logical_file_name; char *real_file_name; @@ -1017,10 +988,7 @@ static struct formatstring_parser *current_formatstring_parser; message_ty * -remember_a_message (mlp, string, pos) - message_list_ty *mlp; - char *string; - lex_pos_ty *pos; +remember_a_message (message_list_ty *mlp, char *string, lex_pos_ty *pos) { enum is_format is_format[NFORMATS]; enum is_wrap do_wrap; @@ -1204,10 +1172,7 @@ meta information, not the empty string.\n"))); void -remember_a_message_plural (mp, string, pos) - message_ty *mp; - char *string; - lex_pos_ty *pos; +remember_a_message_plural (message_ty *mp, char *string, lex_pos_ty *pos) { char *msgid_plural; char *msgstr1; @@ -1317,8 +1282,7 @@ FIRST AUTHOR , YEAR.\n"); } static void -finalize_header (mdlp) - msgdomain_list_ty *mdlp; +finalize_header (msgdomain_list_ty *mdlp) { /* If the generated PO file has plural forms, add a Plural-Forms template to the constructed header. */ @@ -1402,8 +1366,7 @@ finalize_header (mdlp) static extractor_func -language_to_extractor (name) - const char *name; +language_to_extractor (const char *name) { typedef struct table_ty table_ty; struct table_ty @@ -1451,8 +1414,7 @@ language_to_extractor (name) static const char * -extension_to_language (extension) - const char *extension; +extension_to_language (const char *extension) { typedef struct table_ty table_ty; struct table_ty diff --git a/src/xgettext.h b/src/xgettext.h index ad36fbd6c..97408b87e 100644 --- a/src/xgettext.h +++ b/src/xgettext.h @@ -39,8 +39,8 @@ extern int xgettext_omit_header; extern bool substring_match; /* Split keyword spec into keyword, argnum1, argnum2. */ -extern void split_keywordspec PARAMS ((const char *spec, const char **endp, - int *argnum1p, int *argnum2p)); +extern void split_keywordspec (const char *spec, const char **endp, + int *argnum1p, int *argnum2p); /* Canonicalized encoding name for all input files. */ extern const char *xgettext_global_source_encoding; @@ -66,21 +66,21 @@ extern message_list_ty *exclude; /* Comment handling: There is a list of automatic comments that may be appended to the next message. Used by remember_a_message(). */ -extern void xgettext_comment_add PARAMS ((const char *str)); -extern const char *xgettext_comment PARAMS ((size_t n)); -extern void xgettext_comment_reset PARAMS ((void)); +extern void xgettext_comment_add (const char *str); +extern const char *xgettext_comment (size_t n); +extern void xgettext_comment_reset (void); /* Add a message to the list of extracted messages. string must be malloc()ed string; its ownership is passed to the callee. pos->file_name must be allocated with indefinite extent. */ -extern message_ty *remember_a_message PARAMS ((message_list_ty *mlp, - char *string, lex_pos_ty *pos)); +extern message_ty *remember_a_message (message_list_ty *mlp, + char *string, lex_pos_ty *pos); /* Add an msgid_plural to a message previously returned by remember_a_message. string must be malloc()ed string; its ownership is passed to the callee. pos->file_name must be allocated with indefinite extent. */ -extern void remember_a_message_plural PARAMS ((message_ty *mp, - char *string, lex_pos_ty *pos)); +extern void remember_a_message_plural (message_ty *mp, + char *string, lex_pos_ty *pos); #endif /* _XGETTEXT_H */ diff --git a/tests/ChangeLog b/tests/ChangeLog index 8050d31ac..0e3b44a41 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,24 @@ +2002-11-13 Bruno Haible + + Assume ANSI C. + * format-c-3-prg.c (main): Use ANSI C function declarations and + preprocessor string concatenation. + * format-c-3: Don't test for return code 77. + * format-c-4-prg.c (main): Use ANSI C function declarations and + preprocessor string concatenation. + * format-c-4: Don't test for return code 77. + * plural-1-prg.c (main): Use ANSI C function declarations. + * setlocale.c (category_to_name, setlocale): Likewise. + * tstgettext.c (main, usage, expand_escape): Likewise. + * tstngettext.c (main, usage): Likewise. + * rpathlx/usex.c (rpathx_value): Likewise. + * rpathly/usey.c (rpathy_value): Likewise. + * rpathlyx/usey.c (rpathy_value): Likewise. + * rpathlz/usez.c (rpathz_value): Likewise. + * rpathlzyx/usez.c (rpathz_value): Likewise. + * rpathy/rpathy.c (rpathx_value): Likewise. + * rpathz/rpathz.c (rpathx_value, rpathy_value): Likewise. + 2002-11-11 Bruno Haible * tstgettext.c (program_name): Declare as external. diff --git a/tests/format-c-3 b/tests/format-c-3 index 35b385524..4d705b004 100755 --- a/tests/format-c-3 +++ b/tests/format-c-3 @@ -46,10 +46,6 @@ ${DIFF} de.po.strip de.po.tmp || exit 1 LANGUAGE= ./fc3 de_DE result=$? -if test $result = 77; then - echo "SKIP: format-c-3" -fi - rm -fr $tmpfiles exit $result diff --git a/tests/format-c-3-prg.c b/tests/format-c-3-prg.c index 0814b7cc0..629f71678 100644 --- a/tests/format-c-3-prg.c +++ b/tests/format-c-3-prg.c @@ -40,12 +40,9 @@ # define PRId8 "d" #endif -int main (argc, argv) - int argc; - char *argv[]; +int +main (int argc, char *argv[]) { -/* This test requires ANSI C string concatenation. */ -#ifdef __STDC__ unsigned char n = 5; const char *s; const char *c1; @@ -84,7 +81,4 @@ int main (argc, argv) exit (1); } return 0; -#else - exit (77); -#endif } diff --git a/tests/format-c-4 b/tests/format-c-4 index f31c017d9..78fa50a07 100755 --- a/tests/format-c-4 +++ b/tests/format-c-4 @@ -50,10 +50,6 @@ ${DIFF} de.po.strip de.po.tmp || exit 1 LANGUAGE= ./fc4 de_DE result=$? -if test $result = 77; then - echo "SKIP: format-c-4" -fi - rm -fr $tmpfiles exit $result diff --git a/tests/format-c-4-prg.c b/tests/format-c-4-prg.c index b91d97b19..7d1f055bf 100644 --- a/tests/format-c-4-prg.c +++ b/tests/format-c-4-prg.c @@ -40,12 +40,9 @@ # define PRId8 "d" #endif -int main (argc, argv) - int argc; - char *argv[]; +int +main (int argc, char *argv[]) { -/* This test requires ANSI C string concatenation. */ -#ifdef __STDC__ unsigned char n = 5; const char *s; const char *c1; @@ -84,7 +81,4 @@ int main (argc, argv) exit (1); } return 0; -#else - exit (77); -#endif } diff --git a/tests/plural-1-prg.c b/tests/plural-1-prg.c index e1acd2db7..82f372b3a 100644 --- a/tests/plural-1-prg.c +++ b/tests/plural-1-prg.c @@ -28,9 +28,8 @@ #undef _LIBINTL_H #include "libgnuintl.h" -int main (argc, argv) - int argc; - char *argv[]; +int +main (int argc, char *argv[]) { int n = atoi (argv[2]); diff --git a/tests/rpathlx/usex.c b/tests/rpathlx/usex.c index 674e70ff2..d09b11176 100644 --- a/tests/rpathlx/usex.c +++ b/tests/rpathlx/usex.c @@ -1,2 +1,2 @@ -extern int rpathx_value (); +extern int rpathx_value (void); int main () { return !(rpathx_value () == 5); } diff --git a/tests/rpathly/usey.c b/tests/rpathly/usey.c index d3fe71d11..9fff7871b 100644 --- a/tests/rpathly/usey.c +++ b/tests/rpathly/usey.c @@ -1,2 +1,2 @@ -extern int rpathy_value (); +extern int rpathy_value (void); int main () { return !(rpathy_value () == 57); } diff --git a/tests/rpathlyx/usey.c b/tests/rpathlyx/usey.c index d3fe71d11..9fff7871b 100644 --- a/tests/rpathlyx/usey.c +++ b/tests/rpathlyx/usey.c @@ -1,2 +1,2 @@ -extern int rpathy_value (); +extern int rpathy_value (void); int main () { return !(rpathy_value () == 57); } diff --git a/tests/rpathlz/usez.c b/tests/rpathlz/usez.c index 000f336a1..18d86897b 100644 --- a/tests/rpathlz/usez.c +++ b/tests/rpathlz/usez.c @@ -1,2 +1,2 @@ -extern int rpathz_value (); +extern int rpathz_value (void); int main () { return !(rpathz_value () == 5171); } diff --git a/tests/rpathlzyx/usez.c b/tests/rpathlzyx/usez.c index 000f336a1..18d86897b 100644 --- a/tests/rpathlzyx/usez.c +++ b/tests/rpathlzyx/usez.c @@ -1,2 +1,2 @@ -extern int rpathz_value (); +extern int rpathz_value (void); int main () { return !(rpathz_value () == 5171); } diff --git a/tests/rpathy/rpathy.c b/tests/rpathy/rpathy.c index 7369d80bc..42514bf1a 100644 --- a/tests/rpathy/rpathy.c +++ b/tests/rpathy/rpathy.c @@ -1,2 +1,2 @@ -extern int rpathx_value (); +extern int rpathx_value (void); int rpathy_value () { return 10 * rpathx_value () + 7; } diff --git a/tests/rpathz/rpathz.c b/tests/rpathz/rpathz.c index 80f3a4475..da34af1c8 100644 --- a/tests/rpathz/rpathz.c +++ b/tests/rpathz/rpathz.c @@ -1,3 +1,3 @@ -extern int rpathx_value (); -extern int rpathy_value (); +extern int rpathx_value (void); +extern int rpathy_value (void); int rpathz_value () { return 1000 * rpathx_value () + 3 * rpathy_value (); } diff --git a/tests/setlocale.c b/tests/setlocale.c index 71d2637ce..f48d1f56f 100644 --- a/tests/setlocale.c +++ b/tests/setlocale.c @@ -1,5 +1,5 @@ /* Fake setlocale - platform independent, for testing purposes. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001-2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,8 +25,7 @@ /* Return string representation of locale CATEGORY. */ static const char * -category_to_name (category) - int category; +category_to_name (int category) { const char *retval; @@ -86,9 +85,7 @@ category_to_name (category) actually change the behaviour of locale dependent functions. Assumes setenv()/putenv() is not called. */ char * -setlocale (category, locale) - int category; - SETLOCALE_CONST char *locale; +setlocale (int category, SETLOCALE_CONST char *locale) { static char C_string[] = "C"; static char *current_locale = C_string; diff --git a/tests/tstgettext.c b/tests/tstgettext.c index 2cb102a6d..4fdfb1c50 100644 --- a/tests/tstgettext.c +++ b/tests/tstgettext.c @@ -61,19 +61,16 @@ static const struct option long_options[] = { NULL, 0, NULL, 0 } }; -/* Prototypes for local functions. Needed to ensure compiler checking of - function argument counts despite of K&R C function definition syntax. */ -static void usage PARAMS ((int status)) +/* Forward declaration of local functions. */ +static void usage (int status) #if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2) __attribute__ ((noreturn)) #endif ; -static const char *expand_escape PARAMS ((const char *str)); +static const char *expand_escape (const char *str); int -main (argc, argv) - int argc; - char *argv[]; +main (int argc, char *argv[]) { int optchar; const char *msgid; @@ -259,8 +256,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ /* Display usage information and exit. */ static void -usage (status) - int status; +usage (int status) { if (status != EXIT_SUCCESS) fprintf (stderr, _("Try `%s --help' for more information.\n"), @@ -309,8 +305,7 @@ Standard search directory: %s\n"), /* Expand some escape sequences found in the argument string. */ static const char * -expand_escape (str) - const char *str; +expand_escape (const char *str) { char *retval, *rp; const char *cp = str; diff --git a/tests/tstngettext.c b/tests/tstngettext.c index 669944b25..a7429c248 100644 --- a/tests/tstngettext.c +++ b/tests/tstngettext.c @@ -51,17 +51,15 @@ static const struct option long_options[] = { NULL, 0, NULL, 0 } }; -/* Prototypes for local functions. */ -static void usage PARAMS ((int __status)) +/* Forward declaration of local functions. */ +static void usage (int __status) #if defined __GNUC__ && ((__GNUC__ == 2 && __GNUC_MINOR__ >= 5) || __GNUC__ > 2) __attribute__ ((noreturn)) #endif ; int -main (argc, argv) - int argc; - char *argv[]; +main (int argc, char *argv[]) { int optchar; const char *msgid; @@ -196,8 +194,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ /* Display usage information and exit. */ static void -usage (status) - int status; +usage (int status) { if (status != EXIT_SUCCESS) fprintf (stderr, _("Try `%s --help' for more information.\n"),