From 00ccfec837fea24b4b51985fac482587375de822 Mon Sep 17 00:00:00 2001 From: pnenzi Date: Sat, 10 Jan 2004 12:03:47 +0000 Subject: [PATCH] Small code reformatting. --- src/spicelib/parser/inpgtok.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/spicelib/parser/inpgtok.c b/src/spicelib/parser/inpgtok.c index 0684f8e0d..17ec5f3d0 100644 --- a/src/spicelib/parser/inpgtok.c +++ b/src/spicelib/parser/inpgtok.c @@ -49,9 +49,9 @@ int INPgetTok(char **line, char **token, int gobble) } /* mark beginning of token */ *line = point; - + /* now find all good characters up to next occurance of a - separation character. */ + separation character. */ signstate = 0; for (point = *line; *point != '\0'; point++) { if (*point == ' ') @@ -59,7 +59,7 @@ int INPgetTok(char **line, char **token, int gobble) if (*point == '\t') break; if (*point == '\r') - break; + break; if (*point == '=') break; if (*point == '(') @@ -93,6 +93,7 @@ int INPgetTok(char **line, char **token, int gobble) signstate = 3; } + if (point == *line && *point) /* Weird items, 1 char */ point++; *token = (char *) MALLOC(1 + point - *line); @@ -101,6 +102,7 @@ int INPgetTok(char **line, char **token, int gobble) (void) strncpy(*token, *line, point - *line); *(*token + (point - *line)) = '\0'; *line = point; + /* gobble garbage to next token */ for (; **line != '\0'; (*line)++) { if (**line == ' ') @@ -108,24 +110,23 @@ int INPgetTok(char **line, char **token, int gobble) if (**line == '\t') continue; if (**line == '\r') - continue; + continue; if ((**line == '=') && gobble) continue; if ((**line == ',') && gobble) continue; break; } - + #ifdef TRACE - /* SDB debug statement */ - /*printf("found generic token (%s) and rest of line (%s)\n",*token,*line); */ -#endif - + /* SDB debug statement */ + /* printf("found generic token (%s) and rest of line (%s)\n", *token, *line); */ +#endif + return (OK); } - /*------------------------------------------------------------------- * INPgetNetTok -- this fcn extracts an input netname token from * 'line' and returns a pointer to it in 'token'. @@ -213,6 +214,7 @@ int INPgetNetTok(char **line, char **token, int gobble) } + /*------------------------------------------------------------------- * INPgetUTok -- this fcn extracts an input refdes token from * 'line' and returns a pointer to it in 'token'. @@ -323,11 +325,11 @@ int INPgetUTok(char **line, char **token, int gobble) break; } *line = point; - + #ifdef TRACE /* SDB debug statement */ /* printf("found refdes token (%s) and rest of line (%s)\n",*token,*line); */ -#endif - +#endif + return (OK); }