mirror of
https://git.code.sf.net/p/ngspice/ngspice
synced 2026-09-03 02:53:04 +02:00
skip-ws, #3/6, use TEMPORARY macros, obj-invariant
This commit is contained in:
+8
-15
@@ -283,8 +283,7 @@ gettok(char **s)
|
||||
char *beg, *token ; /* return token */
|
||||
|
||||
paren = 0;
|
||||
while (isspace_c(**s))
|
||||
(*s)++;
|
||||
TEMPORARY_SKIP_WS_X1(*s);
|
||||
if (!**s)
|
||||
return (NULL);
|
||||
beg = *s ;
|
||||
@@ -358,8 +357,7 @@ gettok_noparens(char **s)
|
||||
char c;
|
||||
char *beg, *token ; /* return token */
|
||||
|
||||
while ( isspace_c(**s) )
|
||||
(*s)++; /* iterate over whitespace */
|
||||
TEMPORARY_SKIP_WS_X1(*s);
|
||||
|
||||
if (!**s)
|
||||
return (NULL); /* return NULL if we come to end of line */
|
||||
@@ -377,8 +375,7 @@ gettok_noparens(char **s)
|
||||
token = copy_substring(beg, *s) ;
|
||||
|
||||
/* Now iterate up to next non-whitespace char */
|
||||
while ( isspace_c(**s) )
|
||||
(*s)++;
|
||||
TEMPORARY_SKIP_WS_X1(*s);
|
||||
|
||||
return ( token ) ;
|
||||
}
|
||||
@@ -389,8 +386,7 @@ gettok_instance(char **s)
|
||||
char c;
|
||||
char *beg, *token ; /* return token */
|
||||
|
||||
while ( isspace_c(**s) )
|
||||
(*s)++; /* iterate over whitespace */
|
||||
TEMPORARY_SKIP_WS_X1(*s);
|
||||
|
||||
if (!**s)
|
||||
return (NULL); /* return NULL if we come to end of line */
|
||||
@@ -407,8 +403,7 @@ gettok_instance(char **s)
|
||||
token = copy_substring(beg, *s) ;
|
||||
|
||||
/* Now iterate up to next non-whitespace char */
|
||||
while ( isspace_c(**s) )
|
||||
(*s)++;
|
||||
TEMPORARY_SKIP_WS_X1(*s);
|
||||
|
||||
return ( token ) ;
|
||||
}
|
||||
@@ -425,8 +420,7 @@ gettok_char(char **s, char p, bool inc_p, bool nested)
|
||||
char c;
|
||||
char *beg, *token ; /* return token */
|
||||
|
||||
while ( isspace_c(**s) )
|
||||
(*s)++; /* iterate over whitespace */
|
||||
TEMPORARY_SKIP_WS_X1(*s);
|
||||
|
||||
if (!**s)
|
||||
return (NULL); /* return NULL if we come to end of line */
|
||||
@@ -473,8 +467,7 @@ gettok_char(char **s, char p, bool inc_p, bool nested)
|
||||
token = copy_substring(beg, *s) ;
|
||||
|
||||
/* Now iterate up to next non-whitespace char */
|
||||
while ( isspace_c(**s) )
|
||||
(*s)++;
|
||||
TEMPORARY_SKIP_WS_X1(*s);
|
||||
|
||||
return ( token ) ;
|
||||
}
|
||||
@@ -671,7 +664,7 @@ get_comma_separated_values( char *values[], char *str ) {
|
||||
values[count++] = strdup(str);
|
||||
*ptr = keep;
|
||||
str = comma_ptr + 1;
|
||||
while ( isspace_c(*str) ) str++;
|
||||
TEMPORARY_SKIP_WS_X1(str);
|
||||
}
|
||||
values[count++] = strdup(str);
|
||||
return count;
|
||||
|
||||
Reference in New Issue
Block a user