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
This commit is contained in:
Nathanael Nerode 2003-08-01 23:07:04 +00:00
parent c76becbdce
commit f4dbf936c7
9 changed files with 85 additions and 162 deletions

View file

@ -1,3 +1,14 @@
2003-08-01 Nathanael Nerode <neroden@gcc.gnu.org>
* 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 <ro@TechFak.Uni-Bielefeld.DE> 2003-08-01 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* ggc-common.c (gt_pch_restore): Case MAP_FAILED to void *. * ggc-common.c (gt_pch_restore): Case MAP_FAILED to void *.

View file

@ -59,7 +59,7 @@ Boston, MA 02111-1307, USA. */
tSCC zNeedsArg[] = "fixincl error: `%s' needs %s argument (c_fix_arg[%d])\n"; 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 { typedef struct {
const char* fix_name; const char* fix_name;
t_fix_proc* fix_proc; t_fix_proc* fix_proc;
@ -74,12 +74,10 @@ typedef struct {
_FT_( "gnu_type", gnu_type_fix ) _FT_( "gnu_type", gnu_type_fix )
#define FIX_PROC_HEAD( fix ) \ #define FIX_PROC_HEAD( fix ) \
static void fix PARAMS ((const char *, const char *, tFixDesc *)); \ static void fix (const char* filname ATTRIBUTE_UNUSED , \
static void fix ( filname, text, p_fixd ) \ const char* text ATTRIBUTE_UNUSED , \
const char* filname ATTRIBUTE_UNUSED; \ tFixDesc* p_fixd ATTRIBUTE_UNUSED )
const char* text ATTRIBUTE_UNUSED; \
tFixDesc* p_fixd ATTRIBUTE_UNUSED;
#ifdef NEED_PRINT_QUOTE #ifdef NEED_PRINT_QUOTE
/* /*
@ -89,9 +87,7 @@ static void fix ( filname, text, p_fixd ) \
* We are not doing a correctness syntax check here. * We are not doing a correctness syntax check here.
*/ */
static char* static char*
print_quote( q, text ) print_quote(char q, char* text )
char q;
char* text;
{ {
fputc( q, stdout ); fputc( q, stdout );
@ -131,11 +127,8 @@ print_quote( q, text )
* this thing can be encountered countless times during a compile * this thing can be encountered countless times during a compile
* and not cause even a warning. * and not cause even a warning.
*/ */
static const char *emit_gnu_type PARAMS ((const char *, regmatch_t *));
static const char* static const char*
emit_gnu_type ( text, rm ) emit_gnu_type (const char* text, regmatch_t* rm )
const char* text;
regmatch_t* rm;
{ {
char z_TYPE[ 64 ]; char z_TYPE[ 64 ];
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 * '%' characters in other contexts and all other characters are
* copied out verbatim. * copied out verbatim.
*/ */
static void format_write PARAMS ((tCC *, tCC *, regmatch_t[]));
static void static void
format_write (format, text, av) format_write (tCC* format, tCC* text, regmatch_t av[] )
tCC* format;
tCC* text;
regmatch_t av[];
{ {
int c; int c;
@ -710,9 +699,7 @@ FIX_PROC_HEAD( gnu_type_fix )
*/ */
void void
apply_fix( p_fixd, filname ) apply_fix( tFixDesc* p_fixd, tCC* filname )
tFixDesc* p_fixd;
tCC* filname;
{ {
#define _FT_(n,p) { n, p }, #define _FT_(n,p) { n, p },
static fix_entry_t fix_table[] = { FIXUP_TABLE { NULL, NULL }}; 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"; "FS error %d (%s) reopening %s as std%s\n";
int int
main( argc, argv ) main( int argc, char** argv )
int argc;
char** argv;
{ {
tFixDesc* pFix; tFixDesc* pFix;
char* pz_tmptmp; char* pz_tmptmp;

View file

@ -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"; tSCC z_fork_err[] = "Error %d (%s) starting filter process for %s\n";
regex_t incl_quote_re; regex_t incl_quote_re;
static void do_version PARAMS((void)) ATTRIBUTE_NORETURN; static void do_version (void) ATTRIBUTE_NORETURN;
char *load_file PARAMS((const char *)); char *load_file (const char *);
void run_compiles PARAMS((void)); void run_compiles (void);
void initialize PARAMS((int argc,char** argv)); void initialize (int argc, char** argv);
void process PARAMS((void)); void process (void);
/* External Source Code */ /* External Source Code */
@ -108,11 +108,9 @@ void process PARAMS((void));
* *
* MAIN ROUTINE * MAIN ROUTINE
*/ */
extern int main PARAMS ((int, char **)); extern int main (int, char **);
int int
main (argc, argv) main (int argc, char** argv)
int argc;
char **argv;
{ {
char *file_name_buf; char *file_name_buf;
@ -191,7 +189,7 @@ Altering %5d of them\n";
static void static void
do_version () do_version (void)
{ {
static const char zFmt[] = "echo '%s'"; static const char zFmt[] = "echo '%s'";
char zBuf[ 1024 ]; char zBuf[ 1024 ];
@ -214,9 +212,7 @@ do_version ()
/* * * * * * * * * * * * */ /* * * * * * * * * * * * */
void void
initialize ( argc, argv ) initialize ( int argc, char** argv )
int argc;
char** argv;
{ {
static const char var_not_found[] = static const char var_not_found[] =
#ifndef __STDC__ #ifndef __STDC__
@ -335,8 +331,7 @@ ENV_TABLE
result is the NUL terminated contents of the file. The file result is the NUL terminated contents of the file. The file
is presumed to be an ASCII text file containing no NULs. */ is presumed to be an ASCII text file containing no NULs. */
char * char *
load_file ( fname ) load_file ( const char* fname )
const char* fname;
{ {
struct stat stbf; struct stat stbf;
char* res; char* res;
@ -389,10 +384,8 @@ load_file ( fname )
return res; return res;
} }
static int machine_matches PARAMS ((tFixDesc *));
static int static int
machine_matches( p_fixd ) machine_matches( tFixDesc* p_fixd )
tFixDesc *p_fixd;
{ {
# ifndef SEPARATE_FIX_PROC # ifndef SEPARATE_FIX_PROC
tSCC case_fmt[] = "case %s in\n"; /* 9 bytes, plus string */ 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. run_compiles run all the regexp compiles for all the fixes once.
*/ */
void void
run_compiles () run_compiles (void)
{ {
tFixDesc *p_fixd = fixDescList; tFixDesc *p_fixd = fixDescList;
int fix_ct = FIX_COUNT; int fix_ct = FIX_COUNT;
@ -561,9 +554,8 @@ run_compiles ()
#endif #endif
static FILE *create_file PARAMS ((void));
static FILE * static FILE *
create_file () create_file (void)
{ {
int fd; int fd;
FILE *pf; FILE *pf;
@ -626,11 +618,8 @@ create_file ()
Result: APPLY_FIX or SKIP_FIX, depending on the result of the Result: APPLY_FIX or SKIP_FIX, depending on the result of the
shell script we run. */ shell script we run. */
#ifndef SEPARATE_FIX_PROC #ifndef SEPARATE_FIX_PROC
static int test_test PARAMS ((tTestDesc *, char *));
static int static int
test_test (p_test, pz_test_file) test_test (tTestDesc* p_test, char* pz_test_file)
tTestDesc *p_test;
char* pz_test_file;
{ {
tSCC cmd_fmt[] = tSCC cmd_fmt[] =
"file=%s\n\ "file=%s\n\
@ -682,11 +671,8 @@ fi";
The caller may choose to reverse meaning if the sense of the test The caller may choose to reverse meaning if the sense of the test
is inverted. */ is inverted. */
static int egrep_test PARAMS ((char *, tTestDesc *));
static int static int
egrep_test (pz_data, p_test) egrep_test (char* pz_data, tTestDesc* p_test)
char *pz_data;
tTestDesc *p_test;
{ {
#ifdef DEBUG #ifdef DEBUG
if (p_test->p_test_regex == 0) 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 the file name. If we emit the name, our invoking shell will try
to copy a non-existing file into the destination directory. */ to copy a non-existing file into the destination directory. */
static int quoted_file_exists PARAMS ((const char *, const char *, const char *));
static int static int
quoted_file_exists (pz_src_path, pz_file_path, pz_file) quoted_file_exists (const char* pz_src_path,
const char *pz_src_path; const char* pz_file_path,
const char *pz_file_path; const char* pz_file)
const char *pz_file;
{ {
char z[ MAXPATHLEN ]; char z[ MAXPATHLEN ];
char* pz; char* pz;
@ -757,12 +741,10 @@ quoted_file_exists (pz_src_path, pz_file_path, pz_file)
for interpretation by the invoking shell */ for interpretation by the invoking shell */
static void extract_quoted_files PARAMS ((char *, const char *, regmatch_t *));
static void static void
extract_quoted_files (pz_data, pz_fixed_file, p_re_match) extract_quoted_files (char* pz_data,
char *pz_data; const char* pz_fixed_file,
const char *pz_fixed_file; regmatch_t* p_re_match)
regmatch_t *p_re_match;
{ {
char *pz_dir_end = strrchr (pz_fixed_file, '/'); char *pz_dir_end = strrchr (pz_fixed_file, '/');
char *pz_incl_quot = pz_data; 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. Somebody wrote a *_fix subroutine that we must call.
*/ */
#ifndef SEPARATE_FIX_PROC #ifndef SEPARATE_FIX_PROC
static int internal_fix PARAMS ((int, tFixDesc *));
static int static int
internal_fix (read_fd, p_fixd) internal_fix (int read_fd, tFixDesc* p_fixd)
int read_fd;
tFixDesc* p_fixd;
{ {
int fd[2]; int fd[2];
@ -890,11 +869,10 @@ internal_fix (read_fd, p_fixd)
#ifdef SEPARATE_FIX_PROC #ifdef SEPARATE_FIX_PROC
static void static void
fix_with_system (p_fixd, pz_fix_file, pz_file_source, pz_temp_file) fix_with_system (tFixDesc* p_fixd,
tFixDesc* p_fixd; tCC* pz_fix_file,
tCC* pz_fix_file; tCC* pz_file_source,
tCC* pz_file_source; tCC* pz_temp_file)
tCC* pz_temp_file;
{ {
char* pz_cmd; char* pz_cmd;
char* pz_scan; char* pz_scan;
@ -1040,12 +1018,8 @@ fix_with_system (p_fixd, pz_fix_file, pz_file_source, pz_temp_file)
for stdout. */ for stdout. */
#else /* is *NOT* SEPARATE_FIX_PROC */ #else /* is *NOT* SEPARATE_FIX_PROC */
static int start_fixer PARAMS ((int, tFixDesc *, char *));
static int static int
start_fixer (read_fd, p_fixd, pz_fix_file) start_fixer (int read_fd, tFixDesc* p_fixd, char* pz_fix_file)
int read_fd;
tFixDesc* p_fixd;
char* pz_fix_file;
{ {
tCC* pz_cmd_save; tCC* pz_cmd_save;
char* pz_cmd; 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 Input: the original text of the file and the file's name
Result: none. A new file may or may not be created. */ Result: none. A new file may or may not be created. */
static t_bool fix_applies PARAMS ((tFixDesc *));
static t_bool static t_bool
fix_applies (p_fixd) fix_applies (tFixDesc* p_fixd)
tFixDesc *p_fixd;
{ {
const char *pz_fname = pz_curr_file; const char *pz_fname = pz_curr_file;
const char *pz_scan = p_fixd->file_list; const char *pz_scan = p_fixd->file_list;
@ -1229,10 +1201,8 @@ fix_applies (p_fixd)
Write out a replacement file */ Write out a replacement file */
static void write_replacement PARAMS ((tFixDesc *));
static void static void
write_replacement (p_fixd) write_replacement (tFixDesc* p_fixd)
tFixDesc *p_fixd;
{ {
const char* pz_text = p_fixd->patch_args[0]; 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 the matched text and then copy any remaining data from the
output of the filter chain. output of the filter chain.
*/ */
static void test_for_changes PARAMS ((int));
static void static void
test_for_changes (read_fd) test_for_changes (int read_fd)
int read_fd;
{ {
FILE *in_fp = fdopen (read_fd, "r"); FILE *in_fp = fdopen (read_fd, "r");
FILE *out_fp = (FILE *) NULL; 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. */ Result: none. A new file may or may not be created. */
void void
process () process (void)
{ {
tFixDesc *p_fixd = fixDescList; tFixDesc *p_fixd = fixDescList;
int todo_ct = FIX_COUNT; int todo_ct = FIX_COUNT;

View file

@ -32,8 +32,7 @@ Boston, MA 02111-1307, USA. */
is presumed to be an ASCII text file containing no NULs. */ is presumed to be an ASCII text file containing no NULs. */
char * char *
load_file_data (fp) load_file_data (FILE* fp)
FILE* fp;
{ {
char *pz_data = (char*)NULL; char *pz_data = (char*)NULL;
int space_left = -1; /* allow for terminating NUL */ int space_left = -1; /* allow for terminating NUL */
@ -81,9 +80,7 @@ load_file_data (fp)
#ifdef IS_CXX_HEADER_NEEDED #ifdef IS_CXX_HEADER_NEEDED
t_bool t_bool
is_cxx_header (fname, text) is_cxx_header (tCC* fname, tCC* text)
tCC *fname;
tCC *text;
{ {
/* First, check to see if the file is in a C++ directory */ /* First, check to see if the file is in a C++ directory */
for (;;) for (;;)
@ -147,9 +144,7 @@ template[ \t]*<|\
* We are not doing a correctness syntax check here. * We are not doing a correctness syntax check here.
*/ */
tCC* tCC*
skip_quote( q, text ) skip_quote(char q, char* text )
char q;
char* text;
{ {
for (;;) for (;;)
{ {
@ -188,12 +183,7 @@ skip_quote( q, text )
REG_EXTENDED|REG_NEWLINE produces identical regex syntax/semantics REG_EXTENDED|REG_NEWLINE produces identical regex syntax/semantics
to egrep (verified from 4.4BSD Programmer's Reference Manual). */ to egrep (verified from 4.4BSD Programmer's Reference Manual). */
void void
compile_re( pat, re, match, e1, e2 ) compile_re( tCC* pat, regex_t* re, int match, tCC* e1, tCC* e2 )
tCC *pat;
regex_t *re;
int match;
tCC *e1;
tCC *e2;
{ {
tSCC z_bad_comp[] = "fixincl ERROR: cannot compile %s regex for %s\n\ tSCC z_bad_comp[] = "fixincl ERROR: cannot compile %s regex for %s\n\
\texpr = `%s'\n\terror %s\n"; \texpr = `%s'\n\terror %s\n";
@ -228,10 +218,7 @@ static regex_t mn_name_re;
static int mn_compiled = 0; static int mn_compiled = 0;
void void
mn_get_regexps( label_re, name_re, who ) mn_get_regexps(regex_t** label_re, regex_t** name_re, tCC* who )
regex_t **label_re;
regex_t **name_re;
tCC *who;
{ {
if (! mn_compiled) if (! mn_compiled)
{ {
@ -248,10 +235,7 @@ mn_get_regexps( label_re, name_re, who )
#ifdef SEPARATE_FIX_PROC #ifdef SEPARATE_FIX_PROC
char* char*
make_raw_shell_str( pz_d, pz_s, smax ) make_raw_shell_str( char* pz_d, tCC* pz_s, size_t smax )
char* pz_d;
tCC* pz_s;
size_t smax;
{ {
tSCC zQ[] = "'\\''"; tSCC zQ[] = "'\\''";
size_t dtaSize; size_t dtaSize;

View file

@ -199,31 +199,27 @@ extern int gnu_type_map_ct;
/* /*
* Exported procedures * Exported procedures
*/ */
char * load_file_data PARAMS(( FILE* fp )); char * load_file_data ( FILE* fp );
#ifdef IS_CXX_HEADER_NEEDED #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 */ #endif /* IS_CXX_HEADER_NEEDED */
#ifdef SKIP_QUOTE_NEEDED #ifdef SKIP_QUOTE_NEEDED
tCC* skip_quote PARAMS(( char q, char* text )); tCC* skip_quote ( char q, char* text );
#endif #endif
void compile_re PARAMS(( tCC* pat, regex_t* re, int match, void compile_re ( tCC* pat, regex_t* re, int match, tCC *e1, tCC *e2 );
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 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 #ifdef SEPARATE_FIX_PROC
char* make_raw_shell_str char* make_raw_shell_str ( char* pz_d, tCC* pz_s, size_t smax );
PARAMS(( char* pz_d, tCC* pz_s, size_t smax ));
#endif #endif
#ifdef MN_NAME_PAT #ifdef MN_NAME_PAT
void mn_get_regexps void mn_get_regexps ( regex_t** label_re, regex_t** name_re, tCC *who );
PARAMS(( regex_t** label_re, regex_t** name_re,
tCC *who ));
#endif #endif
#endif /* ! GCC_FIXLIB_H */ #endif /* ! GCC_FIXLIB_H */

View file

@ -51,7 +51,7 @@ Boston, MA 02111-1307, USA. */
ENV_TABLE ENV_TABLE
#undef _ENV_ #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 { typedef struct {
tCC* test_name; tCC* test_name;
@ -62,12 +62,9 @@ typedef struct {
_FT_( "machine_name", machine_name_test ) \ _FT_( "machine_name", machine_name_test ) \
_FT_( "stdc_0_in_system_headers", stdc_0_in_system_headers_test ) _FT_( "stdc_0_in_system_headers", stdc_0_in_system_headers_test )
#define TEST_FOR_FIX_PROC_HEAD( 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 ( tCC* fname ATTRIBUTE_UNUSED, \
static apply_fix_p_t test ( fname, text ) \ tCC* text ATTRIBUTE_UNUSED )
tCC* fname ATTRIBUTE_UNUSED; \
tCC* text ATTRIBUTE_UNUSED;
TEST_FOR_FIX_PROC_HEAD( machine_name_test ) 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 apply_fix_p_t
run_test( tname, fname, text ) run_test( tCC* tname, tCC* fname, tCC* text )
tCC* tname;
tCC* fname;
tCC* text;
{ {
#define _FT_(n,p) { n, p }, #define _FT_(n,p) { n, p },
static test_entry_t test_table[] = { FIX_TEST_TABLE { NULL, NULL }}; static test_entry_t test_table[] = { FIX_TEST_TABLE { NULL, NULL }};

View file

@ -62,10 +62,7 @@ STATIC const char* def_args[] =
* to store the child's process id. * to store the child's process id.
*/ */
int int
chain_open (stdin_fd, pp_args, p_child) chain_open (int stdin_fd, tCC** pp_args, pid_t* p_child)
int stdin_fd;
tCC **pp_args;
pid_t *p_child;
{ {
t_fd_pair stdout_pair; t_fd_pair stdout_pair;
pid_t ch_id; 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. * The return value is the process id of the created process.
*/ */
pid_t pid_t
proc2_open (p_pair, pp_args) proc2_open (t_fd_pair* p_pair, tCC** pp_args)
t_fd_pair *p_pair;
tCC **pp_args;
{ {
pid_t ch_id; pid_t ch_id;
@ -209,9 +204,7 @@ proc2_open (p_pair, pp_args)
* "fdopen(3)"-ed into file pointers instead. * "fdopen(3)"-ed into file pointers instead.
*/ */
pid_t pid_t
proc2_fopen (pf_pair, pp_args) proc2_fopen (t_pf_pair* pf_pair, tCC** pp_args)
t_pf_pair *pf_pair;
tCC **pp_args;
{ {
t_fd_pair fd_pair; t_fd_pair fd_pair;
pid_t ch_id = proc2_open (&fd_pair, pp_args); pid_t ch_id = proc2_open (&fd_pair, pp_args);

View file

@ -73,10 +73,8 @@ tSCC* p_cur_dir = (char *) NULL;
* The read data are stored in a malloc-ed string that is truncated * 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. * to size at the end. Input is assumed to be an ASCII string.
*/ */
static char *load_data PARAMS ((FILE *));
static char * static char *
load_data (fp) load_data (FILE* fp)
FILE *fp;
{ {
char *pz_text; char *pz_text;
size_t text_size; size_t text_size;
@ -137,7 +135,7 @@ load_data (fp)
* pipes to it and from it, finally NULL out the file pointers * pipes to it and from it, finally NULL out the file pointers
*/ */
void void
close_server () close_server (void)
{ {
if ( (server_id != NULLPROCESS) if ( (server_id != NULLPROCESS)
&& (server_master_pid == getpid ())) && (server_master_pid == getpid ()))
@ -157,10 +155,8 @@ close_server ()
* to our server, and also that if the server dies, we do not * to our server, and also that if the server dies, we do not
* die from a sigpipe problem. * die from a sigpipe problem.
*/ */
static void sig_handler PARAMS ((int));
static void static void
sig_handler (signo) sig_handler (int signo ATTRIBUTE_UNUSED)
int signo ATTRIBUTE_UNUSED;
{ {
#ifdef DEBUG #ifdef DEBUG
/* FIXME: this is illegal to do in a signal handler. */ /* 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 * Also establishes the current directory to give to the
* server process at the start of every server command. * server process at the start of every server command.
*/ */
static void server_setup PARAMS ((void));
static void static void
server_setup () server_setup (void)
{ {
static int atexit_done = 0; static int atexit_done = 0;
char buff [MAXPATHLEN + 1]; char buff [MAXPATHLEN + 1];
@ -213,9 +208,8 @@ server_setup ()
* override with $CONFIG_SHELL, so we do the same. * override with $CONFIG_SHELL, so we do the same.
*/ */
static const char *find_shell PARAMS ((void));
static const char * static const char *
find_shell () find_shell (void)
{ {
char * shell = getenv ("CONFIG_SHELL"); char * shell = getenv ("CONFIG_SHELL");
if (shell) if (shell)
@ -245,8 +239,7 @@ find_shell ()
* "ShElL-OuTpUt-HaS-bEeN-cOmPlEtEd" * "ShElL-OuTpUt-HaS-bEeN-cOmPlEtEd"
*/ */
char * char *
run_shell (pz_cmd) run_shell (const char* pz_cmd)
const char *pz_cmd;
{ {
tSCC zNoServer[] = "Server not running, cannot run:\n%s\n\n"; tSCC zNoServer[] = "Server not running, cannot run:\n%s\n\n";
t_bool retry = BOOL_TRUE; t_bool retry = BOOL_TRUE;

View file

@ -65,11 +65,10 @@ typedef struct
FILE *pf_write; /* parent write fp */ FILE *pf_write; /* parent write fp */
} t_pf_pair; } t_pf_pair;
char *run_shell PARAMS (( const char *pzCmd)); char* run_shell( const char* pzCmd );
pid_t proc2_fopen PARAMS (( t_pf_pair * p_pair, tCC ** pp_args)); pid_t proc2_fopen( t_pf_pair* p_pair, tCC** pp_args );
pid_t proc2_open PARAMS (( t_fd_pair * p_pair, tCC ** pp_args)); pid_t proc2_open( t_fd_pair* p_pair, tCC** pp_args );
int chain_open PARAMS (( int in_fd, tCC ** pp_args, int chain_open( int in_fd, tCC** pp_args, pid_t* p_child );
pid_t * p_child)); void close_server( void );
void close_server PARAMS (( void ));
#endif /* ! GCC_SERVER_H */ #endif /* ! GCC_SERVER_H */