Browse Source

skip-ws, #4/6, drop `TEMPORARY_SKIP_WS_X0'

use TEMPORARY_SKIP_WS_X1 instead of TEMPORARY_SKIP_WS_X0
pre-master-46
rlar 10 years ago
parent
commit
d12679fccd
  1. 2
      src/frontend/com_let.c
  2. 6
      src/frontend/dimens.c
  3. 2
      src/frontend/help/textdisp.c
  4. 2
      src/frontend/inp.c
  5. 4
      src/frontend/newcoms.c
  6. 2
      src/frontend/nutinp.c
  7. 10
      src/frontend/subckt.c
  8. 1
      src/include/ngspice/stringskip.h
  9. 2
      src/misc/tilde.c

2
src/frontend/com_let.c

@ -113,7 +113,7 @@ com_let(wordlist *wl)
free_pnode(names); /* frees also t, if pnode `names' is simple value */ free_pnode(names); /* frees also t, if pnode `names' is simple value */
s = q; s = q;
TEMPORARY_SKIP_WS_X0(s);
TEMPORARY_SKIP_WS_X1(s);
} }
} }
/* vector name at p */ /* vector name at p */

6
src/frontend/dimens.c

@ -133,11 +133,11 @@ atodims(char *p, int *data, int *outlength)
return 0; return 0;
} }
TEMPORARY_SKIP_WS_X0(p);
TEMPORARY_SKIP_WS_X1(p);
if (*p == '[') { if (*p == '[') {
p++; p++;
TEMPORARY_SKIP_WS_X0(p);
TEMPORARY_SKIP_WS_X1(p);
needbracket = 1; needbracket = 1;
} }
@ -184,7 +184,7 @@ atodims(char *p, int *data, int *outlength)
break; break;
} }
TEMPORARY_SKIP_WS_X0(p);
TEMPORARY_SKIP_WS_X1(p);
} }
*outlength = length; *outlength = length;

2
src/frontend/help/textdisp.c

@ -74,7 +74,7 @@ hlp_thandle(topic **parent)
} }
s = buf; s = buf;
TEMPORARY_SKIP_WS_X0(s);
TEMPORARY_SKIP_WS_X1(s);
switch (*s) { switch (*s) {
case '?': case '?':
fprintf(cp_out, fprintf(cp_out,

2
src/frontend/inp.c

@ -420,7 +420,7 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile)
/* Put the first token from line into s */ /* Put the first token from line into s */
strncpy(name, dd->li_line, BSIZE_SP); strncpy(name, dd->li_line, BSIZE_SP);
s = name; s = name;
TEMPORARY_SKIP_WS_X0(s);
TEMPORARY_SKIP_WS_X1(s);
t = s; t = s;
TEMPORARY_SKIP_NON_WS_X0(t); TEMPORARY_SKIP_NON_WS_X0(t);
*t = '\0'; *t = '\0';

4
src/frontend/newcoms.c

@ -80,7 +80,7 @@ com_reshape(wordlist *wl)
wlast = wlast->wl_next; wlast = wlast->wl_next;
} }
TEMPORARY_SKIP_WS_X0(p);
TEMPORARY_SKIP_WS_X1(p);
switch (state) { switch (state) {
case 0: /* p just at or before a number */ case 0: /* p just at or before a number */
@ -131,7 +131,7 @@ com_reshape(wordlist *wl)
} }
} }
TEMPORARY_SKIP_WS_X0(p);
TEMPORARY_SKIP_WS_X1(p);
} while (state < 3); } while (state < 3);

2
src/frontend/nutinp.c

@ -95,7 +95,7 @@ inp_nutsource(FILE *fp, bool comfile, char *filename)
} }
(void) strncpy(name, dd->li_line, BSIZE_SP); (void) strncpy(name, dd->li_line, BSIZE_SP);
s = name; s = name;
TEMPORARY_SKIP_WS_X0(s);
TEMPORARY_SKIP_WS_X1(s);
t = s; t = s;
TEMPORARY_SKIP_NON_WS_X0(t); TEMPORARY_SKIP_NON_WS_X0(t);
*t = '\0'; *t = '\0';

