From: Nathanael Nerode Date: Fri, 1 Aug 2003 23:07:04 +0000 (+0000) Subject: fixfixes.c, [...]: ANSIfy function prototypes and defintions. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f4dbf936c77b638c3e61a22cbc4f45f8ae0c0d87;p=gcc.git fixfixes.c, [...]: ANSIfy function prototypes and defintions. * fixinc/fixfixes.c, fixinc/fixlib.c, fixinc/fixlib.h, fixinc/fixtests.c, fixinc/procopen.c, fixinc/server.c, fixinc/server.h, fixinc/fixincl.c: ANSIfy function prototypes and defintions. Add missed (?!) ChangeLog entry from previous commit earlier today: * fixinc/inclhack.def (broken_cabs): Make matching more generous. * fixinc/fixincl.x: Regenerate. * fixinc/tests/base/math.h: Regenerate to match test_text change. From-SVN: r70078 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c0846f744f3..3122423a955 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2003-08-01 Nathanael Nerode + + * fixinc/fixfixes.c, fixinc/fixlib.c, fixinc/fixlib.h, + fixinc/fixtests.c, fixinc/procopen.c, fixinc/server.c, + fixinc/server.h, fixinc/fixincl.c: ANSIfy function prototypes + and defintions. + + * fixinc/inclhack.def (broken_cabs): Make matching more generous. + * fixinc/fixincl.x: Regenerate. + * fixinc/tests/base/math.h: Regenerate to match test_text change. + 2003-08-01 Rainer Orth * ggc-common.c (gt_pch_restore): Case MAP_FAILED to void *. diff --git a/gcc/fixinc/fixfixes.c b/gcc/fixinc/fixfixes.c index 4ee57602b29..a8901ffdf0f 100644 --- a/gcc/fixinc/fixfixes.c +++ b/gcc/fixinc/fixfixes.c @@ -59,7 +59,7 @@ Boston, MA 02111-1307, USA. */ tSCC zNeedsArg[] = "fixincl error: `%s' needs %s argument (c_fix_arg[%d])\n"; -typedef void t_fix_proc PARAMS ((const char *, const char *, tFixDesc *)); +typedef void t_fix_proc (const char *, const char *, tFixDesc *) ; typedef struct { const char* fix_name; t_fix_proc* fix_proc; @@ -74,12 +74,10 @@ typedef struct { _FT_( "gnu_type", gnu_type_fix ) -#define FIX_PROC_HEAD( fix ) \ -static void fix PARAMS ((const char *, const char *, tFixDesc *)); \ -static void fix ( filname, text, p_fixd ) \ - const char* filname ATTRIBUTE_UNUSED; \ - const char* text ATTRIBUTE_UNUSED; \ - tFixDesc* p_fixd ATTRIBUTE_UNUSED; +#define FIX_PROC_HEAD( fix ) \ +static void fix (const char* filname ATTRIBUTE_UNUSED , \ + const char* text ATTRIBUTE_UNUSED , \ + tFixDesc* p_fixd ATTRIBUTE_UNUSED ) #ifdef NEED_PRINT_QUOTE /* @@ -89,9 +87,7 @@ static void fix ( filname, text, p_fixd ) \ * We are not doing a correctness syntax check here. */ static char* -print_quote( q, text ) - char q; - char* text; +print_quote(char q, char* text ) { fputc( q, stdout ); @@ -131,11 +127,8 @@ print_quote( q, text ) * this thing can be encountered countless times during a compile * and not cause even a warning. */ -static const char *emit_gnu_type PARAMS ((const char *, regmatch_t *)); static const char* -emit_gnu_type ( text, rm ) - const char* text; - regmatch_t* rm; +emit_gnu_type (const char* text, regmatch_t* rm ) { char z_TYPE[ 64 ]; char z_type[ 64 ]; @@ -182,12 +175,8 @@ typedef __%s_TYPE__ %s_t;\n\ * '%' characters in other contexts and all other characters are * copied out verbatim. */ -static void format_write PARAMS ((tCC *, tCC *, regmatch_t[])); static void -format_write (format, text, av) - tCC* format; - tCC* text; - regmatch_t av[]; +format_write (tCC* format, tCC* text, regmatch_t av[] ) { int c; @@ -710,9 +699,7 @@ FIX_PROC_HEAD( gnu_type_fix ) */ void -apply_fix( p_fixd, filname ) - tFixDesc* p_fixd; - tCC* filname; +apply_fix( tFixDesc* p_fixd, tCC* filname ) { #define _FT_(n,p) { n, p }, static fix_entry_t fix_table[] = { FIXUP_TABLE { NULL, NULL }}; @@ -748,9 +735,7 @@ tSCC z_reopen[] = "FS error %d (%s) reopening %s as std%s\n"; int -main( argc, argv ) - int argc; - char** argv; +main( int argc, char** argv ) { tFixDesc* pFix; char* pz_tmptmp; diff --git a/gcc/fixinc/fixincl.c b/gcc/fixinc/fixincl.c index 92abcac49b9..2d24c17237c 100644 --- a/gcc/fixinc/fixincl.c +++ b/gcc/fixinc/fixincl.c @@ -94,11 +94,11 @@ const char incl_quote_pat[] = "^[ \t]*#[ \t]*include[ \t]*\"[^/]"; tSCC z_fork_err[] = "Error %d (%s) starting filter process for %s\n"; regex_t incl_quote_re; -static void do_version PARAMS((void)) ATTRIBUTE_NORETURN; -char *load_file PARAMS((const char *)); -void run_compiles PARAMS((void)); -void initialize PARAMS((int argc,char** argv)); -void process PARAMS((void)); +static void do_version (void) ATTRIBUTE_NORETURN; +char *load_file (const char *); +void run_compiles (void); +void initialize (int argc, char** argv); +void process (void); /* External Source Code */ @@ -108,11 +108,9 @@ void process PARAMS((void)); * * MAIN ROUTINE */ -extern int main PARAMS ((int, char **)); +extern int main (int, char **); int -main (argc, argv) - int argc; - char **argv; +main (int argc, char** argv) { char *file_name_buf; @@ -191,7 +189,7 @@ Altering %5d of them\n"; static void -do_version () +do_version (void) { static const char zFmt[] = "echo '%s'"; char zBuf[ 1024 ]; @@ -214,9 +212,7 @@ do_version () /* * * * * * * * * * * * */ void -initialize ( argc, argv ) - int argc; - char** argv; +initialize ( int argc, char** argv ) { static const char var_not_found[] = #ifndef __STDC__ @@ -335,8 +331,7 @@ ENV_TABLE result is the NUL terminated contents of the file. The file is presumed to be an ASCII text file containing no NULs. */ char * -load_file ( fname ) - const char* fname; +load_file ( const char* fname ) { struct stat stbf; char* res; @@ -389,10 +384,8 @@ load_file ( fname ) return res; } -static int machine_matches PARAMS ((tFixDesc *)); static int -machine_matches( p_fixd ) - tFixDesc *p_fixd; +machine_matches( tFixDesc* p_fixd ) { # ifndef SEPARATE_FIX_PROC tSCC case_fmt[] = "case %s in\n"; /* 9 bytes, plus string */ @@ -484,7 +477,7 @@ machine_matches( p_fixd ) run_compiles run all the regexp compiles for all the fixes once. */ void -run_compiles () +run_compiles (void) { tFixDesc *p_fixd = fixDescList; int fix_ct = FIX_COUNT; @@ -561,9 +554,8 @@ run_compiles () #endif -static FILE *create_file PARAMS ((void)); static FILE * -create_file () +create_file (void) { int fd; FILE *pf; @@ -626,11 +618,8 @@ create_file () Result: APPLY_FIX or SKIP_FIX, depending on the result of the shell script we run. */ #ifndef SEPARATE_FIX_PROC -static int test_test PARAMS ((tTestDesc *, char *)); static int -test_test (p_test, pz_test_file) - tTestDesc *p_test; - char* pz_test_file; +test_test (tTestDesc* p_test, char* pz_test_file) { tSCC cmd_fmt[] = "file=%s\n\ @@ -682,11 +671,8 @@ fi"; The caller may choose to reverse meaning if the sense of the test is inverted. */ -static int egrep_test PARAMS ((char *, tTestDesc *)); static int -egrep_test (pz_data, p_test) - char *pz_data; - tTestDesc *p_test; +egrep_test (char* pz_data, tTestDesc* p_test) { #ifdef DEBUG if (p_test->p_test_regex == 0) @@ -705,12 +691,10 @@ egrep_test (pz_data, p_test) the file name. If we emit the name, our invoking shell will try to copy a non-existing file into the destination directory. */ -static int quoted_file_exists PARAMS ((const char *, const char *, const char *)); static int -quoted_file_exists (pz_src_path, pz_file_path, pz_file) - const char *pz_src_path; - const char *pz_file_path; - const char *pz_file; +quoted_file_exists (const char* pz_src_path, + const char* pz_file_path, + const char* pz_file) { char z[ MAXPATHLEN ]; char* pz; @@ -757,12 +741,10 @@ quoted_file_exists (pz_src_path, pz_file_path, pz_file) for interpretation by the invoking shell */ -static void extract_quoted_files PARAMS ((char *, const char *, regmatch_t *)); static void -extract_quoted_files (pz_data, pz_fixed_file, p_re_match) - char *pz_data; - const char *pz_fixed_file; - regmatch_t *p_re_match; +extract_quoted_files (char* pz_data, + const char* pz_fixed_file, + regmatch_t* p_re_match) { char *pz_dir_end = strrchr (pz_fixed_file, '/'); char *pz_incl_quot = pz_data; @@ -819,11 +801,8 @@ extract_quoted_files (pz_data, pz_fixed_file, p_re_match) Somebody wrote a *_fix subroutine that we must call. */ #ifndef SEPARATE_FIX_PROC -static int internal_fix PARAMS ((int, tFixDesc *)); static int -internal_fix (read_fd, p_fixd) - int read_fd; - tFixDesc* p_fixd; +internal_fix (int read_fd, tFixDesc* p_fixd) { int fd[2]; @@ -890,11 +869,10 @@ internal_fix (read_fd, p_fixd) #ifdef SEPARATE_FIX_PROC static void -fix_with_system (p_fixd, pz_fix_file, pz_file_source, pz_temp_file) - tFixDesc* p_fixd; - tCC* pz_fix_file; - tCC* pz_file_source; - tCC* pz_temp_file; +fix_with_system (tFixDesc* p_fixd, + tCC* pz_fix_file, + tCC* pz_file_source, + tCC* pz_temp_file) { char* pz_cmd; char* pz_scan; @@ -1040,12 +1018,8 @@ fix_with_system (p_fixd, pz_fix_file, pz_file_source, pz_temp_file) for stdout. */ #else /* is *NOT* SEPARATE_FIX_PROC */ -static int start_fixer PARAMS ((int, tFixDesc *, char *)); static int -start_fixer (read_fd, p_fixd, pz_fix_file) - int read_fd; - tFixDesc* p_fixd; - char* pz_fix_file; +start_fixer (int read_fd, tFixDesc* p_fixd, char* pz_fix_file) { tCC* pz_cmd_save; char* pz_cmd; @@ -1114,10 +1088,8 @@ start_fixer (read_fd, p_fixd, pz_fix_file) Input: the original text of the file and the file's name Result: none. A new file may or may not be created. */ -static t_bool fix_applies PARAMS ((tFixDesc *)); static t_bool -fix_applies (p_fixd) - tFixDesc *p_fixd; +fix_applies (tFixDesc* p_fixd) { const char *pz_fname = pz_curr_file; const char *pz_scan = p_fixd->file_list; @@ -1229,10 +1201,8 @@ fix_applies (p_fixd) Write out a replacement file */ -static void write_replacement PARAMS ((tFixDesc *)); static void -write_replacement (p_fixd) - tFixDesc *p_fixd; +write_replacement (tFixDesc* p_fixd) { const char* pz_text = p_fixd->patch_args[0]; @@ -1256,10 +1226,8 @@ write_replacement (p_fixd) the matched text and then copy any remaining data from the output of the filter chain. */ -static void test_for_changes PARAMS ((int)); static void -test_for_changes (read_fd) - int read_fd; +test_for_changes (int read_fd) { FILE *in_fp = fdopen (read_fd, "r"); FILE *out_fp = (FILE *) NULL; @@ -1330,7 +1298,7 @@ test_for_changes (read_fd) Result: none. A new file may or may not be created. */ void -process () +process (void) { tFixDesc *p_fixd = fixDescList; int todo_ct = FIX_COUNT; diff --git a/gcc/fixinc/fixlib.c b/gcc/fixinc/fixlib.c index 32f65d9d67a..99d04cc5531 100644 --- a/gcc/fixinc/fixlib.c +++ b/gcc/fixinc/fixlib.c @@ -32,8 +32,7 @@ Boston, MA 02111-1307, USA. */ is presumed to be an ASCII text file containing no NULs. */ char * -load_file_data (fp) - FILE* fp; +load_file_data (FILE* fp) { char *pz_data = (char*)NULL; int space_left = -1; /* allow for terminating NUL */ @@ -81,9 +80,7 @@ load_file_data (fp) #ifdef IS_CXX_HEADER_NEEDED t_bool -is_cxx_header (fname, text) - tCC *fname; - tCC *text; +is_cxx_header (tCC* fname, tCC* text) { /* First, check to see if the file is in a C++ directory */ for (;;) @@ -147,9 +144,7 @@ template[ \t]*<|\ * We are not doing a correctness syntax check here. */ tCC* -skip_quote( q, text ) - char q; - char* text; +skip_quote(char q, char* text ) { for (;;) { @@ -188,12 +183,7 @@ skip_quote( q, text ) REG_EXTENDED|REG_NEWLINE produces identical regex syntax/semantics to egrep (verified from 4.4BSD Programmer's Reference Manual). */ void -compile_re( pat, re, match, e1, e2 ) - tCC *pat; - regex_t *re; - int match; - tCC *e1; - tCC *e2; +compile_re( tCC* pat, regex_t* re, int match, tCC* e1, tCC* e2 ) { tSCC z_bad_comp[] = "fixincl ERROR: cannot compile %s regex for %s\n\ \texpr = `%s'\n\terror %s\n"; @@ -228,10 +218,7 @@ static regex_t mn_name_re; static int mn_compiled = 0; void -mn_get_regexps( label_re, name_re, who ) - regex_t **label_re; - regex_t **name_re; - tCC *who; +mn_get_regexps(regex_t** label_re, regex_t** name_re, tCC* who ) { if (! mn_compiled) { @@ -248,10 +235,7 @@ mn_get_regexps( label_re, name_re, who ) #ifdef SEPARATE_FIX_PROC char* -make_raw_shell_str( pz_d, pz_s, smax ) - char* pz_d; - tCC* pz_s; - size_t smax; +make_raw_shell_str( char* pz_d, tCC* pz_s, size_t smax ) { tSCC zQ[] = "'\\''"; size_t dtaSize; diff --git a/gcc/fixinc/fixlib.h b/gcc/fixinc/fixlib.h index 6287a2b8e56..25e97d48ba1 100644 --- a/gcc/fixinc/fixlib.h +++ b/gcc/fixinc/fixlib.h @@ -199,31 +199,27 @@ extern int gnu_type_map_ct; /* * Exported procedures */ -char * load_file_data PARAMS(( FILE* fp )); +char * load_file_data ( FILE* fp ); #ifdef IS_CXX_HEADER_NEEDED -t_bool is_cxx_header PARAMS(( tCC* filename, tCC* filetext )); +t_bool is_cxx_header ( tCC* filename, tCC* filetext ); #endif /* IS_CXX_HEADER_NEEDED */ #ifdef SKIP_QUOTE_NEEDED -tCC* skip_quote PARAMS(( char q, char* text )); +tCC* skip_quote ( char q, char* text ); #endif -void compile_re PARAMS(( tCC* pat, regex_t* re, int match, - tCC *e1, tCC *e2 )); +void compile_re ( tCC* pat, regex_t* re, int match, tCC *e1, tCC *e2 ); -void apply_fix PARAMS(( tFixDesc* p_fixd, tCC* filname )); +void apply_fix ( tFixDesc* p_fixd, tCC* filname ); apply_fix_p_t - run_test PARAMS(( tCC* t_name, tCC* f_name, tCC* text )); + run_test ( tCC* t_name, tCC* f_name, tCC* text ); #ifdef SEPARATE_FIX_PROC -char* make_raw_shell_str - PARAMS(( char* pz_d, tCC* pz_s, size_t smax )); +char* make_raw_shell_str ( char* pz_d, tCC* pz_s, size_t smax ); #endif #ifdef MN_NAME_PAT -void mn_get_regexps - PARAMS(( regex_t** label_re, regex_t** name_re, - tCC *who )); +void mn_get_regexps ( regex_t** label_re, regex_t** name_re, tCC *who ); #endif #endif /* ! GCC_FIXLIB_H */ diff --git a/gcc/fixinc/fixtests.c b/gcc/fixinc/fixtests.c index 92bc10cc9d3..33ea65208f9 100644 --- a/gcc/fixinc/fixtests.c +++ b/gcc/fixinc/fixtests.c @@ -51,7 +51,7 @@ Boston, MA 02111-1307, USA. */ ENV_TABLE #undef _ENV_ -typedef apply_fix_p_t t_test_proc PARAMS(( tCC* file, tCC* text )); +typedef apply_fix_p_t t_test_proc ( tCC* file, tCC* text ); typedef struct { tCC* test_name; @@ -62,12 +62,9 @@ typedef struct { _FT_( "machine_name", machine_name_test ) \ _FT_( "stdc_0_in_system_headers", stdc_0_in_system_headers_test ) -#define TEST_FOR_FIX_PROC_HEAD( test ) \ -static apply_fix_p_t test PARAMS(( tCC* file, tCC* text )); \ -static apply_fix_p_t test ( fname, text ) \ - tCC* fname ATTRIBUTE_UNUSED; \ - tCC* text ATTRIBUTE_UNUSED; - +#define TEST_FOR_FIX_PROC_HEAD( test ) \ +static apply_fix_p_t test ( tCC* fname ATTRIBUTE_UNUSED, \ + tCC* text ATTRIBUTE_UNUSED ) TEST_FOR_FIX_PROC_HEAD( machine_name_test ) { @@ -139,10 +136,7 @@ TEST_FOR_FIX_PROC_HEAD( stdc_0_in_system_headers_test ) */ apply_fix_p_t -run_test( tname, fname, text ) - tCC* tname; - tCC* fname; - tCC* text; +run_test( tCC* tname, tCC* fname, tCC* text ) { #define _FT_(n,p) { n, p }, static test_entry_t test_table[] = { FIX_TEST_TABLE { NULL, NULL }}; diff --git a/gcc/fixinc/procopen.c b/gcc/fixinc/procopen.c index a8b5ca11075..6fdb24fec7e 100644 --- a/gcc/fixinc/procopen.c +++ b/gcc/fixinc/procopen.c @@ -62,10 +62,7 @@ STATIC const char* def_args[] = * to store the child's process id. */ int -chain_open (stdin_fd, pp_args, p_child) - int stdin_fd; - tCC **pp_args; - pid_t *p_child; +chain_open (int stdin_fd, tCC** pp_args, pid_t* p_child) { t_fd_pair stdout_pair; pid_t ch_id; @@ -182,9 +179,7 @@ chain_open (stdin_fd, pp_args, p_child) * The return value is the process id of the created process. */ pid_t -proc2_open (p_pair, pp_args) - t_fd_pair *p_pair; - tCC **pp_args; +proc2_open (t_fd_pair* p_pair, tCC** pp_args) { pid_t ch_id; @@ -209,9 +204,7 @@ proc2_open (p_pair, pp_args) * "fdopen(3)"-ed into file pointers instead. */ pid_t -proc2_fopen (pf_pair, pp_args) - t_pf_pair *pf_pair; - tCC **pp_args; +proc2_fopen (t_pf_pair* pf_pair, tCC** pp_args) { t_fd_pair fd_pair; pid_t ch_id = proc2_open (&fd_pair, pp_args); diff --git a/gcc/fixinc/server.c b/gcc/fixinc/server.c index f195f018afc..902fda15072 100644 --- a/gcc/fixinc/server.c +++ b/gcc/fixinc/server.c @@ -73,10 +73,8 @@ tSCC* p_cur_dir = (char *) NULL; * The read data are stored in a malloc-ed string that is truncated * to size at the end. Input is assumed to be an ASCII string. */ -static char *load_data PARAMS ((FILE *)); static char * -load_data (fp) - FILE *fp; +load_data (FILE* fp) { char *pz_text; size_t text_size; @@ -137,7 +135,7 @@ load_data (fp) * pipes to it and from it, finally NULL out the file pointers */ void -close_server () +close_server (void) { if ( (server_id != NULLPROCESS) && (server_master_pid == getpid ())) @@ -157,10 +155,8 @@ close_server () * to our server, and also that if the server dies, we do not * die from a sigpipe problem. */ -static void sig_handler PARAMS ((int)); static void -sig_handler (signo) - int signo ATTRIBUTE_UNUSED; +sig_handler (int signo ATTRIBUTE_UNUSED) { #ifdef DEBUG /* FIXME: this is illegal to do in a signal handler. */ @@ -178,9 +174,8 @@ sig_handler (signo) * Also establishes the current directory to give to the * server process at the start of every server command. */ -static void server_setup PARAMS ((void)); static void -server_setup () +server_setup (void) { static int atexit_done = 0; char buff [MAXPATHLEN + 1]; @@ -213,9 +208,8 @@ server_setup () * override with $CONFIG_SHELL, so we do the same. */ -static const char *find_shell PARAMS ((void)); static const char * -find_shell () +find_shell (void) { char * shell = getenv ("CONFIG_SHELL"); if (shell) @@ -245,8 +239,7 @@ find_shell () * "ShElL-OuTpUt-HaS-bEeN-cOmPlEtEd" */ char * -run_shell (pz_cmd) - const char *pz_cmd; +run_shell (const char* pz_cmd) { tSCC zNoServer[] = "Server not running, cannot run:\n%s\n\n"; t_bool retry = BOOL_TRUE; diff --git a/gcc/fixinc/server.h b/gcc/fixinc/server.h index 27c53d7a0b0..30de054e411 100644 --- a/gcc/fixinc/server.h +++ b/gcc/fixinc/server.h @@ -65,11 +65,10 @@ typedef struct FILE *pf_write; /* parent write fp */ } t_pf_pair; -char *run_shell PARAMS (( const char *pzCmd)); -pid_t proc2_fopen PARAMS (( t_pf_pair * p_pair, tCC ** pp_args)); -pid_t proc2_open PARAMS (( t_fd_pair * p_pair, tCC ** pp_args)); -int chain_open PARAMS (( int in_fd, tCC ** pp_args, - pid_t * p_child)); -void close_server PARAMS (( void )); +char* run_shell( const char* pzCmd ); +pid_t proc2_fopen( t_pf_pair* p_pair, tCC** pp_args ); +pid_t proc2_open( t_fd_pair* p_pair, tCC** pp_args ); +int chain_open( int in_fd, tCC** pp_args, pid_t* p_child ); +void close_server( void ); #endif /* ! GCC_SERVER_H */