Fixed several lint complaints
authorceriel <none@none>
Tue, 16 Nov 1993 11:35:23 +0000 (11:35 +0000)
committerceriel <none@none>
Tue, 16 Nov 1993 11:35:23 +0000 (11:35 +0000)
util/ego/share/get.c
util/ego/share/init_glob.c
util/ego/share/locals.c
util/ego/share/parser.c
util/ego/share/stack_chg.c

index 0ffbdf1..3a18f42 100644 (file)
@@ -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);
        }
index 0db012f..92af2ab 100644 (file)
@@ -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;
 
index 853d902..cb4d131 100644 (file)
@@ -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)) {
index 591ca02..bcb7889 100644 (file)
@@ -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) {
index 2befd09..ad93058 100644 (file)
@@ -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;