Fixed several lint complaints

This commit is contained in:
ceriel 1993-11-16 11:35:23 +00:00
parent 8abba8b1a1
commit 0c60f4c22f
5 changed files with 32 additions and 48 deletions

View file

@ -229,16 +229,15 @@ dblock_p getdtable(dname)
* is correct. * is correct.
*/ */
dblock_p head, d, *dp; dblock_p head, d = 0, *dp = &head;
obj_p obj, *op; obj_p obj, *op = 0;
arg_p arg, *ap; arg_p arg, *ap = 0;
/* dp, op an ap tell how the next dblock/obj/arg /* dp, op an ap tell how the next dblock/obj/arg
* has to be linked. * has to be linked.
*/ */
int n; int n;
head = (dblock_p) 0; head = (dblock_p) 0;
dp = &head;
if ((curinp = fopen(dname,"r")) == NULL) { if ((curinp = fopen(dname,"r")) == NULL) {
error("cannot open %s", dname); error("cannot open %s", dname);
} }

View file

@ -31,7 +31,7 @@ init_globals()
*/ */
dblock_p d; dblock_p d;
obj_p obj, prev; obj_p obj, prev = 0;
short nr = 1; short nr = 1;
offset ill_zone, x; offset ill_zone, x;

View file

@ -137,7 +137,7 @@ make_localtab(p)
* i.e. we don't compute ud-info for them. * 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; local_p locallist = (local_p) 0;
short cnt = 0; short cnt = 0;
offset x, ill_zone = 0; offset x, ill_zone = 0;
@ -220,7 +220,7 @@ var_nr(l,nr_out,found_out)
* by EM instruction l. * by EM instruction l.
*/ */
offset off; offset off = 0;
short nr; short nr;
switch(TYPE(l)) { switch(TYPE(l)) {

View file

@ -152,49 +152,35 @@ STATIC offset nrbytes(class,arg1,arg2)
* arguments and class. * arguments and class.
*/ */
offset n;
switch(class) { switch(class) {
case CLASS1: case CLASS1:
n = arg1; return arg1;
break;
case CLASS2: case CLASS2:
n = 2 * arg1; return 2 * arg1;
break;
case CLASS3: case CLASS3:
n = arg1 + ws; return arg1 + ws;
break;
case CLASS4: case CLASS4:
n = arg1 + ps; return arg1 + ps;
break;
case CLASS5: case CLASS5:
n = ws; return ws;
break;
case CLASS6: case CLASS6:
n = 2 * ws; return 2 * ws;
break;
case CLASS7: case CLASS7:
n = ps; return ps;
break;
case CLASS8: case CLASS8:
n = 2 * ps; return 2 * ps;
break;
case CLASS9: case CLASS9:
n = 0; return 0;
break;
case CLASS10: case CLASS10:
n = arg2 + 2*ws; return arg2 + 2*ws;
break;
case CLASS11: case CLASS11:
n = arg1 + 2*ps; return arg1 + 2*ps;
break;
case CLASS12: case CLASS12:
n = (arg1 < ws ? ws : arg1); return (arg1 < ws ? ws : arg1);
break;
default: default:
assert(FALSE); assert(FALSE);
} }
return n; return 0;
} }
@ -253,7 +239,7 @@ bool parse(l,nbytes,l_out,level,action0)
*/ */
offset more, expected, sourcebytes,resultbytes; offset more, expected, sourcebytes,resultbytes;
line_p lnp; line_p lnp = 0;
more = nbytes; /* #bytes to be recognized */ more = nbytes; /* #bytes to be recognized */
while (more > 0) { while (more > 0) {

View file

@ -25,7 +25,7 @@ int stack_change(l,sign)
char *s; char *s;
bool argdef; bool argdef;
short arg; short arg = 0;
int sum = 0; int sum = 0;
line_p p = PREV(l); line_p p = PREV(l);
line_p pp = (p == (line_p) 0 ? (line_p) 0 : PREV(p)); 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) { if (i < sp_fmnem || i > sp_lmnem) {
return 0; return 0;
} else { }
if (TYPE(l) == OPSHORT) { if (TYPE(l) == OPSHORT) {
arg = SHORT(l); arg = SHORT(l);
if (arg < ws) { if (arg < ws) {
/* E.g. a LOI 1 loads word-size bytes, /* E.g. a LOI 1 loads word-size bytes,
* not 1 byte! * not 1 byte!
*/ */
arg = ws; arg = ws;
}
argdef = TRUE;
} else {
argdef = FALSE;
} }
argdef = TRUE;
} else {
argdef = FALSE;
} }
s = pop_push[i]; s = pop_push[i];
if (*s == '0') return 0; if (*s == '0') return 0;