This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] ANSIfy fixincludes


This ANSIfies the function prototypes and definitions in fixincludes.

Tested on i686-pc-linux-gnu.

Bruce, is this OK for mainline?  I just want to get a second pair
of eyes on it since not all of the files are used on any given
machine.

	* fixinc/fixfixes.c, fixinc/fixlib.c, fixinc/fixlib.h,
	fixinc/fixtests.c, fixinc/procopen.c, fixinc/server.c,
	fixinc/server.h: ANSIfy function prototypes and defintions.

Index: fixfixes.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/fixfixes.c,v
retrieving revision 1.48
diff -u -r1.48 fixfixes.c
--- fixfixes.c	19 Jul 2003 16:09:49 -0000	1.48
+++ fixfixes.c	30 Jul 2003 04:04:26 -0000
@@ -59,7 +59,7 @@
 
 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 @@
   _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 @@
  *  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 @@
  *  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 @@
  *  '%' 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 @@
 
 */
 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 @@
 "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;
Index: fixincl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/fixincl.c,v
retrieving revision 1.63
diff -u -r1.63 fixincl.c
--- fixincl.c	19 Jul 2003 16:09:49 -0000	1.63
+++ fixincl.c	30 Jul 2003 04:04:27 -0000
@@ -94,11 +94,11 @@
 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 @@
  *
  *  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 @@
 
 
 static void
-do_version ()
+do_version (void)
 {
   static const char zFmt[] = "echo '%s'";
   char zBuf[ 1024 ];
@@ -214,9 +212,7 @@
 /* * * * * * * * * * * * */
 
 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 @@
    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 @@
   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 @@
    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 @@
 #endif
 
 
-static FILE *create_file PARAMS ((void));
 static FILE *
-create_file ()
+create_file (void)
 {
   int fd;
   FILE *pf;
@@ -626,11 +618,8 @@
   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 @@
   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 @@
   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 @@
            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 @@
     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 @@
 
 #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 @@
     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 @@
    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 @@
 
    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 @@
     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 @@
    Result: none.  A new file may or may not be created.  */
 
 void
-process ()
+process (void)
 {
   tFixDesc *p_fixd = fixDescList;
   int todo_ct = FIX_COUNT;
Index: fixlib.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/fixlib.c,v
retrieving revision 1.19
diff -u -r1.19 fixlib.c
--- fixlib.c	19 Jul 2003 16:09:49 -0000	1.19
+++ fixlib.c	30 Jul 2003 04:04:35 -0000
@@ -32,8 +32,7 @@
    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 @@
 
 #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 @@
  *  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 @@
    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 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 @@
 #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;
Index: fixlib.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/fixlib.h,v
retrieving revision 1.28
diff -u -r1.28 fixlib.h
--- fixlib.h	8 Jul 2003 20:42:18 -0000	1.28
+++ fixlib.h	30 Jul 2003 04:04:35 -0000
@@ -199,31 +199,27 @@
 /*
  *  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 */
Index: fixtests.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/fixtests.c,v
retrieving revision 1.30
diff -u -r1.30 fixtests.c
--- fixtests.c	8 Jul 2003 20:42:18 -0000	1.30
+++ fixtests.c	30 Jul 2003 04:04:35 -0000
@@ -51,7 +51,7 @@
 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 @@
   _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 @@
 
 */
 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 }};
Index: procopen.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/procopen.c,v
retrieving revision 1.9
diff -u -r1.9 procopen.c
--- procopen.c	16 Dec 2002 18:22:29 -0000	1.9
+++ procopen.c	30 Jul 2003 04:04:35 -0000
@@ -62,10 +62,7 @@
  *  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 @@
  *  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 @@
  *  "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);
Index: server.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/server.c,v
retrieving revision 1.23
diff -u -r1.23 server.c
--- server.c	19 Jul 2003 16:09:49 -0000	1.23
+++ server.c	30 Jul 2003 04:04:36 -0000
@@ -73,10 +73,8 @@
  *  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 @@
  *  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 @@
  *  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 @@
  *  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 @@
  *  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 @@
  *     "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;
Index: server.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/server.h,v
retrieving revision 1.9
diff -u -r1.9 server.h
--- server.h	16 Dec 2002 18:22:30 -0000	1.9
+++ server.h	30 Jul 2003 04:04:36 -0000
@@ -65,11 +65,10 @@
   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 */

-- 
Nathanael Nerode  <neroden at gcc.gnu.org>
http://home.twcny.rr.com/nerode/neroden/fdl.html


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]