From 0c60f4c22fdc64d3c4dc432e077172736ec61eb5 Mon Sep 17 00:00:00 2001 From: ceriel Date: Tue, 16 Nov 1993 11:35:23 +0000 Subject: [PATCH] Fixed several lint complaints --- util/ego/share/get.c | 7 +++---- util/ego/share/init_glob.c | 2 +- util/ego/share/locals.c | 4 ++-- util/ego/share/parser.c | 42 +++++++++++++------------------------- util/ego/share/stack_chg.c | 25 +++++++++++------------ 5 files changed, 32 insertions(+), 48 deletions(-) diff --git a/util/ego/share/get.c b/util/ego/share/get.c index 0ffbdf1bb..3a18f42ba 100644 --- a/util/ego/share/get.c +++ b/util/ego/share/get.c @@ -229,16 +229,15 @@ dblock_p getdtable(dname) * is correct. */ - dblock_p head, d, *dp; - obj_p obj, *op; - arg_p arg, *ap; + dblock_p head, d = 0, *dp = &head; + obj_p obj, *op = 0; + arg_p arg, *ap = 0; /* dp, op an ap tell how the next dblock/obj/arg * has to be linked. */ int n; head = (dblock_p) 0; - dp = &head; if ((curinp = fopen(dname,"r")) == NULL) { error("cannot open %s", dname); } diff --git a/util/ego/share/init_glob.c b/util/ego/share/init_glob.c index 0db012fa2..92af2ab4e 100644 --- a/util/ego/share/init_glob.c +++ b/util/ego/share/init_glob.c @@ -31,7 +31,7 @@ init_globals() */ dblock_p d; - obj_p obj, prev; + obj_p obj, prev = 0; short nr = 1; offset ill_zone, x; diff --git a/util/ego/share/locals.c b/util/ego/share/locals.c index 853d902ab..cb4d13128 100644 --- a/util/ego/share/locals.c +++ b/util/ego/share/locals.c @@ -137,7 +137,7 @@ make_localtab(p) * i.e. we don't compute ud-info for them. */ - local_p prev, next, lc; + local_p prev = 0, next, lc; local_p locallist = (local_p) 0; short cnt = 0; offset x, ill_zone = 0; @@ -220,7 +220,7 @@ var_nr(l,nr_out,found_out) * by EM instruction l. */ - offset off; + offset off = 0; short nr; switch(TYPE(l)) { diff --git a/util/ego/share/parser.c b/util/ego/share/parser.c index 591ca02ab..bcb78896e 100644 --- a/util/ego/share/parser.c +++ b/util/ego/share/parser.c @@ -152,49 +152,35 @@ STATIC offset nrbytes(class,arg1,arg2) * arguments and class. */ - offset n; - switch(class) { case CLASS1: - n = arg1; - break; + return arg1; case CLASS2: - n = 2 * arg1; - break; + return 2 * arg1; case CLASS3: - n = arg1 + ws; - break; + return arg1 + ws; case CLASS4: - n = arg1 + ps; - break; + return arg1 + ps; case CLASS5: - n = ws; - break; + return ws; case CLASS6: - n = 2 * ws; - break; + return 2 * ws; case CLASS7: - n = ps; - break; + return ps; case CLASS8: - n = 2 * ps; - break; + return 2 * ps; case CLASS9: - n = 0; - break; + return 0; case CLASS10: - n = arg2 + 2*ws; - break; + return arg2 + 2*ws; case CLASS11: - n = arg1 + 2*ps; - break; + return arg1 + 2*ps; case CLASS12: - n = (arg1 < ws ? ws : arg1); - break; + return (arg1 < ws ? ws : arg1); default: assert(FALSE); } - return n; + return 0; } @@ -253,7 +239,7 @@ bool parse(l,nbytes,l_out,level,action0) */ offset more, expected, sourcebytes,resultbytes; - line_p lnp; + line_p lnp = 0; more = nbytes; /* #bytes to be recognized */ while (more > 0) { diff --git a/util/ego/share/stack_chg.c b/util/ego/share/stack_chg.c index 2befd09ac..ad9305835 100644 --- a/util/ego/share/stack_chg.c +++ b/util/ego/share/stack_chg.c @@ -25,7 +25,7 @@ int stack_change(l,sign) char *s; bool argdef; - short arg; + short arg = 0; int sum = 0; line_p p = PREV(l); line_p pp = (p == (line_p) 0 ? (line_p) 0 : PREV(p)); @@ -33,19 +33,18 @@ int stack_change(l,sign) if (i < sp_fmnem || i > sp_lmnem) { return 0; - } else { - if (TYPE(l) == OPSHORT) { - arg = SHORT(l); - if (arg < ws) { - /* E.g. a LOI 1 loads word-size bytes, - * not 1 byte! - */ - arg = ws; - } - argdef = TRUE; - } else { - argdef = FALSE; + } + if (TYPE(l) == OPSHORT) { + arg = SHORT(l); + if (arg < ws) { + /* E.g. a LOI 1 loads word-size bytes, + * not 1 byte! + */ + arg = ws; } + argdef = TRUE; + } else { + argdef = FALSE; } s = pop_push[i]; if (*s == '0') return 0; -- 2.34.1