From 1ad65120d51550b25c009523843083e8d3d52990 Mon Sep 17 00:00:00 2001 From: rlar Date: Mon, 21 Mar 2016 15:13:47 +0100 Subject: [PATCH] skip-ws, #1/6, prepare for rewrite, obj-invariant --- src/frontend/com_let.c | 3 ++- src/frontend/help/textdisp.c | 3 ++- src/frontend/inp.c | 12 ++++++++---- src/frontend/nutinp.c | 6 ++++-- src/frontend/subckt.c | 3 ++- src/frontend/vectors.c | 3 ++- 6 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/frontend/com_let.c b/src/frontend/com_let.c index 92c328c9b..cca29a2b5 100644 --- a/src/frontend/com_let.c +++ b/src/frontend/com_let.c @@ -111,7 +111,8 @@ com_let(wordlist *wl) vec_free(t); free_pnode(names); /* frees also t, if pnode `names' is simple value */ - for (s = q; *s && isspace_c(*s); s++) + s = q; + for (; *s && isspace_c(*s); s++) ; } } diff --git a/src/frontend/help/textdisp.c b/src/frontend/help/textdisp.c index ba5a2e6a0..24929ba6b 100644 --- a/src/frontend/help/textdisp.c +++ b/src/frontend/help/textdisp.c @@ -72,7 +72,8 @@ hlp_thandle(topic **parent) return (NULL); } - for (s = buf; *s && isspace_c(*s); s++) + s = buf; + for (; *s && isspace_c(*s); s++) ; switch (*s) { case '?': diff --git a/src/frontend/inp.c b/src/frontend/inp.c index eedf9cd1a..4eb3e24c1 100644 --- a/src/frontend/inp.c +++ b/src/frontend/inp.c @@ -420,9 +420,11 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile) /* Put the first token from line into s */ strncpy(name, dd->li_line, BSIZE_SP); - for (s = name; *s && isspace_c(*s); s++) + s = name; + for (; *s && isspace_c(*s); s++) ; - for (t = s; *t && !isspace_c(*t); t++) + t = s; + for (; *t && !isspace_c(*t); t++) ; *t = '\0'; @@ -807,7 +809,8 @@ inp_dodeck( if (!noparse) { struct line *opt_beg = options; for (; options; options = options->li_next) { - for (s = options->li_line; *s && !isspace_c(*s); s++) + s = options->li_line; + for (; *s && !isspace_c(*s); s++) ; ii = cp_interactive; @@ -988,7 +991,8 @@ inp_dodeck( if (!noparse) { /* * for (; options; options = options->li_next) { - * for (s = options->li_line; *s && !isspace_c(*s); s++) + * s = options->li_line; + * for (; *s && !isspace_c(*s); s++) * ; * ii = cp_interactive; * cp_interactive = FALSE; diff --git a/src/frontend/nutinp.c b/src/frontend/nutinp.c index 84d980bfa..16c3cb4f3 100644 --- a/src/frontend/nutinp.c +++ b/src/frontend/nutinp.c @@ -93,9 +93,11 @@ inp_nutsource(FILE *fp, bool comfile, char *filename) continue; } (void) strncpy(name, dd->li_line, BSIZE_SP); - for (s = name; *s && isspace_c(*s); s++) + s = name; + for (; *s && isspace_c(*s); s++) ; - for (t = s; *t && !isspace_c(*t); t++) + t = s; + for (; *t && !isspace_c(*t); t++) ; *t = '\0'; diff --git a/src/frontend/subckt.c b/src/frontend/subckt.c index 6ab147c9b..f9618cbdb 100644 --- a/src/frontend/subckt.c +++ b/src/frontend/subckt.c @@ -1314,7 +1314,8 @@ finishLine(struct bxx_buffer *t, char *src, char *scname) bxx_putc(t, *src++); continue; } - for (s = src + 1; *s && isspace_c(*s); s++) + s = src + 1; + for (; *s && isspace_c(*s); s++) ; if (!*s || (*s != '(')) { lastwasalpha = isalpha_c(*src); diff --git a/src/frontend/vectors.c b/src/frontend/vectors.c index 7ae0d1746..14e43ccfa 100644 --- a/src/frontend/vectors.c +++ b/src/frontend/vectors.c @@ -937,7 +937,8 @@ vec_basename(struct dvec *v) } strtolower(buf); - for (t = buf; isspace_c(*t); t++) + t = buf; + for (; isspace_c(*t); t++) ; s = t; for (t = s; *t; t++)