From 60ff9aaef2a3ec72e5216f35882031bcd62d3435 Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 24 Jul 2010 20:24:26 +0000 Subject: [PATCH] muffle `nested extern' warnings, and drop a handcrafted malloc prototype --- ChangeLog | 8 ++++++++ src/frontend/help/help.c | 3 ++- src/frontend/misccoms.c | 5 +++-- src/spicelib/devices/dev.c | 2 -- src/xspice/cmpp/pp_mod.c | 24 +++++++++++++----------- src/xspice/cmpp/read_ifs.c | 16 +++++++--------- 6 files changed, 33 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index c097e43bd..fce72b2c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-07-24 Robert Larice + * src/frontend/help/help.c , + * src/frontend/misccoms.c , + * src/spicelib/devices/dev.c , + * src/xspice/cmpp/pp_mod.c , + * src/xspice/cmpp/read_ifs.c : + muffle `nested extern' warnings, and drop a handcrafted malloc prototype + 2010-07-24 Robert Larice * src/ciderlib/input/meshset.c , * src/frontend/breakp.c , diff --git a/src/frontend/help/help.c b/src/frontend/help/help.c index 506362009..07237e742 100644 --- a/src/frontend/help/help.c +++ b/src/frontend/help/help.c @@ -14,6 +14,8 @@ Modified 1999 Emmanuel Rouat #include "hlpdefs.h" #include "suffix.h" +extern char *cp_tildexpand(char *string); + char *hlp_directory; extern char *hlp_filelist[]; int hlp_ftablesize = 0; @@ -136,7 +138,6 @@ hlp_pathfix(char *buf) { char *s, *t, *u, bufx[1025]; char *dir_pathsep; - extern char *cp_tildexpand(char *string); dir_pathsep = DIR_PATHSEP; diff --git a/src/frontend/misccoms.c b/src/frontend/misccoms.c index 6392270f4..c2f337076 100644 --- a/src/frontend/misccoms.c +++ b/src/frontend/misccoms.c @@ -17,12 +17,15 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group #ifdef HAVE_GNUREADLINE #include #include +extern char history_file[]; #endif /* HAVE_GNUREADLINE */ #ifdef HAVE_BSDEDITLINE /* SJB added edit line support 2005-05-05 */ #include +extern char history_file[]; #endif /* HAVE_BSDEDITLINE */ + extern IFsimulator SIMinfo; static void byemesg(void); @@ -242,8 +245,6 @@ byemesg(void) { #if defined(HAVE_GNUREADLINE) || defined(HAVE_BSDEDITLINE) - extern char history_file[]; - /* write out command history only when saying goodbye. */ if (cp_interactive && (cp_maxhistlength > 0)) { stifle_history(cp_maxhistlength); diff --git a/src/spicelib/devices/dev.c b/src/spicelib/devices/dev.c index a7bef86b3..32e00ecbb 100644 --- a/src/spicelib/devices/dev.c +++ b/src/spicelib/devices/dev.c @@ -355,8 +355,6 @@ void load_alldevs(void){ #include "cktdefs.h" /* for DEVmaxnum */ static void relink(void) { - /* added by SDB; DEVmaxnum is an external int defined in cktdefs.h */ - extern int DEVmaxnum; /* * This replacement done by SDB on 6.11.2003 diff --git a/src/xspice/cmpp/pp_mod.c b/src/xspice/cmpp/pp_mod.c index cef47af32..8eec68b58 100755 --- a/src/xspice/cmpp/pp_mod.c +++ b/src/xspice/cmpp/pp_mod.c @@ -63,6 +63,18 @@ NON-STANDARD FEATURES extern int mod_yyparse(void); extern void mod_yyrestart (FILE*); +extern FILE *mod_yyin; +extern FILE *mod_yyout; +extern int mod_yylineno; +extern char *mod_yytext; + +extern int mod_num_errors; + +extern Ifs_Table_t *mod_ifs_table; + +extern char *current_filename; +extern char *prog_name; + /*---------------------------------------------------------------------------*/ static void change_extension (char *filename, char *ext, char *new_filename) { @@ -99,12 +111,7 @@ utilities. void preprocess_mod_file ( char *filename) /* The file to read */ { - extern FILE *mod_yyin; - extern FILE *mod_yyout; - extern char *current_filename; - extern int mod_yylineno; - extern int mod_num_errors; - extern Ifs_Table_t *mod_ifs_table; + Ifs_Table_t ifs_table; /* info read from ifspec.ifs file */ Status_t status; /* Return status */ @@ -177,11 +184,6 @@ void preprocess_mod_file ( int mod_yyerror (char *str) { - extern int mod_yylineno; - extern char *mod_yytext; - extern char *current_filename; - extern char *prog_name; - fprintf (stderr, "%s: Error: \"%s\": line %d (near \'%s\'):\n\t%s.\n", prog_name, current_filename, mod_yylineno, mod_yytext, str); diff --git a/src/xspice/cmpp/read_ifs.c b/src/xspice/cmpp/read_ifs.c index 41cae6111..f1b36f158 100755 --- a/src/xspice/cmpp/read_ifs.c +++ b/src/xspice/cmpp/read_ifs.c @@ -54,7 +54,12 @@ extern char *prog_name; extern int ifs_yyparse (void); extern void ifs_yyrestart (FILE*); -void *malloc(unsigned size); +extern FILE *ifs_yyin; +extern int ifs_yylineno; +extern char *ifs_yytext; + +extern Ifs_Table_t *parser_ifs_table; +extern Boolean_t parser_just_names; static Status_t read_ifs_table(FILE *fp, int mode, Ifs_Table_t *ifs_table); @@ -143,11 +148,6 @@ static Status_t read_ifs_table( Ifs_Table_t *ifs_table) /* Table to put info in */ { - extern FILE *ifs_yyin; - extern Ifs_Table_t *parser_ifs_table; - extern Boolean_t parser_just_names; - extern int ifs_yylineno; - assert (ifs_table); assert (fp); @@ -166,12 +166,10 @@ static Status_t read_ifs_table( } /*---------------------------------------------------------------------------*/ + int ifs_yyerror (char *str) { - extern int ifs_yylineno; - extern char *ifs_yytext; - fprintf (stderr, "%s: Error: \"%s\": line %d (near \'%s\'):\n\t%s.\n", prog_name, current_filename, ifs_yylineno, ifs_yytext, str);