From f74b29d303c5156f4051ab3d4aeb5d68dbd6623c Mon Sep 17 00:00:00 2001 From: carl Date: Sun, 24 Feb 2019 00:46:05 +0800 Subject: [PATCH] * Remove some more compiler warnings. --- lang/cem/cemcom.ansi/arith.c | 2 +- lang/cem/cemcom.ansi/code.str | 1 + lang/cem/cemcom.ansi/ival.g | 2 +- lang/cem/cemcom.ansi/options.c | 4 ++-- lang/cem/cemcom.ansi/struct.c | 2 +- lang/cem/cemcom.ansi/type.c | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lang/cem/cemcom.ansi/arith.c b/lang/cem/cemcom.ansi/arith.c index 10d149911..6504a7305 100644 --- a/lang/cem/cemcom.ansi/arith.c +++ b/lang/cem/cemcom.ansi/arith.c @@ -537,7 +537,7 @@ void any2opnd(register struct expr **expp, int oper) case CHAR: case SHORT: case ENUM: - /* case FLOAT: /* not necessary anymore */ + /* case FLOAT: *//* not necessary anymore */ any2arith(expp, oper); break; case ARRAY: diff --git a/lang/cem/cemcom.ansi/code.str b/lang/cem/cemcom.ansi/code.str index b3770395f..480d79e47 100644 --- a/lang/cem/cemcom.ansi/code.str +++ b/lang/cem/cemcom.ansi/code.str @@ -36,6 +36,7 @@ void end_code(void); struct expr; struct def; struct idf; +struct decspecs; label code_string(char* val, int len); void def_strings(register struct string_cst *sc); diff --git a/lang/cem/cemcom.ansi/ival.g b/lang/cem/cemcom.ansi/ival.g index 80c6d1d01..398343ed4 100644 --- a/lang/cem/cemcom.ansi/ival.g +++ b/lang/cem/cemcom.ansi/ival.g @@ -455,7 +455,7 @@ void check_and_pad(struct expr **expp, struct type **tpp) /* next selector is aligned by adding extra zeroes */ if (sd->sd_sdef) zero_bytes(sd); - while (sd = sd->sd_sdef) { /* pad remaining selectors */ + while ( (sd = sd->sd_sdef)!=0) { /* pad remaining selectors */ pad(sd->sd_type); if (sd->sd_sdef) zero_bytes(sd); diff --git a/lang/cem/cemcom.ansi/options.c b/lang/cem/cemcom.ansi/options.c index 62864f5b7..0c37c85d4 100644 --- a/lang/cem/cemcom.ansi/options.c +++ b/lang/cem/cemcom.ansi/options.c @@ -49,7 +49,7 @@ next_option: /* to allow combined one-char options */ break; case '-': - options[*text++] = 1; /* flags, debug options etc. */ + options[(int)*text++] = 1; /* flags, debug options etc. */ goto next_option; #ifndef LINT @@ -127,7 +127,7 @@ next_option: /* to allow combined one-char options */ register arith sz, algn; char c; - while (c = *text++) { + while ( (c = *text++) !=0) { sz = txt2int(&text); algn = 0; if (*text == '.') { diff --git a/lang/cem/cemcom.ansi/struct.c b/lang/cem/cemcom.ansi/struct.c index fbba71a0e..7b6aedd21 100644 --- a/lang/cem/cemcom.ansi/struct.c +++ b/lang/cem/cemcom.ansi/struct.c @@ -283,7 +283,7 @@ struct sdef *idf2sdef( } /* Tp not met; take an identification. */ - if (sdef = idf->id_sdef) { + if ( (sdef = idf->id_sdef) ) { /* There is an identification */ error("illegal use of selector %s", idf->id_text); return sdef; diff --git a/lang/cem/cemcom.ansi/type.c b/lang/cem/cemcom.ansi/type.c index ff3a6eab3..750ed9a8a 100644 --- a/lang/cem/cemcom.ansi/type.c +++ b/lang/cem/cemcom.ansi/type.c @@ -273,7 +273,7 @@ void completed(struct type *tp) case STRUCT: case UNION: case ENUM: - while (etp = etp->next) + while ( (etp = etp->next) !=0) { if (!etp->tp_sdef) etp->tp_sdef = tp->tp_sdef;