10
src/frontend/subckt.c

@ -322,7 +322,7 @@ inp_subcktexpand(struct line *deck) {
continue; /* skip .commands */ continue; /* skip .commands */
} else { /* any other line . . . */ } else { /* any other line . . . */
TEMPORARY_SKIP_NON_WS_X0(s); TEMPORARY_SKIP_NON_WS_X0(s);
TEMPORARY_SKIP_WS_X0(s);
TEMPORARY_SKIP_WS_X1(s);
if (*s == '(') { if (*s == '(') {
int level = 0; int level = 0;
@ -1310,7 +1310,7 @@ finishLine(struct bxx_buffer *t, char *src, char *scname)
continue; continue;
} }
s = src + 1; s = src + 1;
TEMPORARY_SKIP_WS_X0(s);
TEMPORARY_SKIP_WS_X1(s);
if (!*s || (*s != '(')) { if (!*s || (*s != '(')) {
lastwasalpha = isalpha_c(*src); lastwasalpha = isalpha_c(*src);
bxx_putc(t, *src++); bxx_putc(t, *src++);
@ -1467,7 +1467,7 @@ numnodes(char *name, struct subs *subs, wordlist const *modnames)
const wordlist *wl; const wordlist *wl;
int n, i, gotit; int n, i, gotit;
TEMPORARY_SKIP_WS_X0(name);
TEMPORARY_SKIP_WS_X1(name);
c = *name; c = *name;
if (isupper_c(c)) if (isupper_c(c))
@ -1571,7 +1571,7 @@ static int
numdevs(char *s) numdevs(char *s)
{ {
TEMPORARY_SKIP_WS_X0(s);
TEMPORARY_SKIP_WS_X1(s);
switch (*s) { switch (*s) {
case 'K': case 'K':
case 'k': case 'k':
@ -1680,7 +1680,7 @@ devmodtranslate(struct line *s, char *subname, wordlist * const orig_modnames)
printf("In devmodtranslate, examining line %s.\n", t); printf("In devmodtranslate, examining line %s.\n", t);
#endif #endif
TEMPORARY_SKIP_WS_X0(t);
TEMPORARY_SKIP_WS_X1(t);
c = *t; /* set c to first char in line. . . . */ c = *t; /* set c to first char in line. . . . */
if (isupper_c(c)) if (isupper_c(c))
c = tolower_c(c); c = tolower_c(c);

1
src/include/ngspice/stringskip.h

@ -2,7 +2,6 @@
#define ngspice_STRINGSKIP_H #define ngspice_STRINGSKIP_H
#define TEMPORARY_SKIP_NON_WS_X0(s) do { while (*(s) && !isspace_c(*(s))) (s)++; } while(0) #define TEMPORARY_SKIP_NON_WS_X0(s) do { while (*(s) && !isspace_c(*(s))) (s)++; } while(0)
#define TEMPORARY_SKIP_WS_X0(s) do { while (*(s) && isspace_c(*(s))) (s)++; } while(0)
#define TEMPORARY_SKIP_WS_X1(s) do { while ( isspace_c(*(s))) (s)++; } while(0) #define TEMPORARY_SKIP_WS_X1(s) do { while ( isspace_c(*(s))) (s)++; } while(0)
#endif #endif

2
src/misc/tilde.c

@ -43,7 +43,7 @@ tildexpand(char *string)
if (!string) if (!string)
return NULL; return NULL;
TEMPORARY_SKIP_WS_X0(string);
TEMPORARY_SKIP_WS_X1(string);
if (*string != '~') if (*string != '~')
return copy(string); return copy(string);

Loading…
Cancel
Save