From 6256f69499cb7cdcea91dca9a65c0b812373db10 Mon Sep 17 00:00:00 2001 From: rlar Date: Fri, 19 Nov 2010 18:49:05 +0000 Subject: [PATCH] Nr 2/5 (x = ...) != '\0' , swallow warnings --- ChangeLog | 7 +++++++ src/frontend/inpcom.c | 2 +- src/frontend/quote.c | 2 +- src/misc/string.c | 8 ++++---- src/ngmultidec.c | 2 +- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index b8c547d2c..1e6c2ac92 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-11-19 Robert Larice + * src/ngmultidec.c , + * src/frontend/inpcom.c , + * src/frontend/quote.c , + * src/misc/string.c : + Nr 2/5 (x = ...) != '\0' , swallow warnings + 2010-11-19 Robert Larice * src/frontend/plotting/clip.c : Nr 1/5 (x = ...) == 0 , swallow warnings diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index e7874c796..e096dc29b 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -1539,7 +1539,7 @@ inp_readall(FILE *fp, struct line **data, int call_depth, char *dir_name, bool c inp_stripcomments_deck(working); while (working) { - for (s = working->li_line; (c = *s) && c <= ' '; s++) + for (s = working->li_line; (c = *s) != '\0' && c <= ' '; s++) ; #ifdef TRACE diff --git a/src/frontend/quote.c b/src/frontend/quote.c index 2fc753284..703e1f611 100644 --- a/src/frontend/quote.c +++ b/src/frontend/quote.c @@ -23,7 +23,7 @@ cp_wstrip(char *str) char c, d; if (str) - while ((c = *str)) { /* assign and test */ + while ((c = *str) != '\0') { /* assign and test */ d = (char) strip(c); if (c != d) *str = d; diff --git a/src/misc/string.c b/src/misc/string.c index 06d674503..c0b7fd792 100644 --- a/src/misc/string.c +++ b/src/misc/string.c @@ -232,7 +232,7 @@ gettok(char **s) if (!**s) return (NULL); spice_dstring_init(&buf) ; - while ((c = **s) && !isspace(c)) { + while ((c = **s) != '\0' && !isspace(c)) { if (c == '('/*)*/) paren += 1; else if (c == /*(*/')') @@ -311,7 +311,7 @@ gettok_noparens(char **s) return (NULL); /* return NULL if we come to end of line */ spice_dstring_init(&buf) ; - while ((c = **s) && + while ((c = **s) != '\0' && !isspace(c) && ( **s != '(' ) && ( **s != ')' ) && @@ -343,7 +343,7 @@ gettok_instance(char **s) return (NULL); /* return NULL if we come to end of line */ spice_dstring_init(&buf) ; - while ((c = **s) && + while ((c = **s) != '\0' && !isspace(c) && ( **s != '(' ) && ( **s != ')' ) @@ -384,7 +384,7 @@ gettok_node(char **s) return (NULL); /* return NULL if we come to end of line */ spice_dstring_init(&buf) ; - while ((c = **s) && + while ((c = **s) != '\0' && !isspace(c) && ( **s != '(' ) && ( **s != ')' ) && diff --git a/src/ngmultidec.c b/src/ngmultidec.c index ad15ba35d..d4c12dfff 100644 --- a/src/ngmultidec.c +++ b/src/ngmultidec.c @@ -46,7 +46,7 @@ main (int argc, char **argv) while (argc > 0) { s = *argv++; argc--; - while ((ch = *s++)) { + while ((ch = *s++) != '\0') { if (*s) optarg = s; else if (argc)