From 1876ad109460bb84ec3ab1dcb0d7657ec84c499b Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 9 Jul 2011 18:45:54 +0000 Subject: [PATCH] remove unused global artifact `dynLlen' --- ChangeLog | 6 ++++++ src/frontend/inpcom.c | 20 +++++++------------- src/frontend/numparam/spicenum.c | 3 --- src/frontend/numparam/xpressn.c | 1 - 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 67610f94a..86f728cf6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-07-09 Robert Larice + * src/frontend/inpcom.c , + * src/frontend/numparam/spicenum.c , + * src/frontend/numparam/xpressn.c' : + remove unused global artifact `dynLlen' + 2011-07-09 Robert Larice * src/frontend/com_sysinfo.c , * src/winmain.c : diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 0fd2267f8..38f8c1e48 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -77,8 +77,6 @@ static COMPATMODE_T inp_compat_mode; /* Collect information for dynamic allocation of numparam arrays */ /* number of lines in input deck */ int dynmaxline; /* inpcom.c 1529 */ -/* max. line length in input deck */ -unsigned int dynLlen; /* inpcom.c 1526 */ /* number of lines in deck after expansion */ int dynMaxckt = 0; /* subckt.c 307 */ /* number of parameter substitutions */ @@ -1109,6 +1107,9 @@ inp_readall(FILE *fp, struct line **data, int call_depth, char *dir_name, bool c int line_number = 1; /* sjb - renamed to avoid confusion with struct line */ int line_number_orig = 1, line_number_lib = 1, line_number_inc = 1; unsigned int no_braces = 0; /* number of '{' */ + + size_t max_line_length; /* max. line length in input deck */ + FILE *newfp; FILE *fdo; struct line *tmp_ptr1 = NULL; @@ -1684,7 +1685,7 @@ inp_readall(FILE *fp, struct line **data, int call_depth, char *dir_name, bool c count the number of '{' per line as an upper estimate of the number of parameter substitutions in a line*/ dynmaxline = 0; - dynLlen = 0; + max_line_length = 0; for(tmp_ptr1 = cc; tmp_ptr1 != NULL; tmp_ptr1 = tmp_ptr1->li_next) { char *s; unsigned int braces_per_line = 0; @@ -1692,8 +1693,8 @@ inp_readall(FILE *fp, struct line **data, int call_depth, char *dir_name, bool c dynmaxline++; /* renumber the lines of the processed input deck */ tmp_ptr1->li_linenum = dynmaxline; - if (dynLlen < strlen(tmp_ptr1->li_line)) - dynLlen = strlen(tmp_ptr1->li_line); + if (max_line_length < strlen(tmp_ptr1->li_line)) + max_line_length = strlen(tmp_ptr1->li_line); /* count '{' */ for (s = tmp_ptr1->li_line; *s; s++) if (*s == '{') braces_per_line++; @@ -1708,15 +1709,8 @@ inp_readall(FILE *fp, struct line **data, int call_depth, char *dir_name, bool c (void) fclose(fdo); fprintf(stdout, "max line length %d, max subst. per line %d, number of lines %d\n", - dynLlen, no_braces, dynmaxline); + (int) max_line_length, no_braces, dynmaxline); } - /* max line length increased by maximum number of parameter substitutions per line - times parameter string length (25) */ - dynLlen += no_braces * 25; - /* several times a string of length dynLlen is used for messages, thus give it a - minimum length */ - if (dynLlen < 512) dynLlen = 512; - return; } /*-------------------------------------------------------------------------* diff --git a/src/frontend/numparam/spicenum.c b/src/frontend/numparam/spicenum.c index 6eb5d7b11..e7d675edc 100644 --- a/src/frontend/numparam/spicenum.c +++ b/src/frontend/numparam/spicenum.c @@ -39,9 +39,6 @@ extern long dynsubst; /* spicenum.c:144 */ /* number of lines in input deck */ extern int dynmaxline; /* inpcom.c:1529 */ -/* max. line length in input deck */ -/* unsigned int dynLlen; No longer needed with d strings */ /* inpcom.c:1531 */ - /* Uncomment this line to allow debug tracing */ /* #define TRACE_NUMPARAMS */ diff --git a/src/frontend/numparam/xpressn.c b/src/frontend/numparam/xpressn.c index 3bb621aec..110595a99 100644 --- a/src/frontend/numparam/xpressn.c +++ b/src/frontend/numparam/xpressn.c @@ -29,7 +29,6 @@ static SPICE_DSTRING fmathS ; /* all math functions */ extern char *nupa_inst_name; /* see spicenum.c */ extern long dynsubst; /* see inpcom.c */ -extern unsigned int dynLlen; #define MAX_STRING_INSERT 17 /* max. string length to be inserted and replaced */ #define ACT_CHARACTS 17 /* actual string length to be inserted and replaced */