lint and cleanup
authorBill Joy <root@ucbvax.Berkeley.EDU>
Mon, 25 Oct 1982 16:59:41 +0000 (08:59 -0800)
committerBill Joy <root@ucbvax.Berkeley.EDU>
Mon, 25 Oct 1982 16:59:41 +0000 (08:59 -0800)
SCCS-vsn: usr.sbin/config/config.h 1.10
SCCS-vsn: usr.sbin/config/lang.l 1.12
SCCS-vsn: usr.sbin/config/config.y 1.16
SCCS-vsn: usr.sbin/config/main.c 1.7
SCCS-vsn: usr.sbin/config/Makefile 1.7
SCCS-vsn: usr.sbin/config/mkheaders.c 1.12
SCCS-vsn: usr.sbin/config/mkioconf.c 2.5
SCCS-vsn: usr.sbin/config/mkmakefile.c 1.21
SCCS-vsn: usr.sbin/config/mkubglue.c 1.7

usr/src/usr.sbin/config/Makefile
usr/src/usr.sbin/config/config.h
usr/src/usr.sbin/config/config.y
usr/src/usr.sbin/config/lang.l
usr/src/usr.sbin/config/main.c
usr/src/usr.sbin/config/mkheaders.c
usr/src/usr.sbin/config/mkioconf.c
usr/src/usr.sbin/config/mkmakefile.c
usr/src/usr.sbin/config/mkubglue.c

index 5c7f5d2..ff1ea56 100644 (file)
@@ -1,28 +1,28 @@
 #
 #
-#      Makefile        1.6     82/10/24
+#      Makefile        1.7     82/10/25
 #
 CFILES=        y.tab.c main.c lex.yy.c mkioconf.c mkmakefile.c mkubglue.c mkheaders.c
 OFILES=        y.tab.o main.o lex.yy.o mkioconf.o mkmakefile.o mkubglue.o mkheaders.o
 
 #
 CFILES=        y.tab.c main.c lex.yy.c mkioconf.c mkmakefile.c mkubglue.c mkheaders.c
 OFILES=        y.tab.o main.o lex.yy.o mkioconf.o mkmakefile.o mkubglue.o mkheaders.o
 
-CFLAGS=        -w
+CFLAGS=
 LDFLAGS=-ll
 
 config: ${OFILES}
        ${CC} ${OFILES} -o config ${LDFLAGS}
 
 LDFLAGS=-ll
 
 config: ${OFILES}
        ${CC} ${OFILES} -o config ${LDFLAGS}
 
+lex.yy.c: config.l
+       lex config.l
+
 y.tab.o: y.tab.c
 
 y.tab.c: config.y
        yacc -d config.y
 
 y.tab.o: y.tab.c
 
 y.tab.c: config.y
        yacc -d config.y
 
-lex.yy.c: config.l
-       lex config.l
-
 clean:
        rm -f ${OBJS} lex.yy.c y.tab.c y.tab.h config
 
 install:
        install config ${DESTDIR}/etc/config
 
 clean:
        rm -f ${OBJS} lex.yy.c y.tab.c y.tab.h config
 
 install:
        install config ${DESTDIR}/etc/config
 
-lint:
+lint: ${CFILES}
        lint ${CFILES}
        lint ${CFILES}
index 64311c1..b1164b1 100644 (file)
@@ -1,17 +1,8 @@
-/*     config.h        1.9     82/10/24        */
-
-#define        machinename     machname
-
-/*
- * Definitions for config.
- */
+/*     config.h        1.10    82/10/25        */
 
 /*
 
 /*
- * Structures representing objects in config's world.
+ * Config.
  */
  */
-
-#define TO_NEXUS       -1
-
 struct file_list {
        char    *f_fn;                  /* the name */
        int     f_type;                 /* see below */
 struct file_list {
        char    *f_fn;                  /* the name */
        int     f_type;                 /* see below */
@@ -32,7 +23,7 @@ struct device {
        int     d_type;                 /* CONTROLLER, DEVICE, UBA or MBA */
        struct  device *d_conn;         /* what it is connected to */
        char    *d_name;                /* name of device (e.g. rk11) */
        int     d_type;                 /* CONTROLLER, DEVICE, UBA or MBA */
        struct  device *d_conn;         /* what it is connected to */
        char    *d_name;                /* name of device (e.g. rk11) */
-       struct  idlist *d_vec;          /* interrupt vectors */
+       struct  idlst *d_vec;           /* interrupt vectors */
        int     d_pri;                  /* interrupt priority */
        int     d_addr;                 /* address of csr */
        int     d_unit;                 /* unit number */
        int     d_pri;                  /* interrupt priority */
        int     d_addr;                 /* address of csr */
        int     d_unit;                 /* unit number */
@@ -44,6 +35,7 @@ struct device {
        int     d_flags;                /* nlags for device init */
        struct  device *d_next;         /* Next one in list */
 };
        int     d_flags;                /* nlags for device init */
        struct  device *d_next;         /* Next one in list */
 };
+#define TO_NEXUS       (struct device *)-1
 
 struct config {
        char    *c_dev;
 
 struct config {
        char    *c_dev;
@@ -78,12 +70,26 @@ struct cputype {
 struct opt {
        char    *op_name;
        char    *op_value;
 struct opt {
        char    *op_name;
        char    *op_value;
-       struct  cputype *op_next;
+       struct  opt *op_next;
 } *opt;
 
 } *opt;
 
-char   *ident, *ns(), *malloc(), *tc(), *qu();
+char   *ident;
+char   *ns();
+char   *tc();
+char   *qu();
+char   *get_word();
+char   *path();
+char   *raise();
+
 int    do_trace;
 
 int    do_trace;
 
+char   *index();
+char   *rindex();
+char   *malloc();
+char   *strcpy();
+char   *strcat();
+char   *sprintf();
+
 #if MACHINE_VAX
 int    seen_mba, seen_uba;
 #endif
 #if MACHINE_VAX
 int    seen_mba, seen_uba;
 #endif
@@ -97,7 +103,7 @@ int  yyline;
 struct file_list *ftab, *conf_list, *confp;
 char   *PREFIX;
 
 struct file_list *ftab, *conf_list, *confp;
 char   *PREFIX;
 
-int    hz, timezone, hadtz;
+int    timezone, hadtz;
 int    dst;
 int    profiling;
 
 int    dst;
 int    profiling;
 
index a3e0193..e5751f8 100644 (file)
@@ -1,11 +1,27 @@
+%union {
+       char    *str;
+       int     val;
+       struct  idlst *lst;
+}
+
 %token MACHINE
 %token CPU IDENT CONFIG ANY DEVICE UBA MBA NEXUS CSR DRIVE VECTOR OPTIONS
 %token MACHINE
 %token CPU IDENT CONFIG ANY DEVICE UBA MBA NEXUS CSR DRIVE VECTOR OPTIONS
-%token CONTROLLER PSEUDO_DEVICE FLAGS ID SEMICOLON NUMBER FPNUMBER TRACE
-%token DISK SLAVE AT HZ TIMEZONE DST MAXUSERS
-%token MASTER PRIORITY COMMA MINUS EQUALS
+%token CONTROLLER PSEUDO_DEVICE FLAGS SEMICOLON TRACE
+%token DISK SLAVE HZ TIMEZONE DST MAXUSERS
+%token MASTER PRIORITY COMMA MINUS EQUALS AT
+
+%token <str>   ID
+%token <val>   NUMBER
+%token <val>   FPNUMBER
+
+%type  <str>   Save_id
+%type  <str>   Opt_value
+%type  <str>   Dev
+%type  <lst>   Id_list
+
 %{
 
 %{
 
-/*     config.y        1.15    82/10/24        */
+/*     config.y        1.16    82/10/25        */
 
 #include "config.h"
 #include <stdio.h>
 
 #include "config.h"
 #include <stdio.h>
@@ -14,28 +30,35 @@ struct      device cur;
 struct device *curp = 0;
 char   *temp_id;
 char   *val_id;
 struct device *curp = 0;
 char   *temp_id;
 char   *val_id;
+char   *malloc();
 
 %}
 %%
 Configuration:
        Many_specs
 
 %}
 %%
 Configuration:
        Many_specs
-       ;
+               ;
 
 Many_specs:
        Many_specs Spec
 
 Many_specs:
        Many_specs Spec
-       |
-       ;
+               |
+       /* lambda */
+               ;
 
 Spec:
 
 Spec:
-       Device_spec SEMICOLON  = { newdev(&cur); } |
-       Config_spec SEMICOLON |
-       TRACE SEMICOLON = { do_trace = ! do_trace; } |
-       SEMICOLON |
+       Device_spec SEMICOLON
+             = { newdev(&cur); } |
+       Config_spec SEMICOLON
+               |
+       TRACE SEMICOLON
+             = { do_trace = !do_trace; } |
+       SEMICOLON
+               |
        error SEMICOLON
        error SEMICOLON
-       ;
+               ;
 
 Config_spec:
 
 Config_spec:
-       MACHINE Save_id = {
+       MACHINE Save_id
+           = {
                if (!strcmp($2, "vax")) {
                        machine = MACHINE_VAX;
                        machinename = "vax";
                if (!strcmp($2, "vax")) {
                        machine = MACHINE_VAX;
                        machinename = "vax";
@@ -44,155 +67,186 @@ Config_spec:
                        machinename = "sun";
                } else
                        yyerror("Unknown machine type");
                        machinename = "sun";
                } else
                        yyerror("Unknown machine type");
-               } |
-       CPU Save_id = {
-                   struct cputype *cp = malloc(sizeof (struct cputype));
-                   cp->cpu_name = ns($2);
-                   cp->cpu_next = cputype;
-                   cputype = cp;
-                   free(temp_id);
-                   } |
-       OPTIONS Opt_list |
-       IDENT ID = { ident = ns($2); } |
-       CONFIG Save_id ID = { mkconf(temp_id, $3); free(temp_id); } |
-       HZ NUMBER = {
-               yyerror("HZ specification obsolete; delete");
-               hz = 60;
-               } |
-       TIMEZONE NUMBER = { timezone = 60 * $2; check_tz(); } |
-       TIMEZONE NUMBER DST = { timezone = 60 * $2; dst = 1; check_tz(); } |
-       TIMEZONE FPNUMBER = { timezone = $2; check_tz(); } |
-       TIMEZONE FPNUMBER DST = { timezone = $2; dst = 1; check_tz(); } |
-       TIMEZONE MINUS NUMBER =
-           { timezone = -60 * $3; check_tz(); } |
-       TIMEZONE MINUS NUMBER DST =
-           { timezone = -60 * $3; dst = 1; check_tz(); } |
-       TIMEZONE MINUS FPNUMBER =
-           { timezone = -$3; check_tz(); } |
-       TIMEZONE MINUS FPNUMBER DST =
-           { timezone = -$3; dst = 1; check_tz(); } |
-       MAXUSERS NUMBER = { maxusers = $2; }
-       ;
+             } |
+       CPU Save_id
+             = {
+               struct cputype *cp =
+                   (struct cputype *)malloc(sizeof (struct cputype));
+               cp->cpu_name = ns($2);
+               cp->cpu_next = cputype;
+               cputype = cp;
+               free(temp_id);
+             } |
+       OPTIONS Opt_list
+               |
+       IDENT ID
+             = { ident = ns($2); } |
+       CONFIG Save_id ID
+             = { mkconf(temp_id, $3); free(temp_id); } |
+       HZ NUMBER
+             = { yyerror("HZ specification obsolete; delete"); } |
+       TIMEZONE NUMBER
+             = { timezone = 60 * $2; check_tz(); } |
+       TIMEZONE NUMBER DST
+             = { timezone = 60 * $2; dst = 1; check_tz(); } |
+       TIMEZONE FPNUMBER
+             = { timezone = $2; check_tz(); } |
+       TIMEZONE FPNUMBER DST
+             = { timezone = $2; dst = 1; check_tz(); } |
+       TIMEZONE MINUS NUMBER
+             = { timezone = -60 * $3; check_tz(); } |
+       TIMEZONE MINUS NUMBER DST
+             = { timezone = -60 * $3; dst = 1; check_tz(); } |
+       TIMEZONE MINUS FPNUMBER
+             = { timezone = -$3; check_tz(); } |
+       TIMEZONE MINUS FPNUMBER DST
+             = { timezone = -$3; dst = 1; check_tz(); } |
+       MAXUSERS NUMBER
+             = { maxusers = $2; };
 
 Opt_list:
 
 Opt_list:
-       Opt_list COMMA Option |
+       Opt_list COMMA Option
+               |
        Option
        Option
-       ;
+               ;
 
 Option:
 
 Option:
-       Save_id = {
-                   struct opt *op = malloc(sizeof (struct opt));
-                   op->op_name = ns($1);
-                   op->op_next = opt;
-                   op->op_value = 0;
-                   opt = op;
-                   free(temp_id);
-       } |
-       Save_id EQUALS Opt_value = {
-                   struct opt *op = malloc(sizeof (struct opt));
-                   op->op_name = ns($1);
-                   op->op_next = opt;
-                   op->op_value = ns($3);
-                   opt = op;
-                   free(temp_id);
-                   free(val_id);
-       }
-       ;
+       Save_id
+             = {
+               struct opt *op = (struct opt *)malloc(sizeof (struct opt));
+               op->op_name = ns($1);
+               op->op_next = opt;
+               op->op_value = 0;
+               opt = op;
+               free(temp_id);
+             } |
+       Save_id EQUALS Opt_value
+             = {
+               struct opt *op = (struct opt *)malloc(sizeof (struct opt));
+               op->op_name = ns($1);
+               op->op_next = opt;
+               op->op_value = ns($3);
+               opt = op;
+               free(temp_id);
+               free(val_id);
+             } ;
 
 Opt_value:
 
 Opt_value:
-       ID = { $$ = val_id = ns($1); } |
-       NUMBER = { char nb[16]; sprintf(nb, "%d", $1); $$ = val_id = ns(nb); }
-       ;
+       ID
+             = { $$ = val_id = ns($1); } |
+       NUMBER
+             = { char nb[16]; $$ = val_id = ns(sprintf(nb, "%d", $1)); };
 
 
 Save_id:
 
 
 Save_id:
-       ID = { $$ = temp_id = ns($1); }
+       ID
+             = { $$ = temp_id = ns($1); }
        ;
 
 Dev:
        ;
 
 Dev:
-       UBA  = { $$ = ns("uba"); } |
-       MBA  = { $$ = ns("mba"); } |
-       ID = { $$ = ns($1); }
+       UBA
+             = { $$ = ns("uba"); } |
+       MBA
+             = { $$ = ns("mba"); } |
+       ID
+             = { $$ = ns($1); }
        ;
 
 Device_spec:
        ;
 
 Device_spec:
-       DEVICE Dev_name Dev_info Int_spec = {  cur.d_type = DEVICE; } |
-       MASTER Dev_name Dev_info Int_spec = {  cur.d_type = MASTER; } |
-       DISK Dev_name Dev_info Int_spec =
-                               {  cur.d_dk = 1; cur.d_type = DEVICE; } |
-       CONTROLLER Dev_name Dev_info Int_spec = {  cur.d_type = CONTROLLER; } |
-       PSEUDO_DEVICE Init_dev Dev = {
-                       cur.d_name = $3;
-                       cur.d_type = PSEUDO_DEVICE;
-                 } |
-       PSEUDO_DEVICE Init_dev Dev NUMBER = {
-                       cur.d_name = $3;
-                       cur.d_type = PSEUDO_DEVICE;
-                       cur.d_slave = $4;
-               }
-       ;
+       DEVICE Dev_name Dev_info Int_spec
+             = { cur.d_type = DEVICE; } |
+       MASTER Dev_name Dev_info Int_spec
+             = { cur.d_type = MASTER; } |
+       DISK Dev_name Dev_info Int_spec
+             = { cur.d_dk = 1; cur.d_type = DEVICE; } |
+       CONTROLLER Dev_name Dev_info Int_spec
+             = { cur.d_type = CONTROLLER; } |
+       PSEUDO_DEVICE Init_dev Dev
+             = {
+               cur.d_name = $3;
+               cur.d_type = PSEUDO_DEVICE;
+               } |
+       PSEUDO_DEVICE Init_dev Dev NUMBER
+             = {
+               cur.d_name = $3;
+               cur.d_type = PSEUDO_DEVICE;
+               cur.d_slave = $4;
+               };
 
 Dev_name:
 
 Dev_name:
-       Init_dev Dev NUMBER =   {
-                       cur.d_name = $2;
-                       if (eq($2, "mba"))
-                           seen_mba = 1;
-                       else if (eq($2, "uba"))
-                           seen_uba = 1;
-                       cur.d_unit = $3;
-               }
-       ;
+       Init_dev Dev NUMBER
+             = {
+               cur.d_name = $2;
+               if (eq($2, "mba"))
+                       seen_mba = 1;
+               else if (eq($2, "uba"))
+                       seen_uba = 1;
+               cur.d_unit = $3;
+               };
 
 Init_dev:
 
 Init_dev:
-       = { init_dev(&cur); }
-       ;
+       /* lambda */
+             = { init_dev(&cur); };
 
 Dev_info:
        Con_info Info_list
 
 Dev_info:
        Con_info Info_list
-       |
-       ;
+               |
+       /* lambda */
+               ;
 
 Con_info:
 
 Con_info:
-       AT Dev NUMBER = {
+       AT Dev NUMBER
+             = {
                if (eq(cur.d_name, "mba") || eq(cur.d_name, "uba"))
                        yyerror(sprintf(errbuf,
                if (eq(cur.d_name, "mba") || eq(cur.d_name, "uba"))
                        yyerror(sprintf(errbuf,
-                               "%s must be connected to a nexus", cur.d_name));
+                           "%s must be connected to a nexus", cur.d_name));
                cur.d_conn = connect($2, $3);
                cur.d_conn = connect($2, $3);
-       } |
-       AT NEXUS NUMBER = { check_nexus(&cur, $3); cur.d_conn = TO_NEXUS; }
-       ;
+               } |
+       AT NEXUS NUMBER
+             = { check_nexus(&cur, $3); cur.d_conn = TO_NEXUS; };
     
 Info_list:
        Info_list Info
     
 Info_list:
        Info_list Info
-       |
-       ;
+               |
+       /* lambda */
+               ;
 
 Info:
 
 Info:
-       CSR NUMBER = { cur.d_addr = $2; } |
-       DRIVE NUMBER = { cur.d_drive = $2; } |
-       SLAVE NUMBER =
-       {
-               if (cur.d_conn != 0 && cur.d_conn != TO_NEXUS
-                   && cur.d_conn->d_type == MASTER)
+       CSR NUMBER
+             = { cur.d_addr = $2; } |
+       DRIVE NUMBER
+             = { cur.d_drive = $2; } |
+       SLAVE NUMBER
+             = {
+               if (cur.d_conn != 0 && cur.d_conn != TO_NEXUS &&
+                   cur.d_conn->d_type == MASTER)
                        cur.d_slave = $2;
                else
                        yyerror("can't specify slave--not to master");
                        cur.d_slave = $2;
                else
                        yyerror("can't specify slave--not to master");
-       } |
-       FLAGS NUMBER = { cur.d_flags = $2; }
-       ;
+               } |
+       FLAGS NUMBER
+             = { cur.d_flags = $2; };
 
 Int_spec:
 
 Int_spec:
-       VECTOR Id_list = { cur.d_vec = $2; } |
-       PRIORITY NUMBER = { cur.d_pri = $2; } |
-       ;
+       VECTOR Id_list
+             = { cur.d_vec = $2; } |
+       PRIORITY NUMBER
+             = { cur.d_pri = $2; } |
+       /* lambda */
+               ;
 
 Id_list:
 
 Id_list:
-       Save_id =
-           { struct idlst *a = (struct idlst *)malloc(sizeof(struct idlst));
-             a->id = $1; a->id_next = 0; $$ = a; } |
+       Save_id
+             = {
+               struct idlst *a = (struct idlst *)malloc(sizeof(struct idlst));
+               a->id = $1; a->id_next = 0; $$ = a;
+               } |
        Save_id Id_list =
        Save_id Id_list =
-           { struct idlst *a = (struct idlst *)malloc(sizeof(struct idlst));
-             a->id = $1; a->id_next = $2; $$ = a; } ;
+               {
+               struct idlst *a = (struct idlst *)malloc(sizeof(struct idlst));
+               a->id = $1; a->id_next = $2; $$ = a;
+               };
+
 %%
 
 yyerror(s)
 %%
 
 yyerror(s)
@@ -211,9 +265,9 @@ ns(str)
 {
        register char *cp;
 
 {
        register char *cp;
 
-       cp = malloc(strlen(str)+1);
-       strcpy(cp, str);
-       return cp;
+       cp = malloc((unsigned)(strlen(str)+1));
+       (void) strcpy(cp, str);
+       return (cp);
 }
 
 /*
 }
 
 /*
index 761db57..689516a 100644 (file)
@@ -1,5 +1,5 @@
 %{
 %{
-/*     lang.l  1.11    82/10/24        */
+/*     lang.l  1.12    82/10/25        */
 
 #include <ctype.h>
 #include "y.tab.h"
 
 #include <ctype.h>
 #include "y.tab.h"
@@ -7,8 +7,6 @@
 
 #define tprintf if (do_trace) printf
 
 
 #define tprintf if (do_trace) printf
 
-int yylval;
-
 /*
  * Key word table
  */
 /*
  * Key word table
  */
@@ -35,7 +33,7 @@ WORD  [A-Za-z_][-A-Za-z_]*
 
                        if ((i = kw_lookup(yytext)) == -1)
                        {
 
                        if ((i = kw_lookup(yytext)) == -1)
                        {
-                               yylval = (int) yytext;
+                               yylval.str = yytext;
                                tprintf("id(%s) ", yytext);
                                return ID;
                        }
                                tprintf("id(%s) ", yytext);
                                return ID;
                        }
@@ -44,34 +42,34 @@ WORD        [A-Za-z_][-A-Za-z_]*
                }
 \"[^"]+\"      {
                        yytext[strlen(yytext)-1] = '\0';
                }
 \"[^"]+\"      {
                        yytext[strlen(yytext)-1] = '\0';
-                       yylval = (int) yytext + 1;
+                       yylval.val = yytext + 1;
                        return ID;
                }
 0[0-7]*                {
                        return ID;
                }
 0[0-7]*                {
-                       yylval = octal(yytext);
-                       tprintf("#O:%o ", yylval);
+                       yylval.val = octal(yytext);
+                       tprintf("#O:%o ", yylval.val);
                        return NUMBER;
                }
 0x[0-9a-f]+    {
                        return NUMBER;
                }
 0x[0-9a-f]+    {
-                       yylval = hex(yytext);
-                       tprintf("#X:%x ", yylval);
+                       yylval.val = hex(yytext);
+                       tprintf("#X:%x ", yylval.val);
                        return NUMBER;
                }
 [1-9][0-9]*    {
                        return NUMBER;
                }
 [1-9][0-9]*    {
-                       yylval = atoi(yytext);
-                       tprintf("#D:%d ", yylval);
+                       yylval.val = atoi(yytext);
+                       tprintf("#D:%d ", yylval.val);
                        return NUMBER;
                }
 [0-9]"."[0-9]* {
                        return NUMBER;
                }
 [0-9]"."[0-9]* {
-                       float atof();
-                       yylval = (int) (60 * atof(yytext) + 0.5);
+                       double atof();
+                       yylval.val = (int) (60 * atof(yytext) + 0.5);
                        return FPNUMBER;
                }
 "-"            {
                        return MINUS;
                }
 "?"            {
                        return FPNUMBER;
                }
 "-"            {
                        return MINUS;
                }
 "?"            {
-                       yylval = -1;
+                       yylval.val = -1;
                        tprintf("? ");
                        return NUMBER;
                }
                        tprintf("? ");
                        return NUMBER;
                }
@@ -119,7 +117,7 @@ char *str;
 {
        int num;
 
 {
        int num;
 
-       sscanf(str, "%o", &num);
+       (void) sscanf(str, "%o", &num);
        return num;
 }
 
        return num;
 }
 
@@ -128,6 +126,6 @@ char *str;
 {
        int num;
 
 {
        int num;
 
-       sscanf(str+2, "%x", &num);
+       (void) sscanf(str+2, "%x", &num);
        return num;
 }
        return num;
 }
index 2e50de4..21ee13a 100644 (file)
@@ -1,4 +1,4 @@
-/*     main.c  1.6     82/10/24        */
+/*     main.c  1.7     82/10/25        */
 
 #include <stdio.h>
 #include <ctype.h>
 
 #include <stdio.h>
 #include <ctype.h>
@@ -64,7 +64,7 @@ get_word(fp)
                if (ch != ' ' && ch != '\t')
                        break;
        if (ch == EOF)
                if (ch != ' ' && ch != '\t')
                        break;
        if (ch == EOF)
-               return (EOF);
+               return ((char *)EOF);
        if (ch == '\n')
                return (NULL);
        cp = line;
        if (ch == '\n')
                return (NULL);
        cp = line;
@@ -76,23 +76,24 @@ get_word(fp)
        }
        *cp = 0;
        if (ch == EOF)
        }
        *cp = 0;
        if (ch == EOF)
-               return (EOF);
-       ungetc(ch, fp);
+               return ((char *)EOF);
+       (void) ungetc(ch, fp);
        return (line);
 }
 
 /*
  * prepend the path to a filename
  */
        return (line);
 }
 
 /*
  * prepend the path to a filename
  */
+char *
 path(file)
        char *file;
 {
        register char *cp;
 
 path(file)
        char *file;
 {
        register char *cp;
 
-       cp = malloc(strlen(PREFIX)+strlen(file)+5);
-       strcpy(cp, "../");
-       strcat(cp, PREFIX);
-       strcat(cp, "/");
-       strcat(cp, file);
+       cp = malloc((unsigned)(strlen(PREFIX)+strlen(file)+5));
+       (void) strcpy(cp, "../");
+       (void) strcat(cp, PREFIX);
+       (void) strcat(cp, "/");
+       (void) strcat(cp, file);
        return (cp);
 }
        return (cp);
 }
index ac99d98..4feb3d1 100644 (file)
@@ -1,4 +1,4 @@
-/*     mkheaders.c     1.11    82/10/24        */
+/*     mkheaders.c     1.12    82/10/25        */
 
 /*
  * Make all the .h files for the optional entries
 
 /*
  * Make all the .h files for the optional entries
@@ -45,7 +45,8 @@ do_count(dev, hname, search)
                                count = dp->d_unit + 1;
                        if (search) {
                                mp = dp->d_conn;
                                count = dp->d_unit + 1;
                        if (search) {
                                mp = dp->d_conn;
-                               if (mp != 0 && mp != -1 && mp->d_conn != -1) {
+                               if (mp != 0 && mp != (struct device *)-1 &&
+                                   mp->d_conn != (struct device *)-1) {
                                        do_count(mp->d_name, hname, 0);
                                        search = 0;
                                }
                                        do_count(mp->d_name, hname, 0);
                                        search = 0;
                                }
@@ -74,19 +75,19 @@ do_header(dev, hname, count)
                        exit(1);
                }
                fprintf(outf, "#define %s %d\n", name, count);
                        exit(1);
                }
                fprintf(outf, "#define %s %d\n", name, count);
-               fclose(outf);
+               (void) fclose(outf);
                return;
        }
        fl_head = 0;
        for (;;) {
                char *cp;
                return;
        }
        fl_head = 0;
        for (;;) {
                char *cp;
-               if ((inw = get_word(inf)) == 0 || inw == EOF)
+               if ((inw = get_word(inf)) == 0 || inw == (char *)EOF)
                        break;
                        break;
-               if ((inw = get_word(inf)) == 0 || inw == EOF)
+               if ((inw = get_word(inf)) == 0 || inw == (char *)EOF)
                        break;
                inw = ns(inw);
                cp = get_word(inf);
                        break;
                inw = ns(inw);
                cp = get_word(inf);
-               if (cp == 0 || cp == EOF)
+               if (cp == 0 || cp == (char *)EOF)
                        break;
                inc = atoi(cp);
                if (eq(inw, name)) {
                        break;
                inc = atoi(cp);
                if (eq(inw, name)) {
@@ -94,7 +95,7 @@ do_header(dev, hname, count)
                        inc = count;
                }
                cp = get_word(inf);
                        inc = count;
                }
                cp = get_word(inf);
-               if (cp == 0 || cp == EOF)
+               if (cp == 0 || cp == (char *)EOF)
                        break;
                fl = (struct file_list *) malloc(sizeof *fl);
                fl->f_fn = inw;
                        break;
                fl = (struct file_list *) malloc(sizeof *fl);
                fl->f_fn = inw;
@@ -102,10 +103,10 @@ do_header(dev, hname, count)
                fl->f_next = fl_head;
                fl_head = fl;
        }
                fl->f_next = fl_head;
                fl_head = fl;
        }
-       fclose(inf);
+       (void) fclose(inf);
        if (count == oldcount) {
                for (fl = fl_head; fl != 0; fl = fl->f_next)
        if (count == oldcount) {
                for (fl = fl_head; fl != 0; fl = fl->f_next)
-                       free(fl);
+                       free((char *)fl);
                return;
        }
        if (oldcount == -1) {
                return;
        }
        if (oldcount == -1) {
@@ -123,9 +124,9 @@ do_header(dev, hname, count)
        for (fl = fl_head; fl != 0; fl = fl->f_next) {
                fprintf(outf, "#define %s %d\n",
                    fl->f_fn, count ? fl->f_type : 0);
        for (fl = fl_head; fl != 0; fl = fl->f_next) {
                fprintf(outf, "#define %s %d\n",
                    fl->f_fn, count ? fl->f_type : 0);
-               free(fl);
+               free((char *)fl);
        }
        }
-       fclose(outf);
+       (void) fclose(outf);
 }
 
 /*
 }
 
 /*
@@ -137,8 +138,8 @@ toheader(dev)
 {
        static char hbuf[80];
 
 {
        static char hbuf[80];
 
-       strcpy(hbuf, path(dev));
-       strcat(hbuf, ".h");
+       (void) strcpy(hbuf, path(dev));
+       (void) strcat(hbuf, ".h");
        return (hbuf);
 }
 
        return (hbuf);
 }
 
index 85d26d8..0c88142 100644 (file)
@@ -1,4 +1,4 @@
-/*     mkioconf.c      2.4     82/10/24        */
+/*     mkioconf.c      2.5     82/10/25        */
 
 #include <stdio.h>
 #include "y.tab.h"
 
 #include <stdio.h>
 #include "y.tab.h"
@@ -18,7 +18,7 @@ vax_ioconf()
        FILE *fp;
 
        fp = fopen(path("ioconf.c"), "w");
        FILE *fp;
 
        fp = fopen(path("ioconf.c"), "w");
-       if (fp == NULL) {
+       if (fp == 0) {
                perror(path("ioconf.c"));
                exit(1);
        }
                perror(path("ioconf.c"));
                exit(1);
        }
@@ -36,9 +36,9 @@ vax_ioconf()
         * First print the mba initialization structures
         */
        if (seen_mba) {
         * First print the mba initialization structures
         */
        if (seen_mba) {
-               for (dp = dtab; dp != NULL; dp = dp->d_next) {
+               for (dp = dtab; dp != 0; dp = dp->d_next) {
                        mp = dp->d_conn;
                        mp = dp->d_conn;
-                       if (mp == NULL || mp == TO_NEXUS ||
+                       if (mp == 0 || mp == TO_NEXUS ||
                            !eq(mp->d_name, "mba"))
                                continue;
                        fprintf(fp, "extern struct mba_driver %sdriver;\n",
                            !eq(mp->d_name, "mba"))
                                continue;
                        fprintf(fp, "extern struct mba_driver %sdriver;\n",
@@ -46,9 +46,9 @@ vax_ioconf()
                }
                fprintf(fp, "\nstruct mba_device mbdinit[] = {\n");
                fprintf(fp, "\t/* Device,  Unit, Mba, Drive, Dk */\n");
                }
                fprintf(fp, "\nstruct mba_device mbdinit[] = {\n");
                fprintf(fp, "\t/* Device,  Unit, Mba, Drive, Dk */\n");
-               for (dp = dtab; dp != NULL; dp = dp->d_next) {
+               for (dp = dtab; dp != 0; dp = dp->d_next) {
                        mp = dp->d_conn;
                        mp = dp->d_conn;
-                       if (dp->d_unit == QUES || mp == NULL ||
+                       if (dp->d_unit == QUES || mp == 0 ||
                            mp == TO_NEXUS || !eq(mp->d_name, "mba"))
                                continue;
                        if (dp->d_addr) {
                            mp == TO_NEXUS || !eq(mp->d_name, "mba"))
                                continue;
                        if (dp->d_addr) {
@@ -56,7 +56,7 @@ vax_ioconf()
                                    dp->d_name, dp->d_unit);
                                continue;
                        }
                                    dp->d_name, dp->d_unit);
                                continue;
                        }
-                       if (dp->d_vec != NULL) {
+                       if (dp->d_vec != 0) {
                                printf("can't specify vector for %s%d on mba\n",
                                    dp->d_name, dp->d_unit);
                                continue;
                                printf("can't specify vector for %s%d on mba\n",
                                    dp->d_name, dp->d_unit);
                                continue;
@@ -83,15 +83,15 @@ vax_ioconf()
                 */
                fprintf(fp, "struct mba_slave mbsinit [] = {\n");
                fprintf(fp, "\t/* Driver,  Ctlr, Unit, Slave */\n");
                 */
                fprintf(fp, "struct mba_slave mbsinit [] = {\n");
                fprintf(fp, "\t/* Driver,  Ctlr, Unit, Slave */\n");
-               for (dp = dtab; dp != NULL; dp = dp->d_next) {
+               for (dp = dtab; dp != 0; dp = dp->d_next) {
                        /*
                         * All slaves are connected to something which
                         * is connected to the massbus.
                         */
                        /*
                         * All slaves are connected to something which
                         * is connected to the massbus.
                         */
-                       if ((mp = dp->d_conn) == NULL || mp == TO_NEXUS)
+                       if ((mp = dp->d_conn) == 0 || mp == TO_NEXUS)
                                continue;
                        np = mp->d_conn;
                                continue;
                        np = mp->d_conn;
-                       if (np == NULL || np == TO_NEXUS ||
+                       if (np == 0 || np == TO_NEXUS ||
                            !eq(np->d_name, "mba"))
                                continue;
                        fprintf(fp,
                            !eq(np->d_name, "mba"))
                                continue;
                        fprintf(fp,
@@ -104,11 +104,11 @@ vax_ioconf()
        /*
         * Now generate interrupt vectors for the unibus
         */
        /*
         * Now generate interrupt vectors for the unibus
         */
-       for (dp = dtab; dp != NULL; dp = dp->d_next) {
-               if (dp->d_vec != NULL) {
+       for (dp = dtab; dp != 0; dp = dp->d_next) {
+               if (dp->d_vec != 0) {
                        struct idlst *ip;
                        mp = dp->d_conn;
                        struct idlst *ip;
                        mp = dp->d_conn;
-                       if (mp == NULL || mp == TO_NEXUS ||
+                       if (mp == 0 || mp == TO_NEXUS ||
                            !eq(mp->d_name, "uba"))
                                continue;
                        fprintf(fp,
                            !eq(mp->d_name, "uba"))
                                continue;
                        fprintf(fp,
@@ -139,9 +139,9 @@ vax_ioconf()
        }
        fprintf(fp, "\nstruct uba_ctlr ubminit[] = {\n");
        fprintf(fp, "/*\t driver,\tctlr,\tubanum,\talive,\tintr,\taddr */\n");
        }
        fprintf(fp, "\nstruct uba_ctlr ubminit[] = {\n");
        fprintf(fp, "/*\t driver,\tctlr,\tubanum,\talive,\tintr,\taddr */\n");
-       for (dp = dtab; dp != NULL; dp = dp->d_next) {
+       for (dp = dtab; dp != 0; dp = dp->d_next) {
                mp = dp->d_conn;
                mp = dp->d_conn;
-               if (dp->d_type != CONTROLLER || mp == TO_NEXUS || mp == NULL ||
+               if (dp->d_type != CONTROLLER || mp == TO_NEXUS || mp == 0 ||
                    !eq(mp->d_name, "uba"))
                        continue;
                if (dp->d_vec == 0) {
                    !eq(mp->d_name, "uba"))
                        continue;
                if (dp->d_vec == 0) {
@@ -176,16 +176,16 @@ vax_ioconf()
        fprintf(fp, "\nstruct uba_device ubdinit[] = {\n");
        fprintf(fp,
 "\t/* driver,  unit, ctlr,  ubanum, slave,   intr,    addr,    dk, flags*/\n");
        fprintf(fp, "\nstruct uba_device ubdinit[] = {\n");
        fprintf(fp,
 "\t/* driver,  unit, ctlr,  ubanum, slave,   intr,    addr,    dk, flags*/\n");
-       for (dp = dtab; dp != NULL; dp = dp->d_next) {
+       for (dp = dtab; dp != 0; dp = dp->d_next) {
                mp = dp->d_conn;
                mp = dp->d_conn;
-               if (dp->d_unit == QUES || dp->d_type != DEVICE || mp == NULL ||
+               if (dp->d_unit == QUES || dp->d_type != DEVICE || mp == 0 ||
                    mp == TO_NEXUS || mp->d_type == MASTER ||
                    eq(mp->d_name, "mba"))
                        continue;
                np = mp->d_conn;
                    mp == TO_NEXUS || mp->d_type == MASTER ||
                    eq(mp->d_name, "mba"))
                        continue;
                np = mp->d_conn;
-               if (np != NULL && np != TO_NEXUS && eq(np->d_name, "mba"))
+               if (np != 0 && np != TO_NEXUS && eq(np->d_name, "mba"))
                        continue;
                        continue;
-               np = NULL;
+               np = 0;
                if (eq(mp->d_name, "uba")) {
                        if (dp->d_vec == 0) {
                                printf("must specify vector for device %s%d\n",
                if (eq(mp->d_name, "uba")) {
                        if (dp->d_vec == 0) {
                                printf("must specify vector for device %s%d\n",
@@ -207,7 +207,7 @@ vax_ioconf()
                        uba_n = mp->d_unit;
                        slave = QUES;
                } else {
                        uba_n = mp->d_unit;
                        slave = QUES;
                } else {
-                       if ((np = mp->d_conn) == NULL) {
+                       if ((np = mp->d_conn) == 0) {
                                printf("%s%d isn't connected to anything ",
                                    mp->d_name, mp->d_unit);
                                printf(", so %s%d is unattached\n",
                                printf("%s%d isn't connected to anything ",
                                    mp->d_name, mp->d_unit);
                                printf(", so %s%d is unattached\n",
@@ -249,19 +249,19 @@ vax_ioconf()
                    slave, intv(dp), dp->d_addr, dp->d_dk, dp->d_flags);
        }
        fprintf(fp, "\t0\n};\n");
                    slave, intv(dp), dp->d_addr, dp->d_dk, dp->d_flags);
        }
        fprintf(fp, "\t0\n};\n");
-       fclose(fp);
+       (void) fclose(fp);
 }
 #endif
 
 #if MACHINE_SUN
 sun_ioconf()
 {
 }
 #endif
 
 #if MACHINE_SUN
 sun_ioconf()
 {
-       register struct device *dp, *mp, *np;
-       register int uba_n, slave;
+       register struct device *dp, *mp;
+       register int slave;
        FILE *fp;
 
        fp = fopen(path("ioconf.c"), "w");
        FILE *fp;
 
        fp = fopen(path("ioconf.c"), "w");
-       if (fp == NULL) {
+       if (fp == 0) {
                perror(path("ioconf.c"));
                exit(1);
        }
                perror(path("ioconf.c"));
                exit(1);
        }
@@ -277,10 +277,10 @@ sun_ioconf()
        /*
         * Now generate interrupt vectors for the Multibus
         */
        /*
         * Now generate interrupt vectors for the Multibus
         */
-       for (dp = dtab; dp != NULL; dp = dp->d_next) {
-               if (dp->d_pri != NULL) {
+       for (dp = dtab; dp != 0; dp = dp->d_next) {
+               if (dp->d_pri != 0) {
                        mp = dp->d_conn;
                        mp = dp->d_conn;
-                       if (mp == NULL || mp == TO_NEXUS ||
+                       if (mp == 0 || mp == TO_NEXUS ||
                            !eq(mp->d_name, "mb"))
                                continue;
                        fprintf(fp, "extern struct mb_driver %sdriver;\n",
                            !eq(mp->d_name, "mb"))
                                continue;
                        fprintf(fp, "extern struct mb_driver %sdriver;\n",
@@ -292,9 +292,9 @@ sun_ioconf()
         */
        fprintf(fp, "\nstruct mb_ctlr mbcinit[] = {\n");
        fprintf(fp, "/*\t driver,\tctlr,\talive,\taddr,\tintpri */\n");
         */
        fprintf(fp, "\nstruct mb_ctlr mbcinit[] = {\n");
        fprintf(fp, "/*\t driver,\tctlr,\talive,\taddr,\tintpri */\n");
-       for (dp = dtab; dp != NULL; dp = dp->d_next) {
+       for (dp = dtab; dp != 0; dp = dp->d_next) {
                mp = dp->d_conn;
                mp = dp->d_conn;
-               if (dp->d_type != CONTROLLER || mp == TO_NEXUS || mp == NULL ||
+               if (dp->d_type != CONTROLLER || mp == TO_NEXUS || mp == 0 ||
                    !eq(mp->d_name, "mb"))
                        continue;
                if (dp->d_pri == 0) {
                    !eq(mp->d_name, "mb"))
                        continue;
                if (dp->d_pri == 0) {
@@ -329,13 +329,12 @@ sun_ioconf()
        fprintf(fp, "\nstruct mb_device mbdinit[] = {\n");
        fprintf(fp,
 "\t/* driver,  unit, ctlr,  slave,   addr,    pri,    dk, flags*/\n");
        fprintf(fp, "\nstruct mb_device mbdinit[] = {\n");
        fprintf(fp,
 "\t/* driver,  unit, ctlr,  slave,   addr,    pri,    dk, flags*/\n");
-       for (dp = dtab; dp != NULL; dp = dp->d_next) {
+       for (dp = dtab; dp != 0; dp = dp->d_next) {
                mp = dp->d_conn;
                mp = dp->d_conn;
-               if (dp->d_unit == QUES || dp->d_type != DEVICE || mp == NULL ||
+               if (dp->d_unit == QUES || dp->d_type != DEVICE || mp == 0 ||
                    mp == TO_NEXUS || mp->d_type == MASTER ||
                    eq(mp->d_name, "mba"))
                        continue;
                    mp == TO_NEXUS || mp->d_type == MASTER ||
                    eq(mp->d_name, "mba"))
                        continue;
-               np = NULL;
                if (eq(mp->d_name, "mb")) {
                        if (dp->d_pri == 0) {
                                printf("must specify vector for device %s%d\n",
                if (eq(mp->d_name, "mb")) {
                        if (dp->d_pri == 0) {
                                printf("must specify vector for device %s%d\n",
@@ -355,7 +354,7 @@ sun_ioconf()
                        }
                        slave = QUES;
                } else {
                        }
                        slave = QUES;
                } else {
-                       if ((np = mp->d_conn) == NULL) {
+                       if (mp->d_conn == 0) {
                                printf("%s%d isn't connected to anything, ",
                                    mp->d_name, mp->d_unit);
                                printf("so %s%d is unattached\n",
                                printf("%s%d isn't connected to anything, ",
                                    mp->d_name, mp->d_unit);
                                printf("so %s%d is unattached\n",
@@ -396,7 +395,7 @@ sun_ioconf()
                    slave, dp->d_addr, dp->d_pri, dp->d_dk, dp->d_flags);
        }
        fprintf(fp, "\t0\n};\n");
                    slave, dp->d_addr, dp->d_pri, dp->d_dk, dp->d_flags);
        }
        fprintf(fp, "\t0\n};\n");
-       fclose(fp);
+       (void) fclose(fp);
 }
 #endif
 
 }
 #endif
 
@@ -407,8 +406,7 @@ char *intv(dev)
 
        if (dev->d_vec == 0)
                return ("     0");
 
        if (dev->d_vec == 0)
                return ("     0");
-       else
-               return (sprintf(buf, "%sint%d", dev->d_name, dev->d_unit));
+       return (sprintf(buf, "%sint%d", dev->d_name, dev->d_unit));
 }
 
 char *
 }
 
 char *
@@ -417,8 +415,7 @@ qu(num)
 
        if (num == QUES)
                return ("'?'");
 
        if (num == QUES)
                return ("'?'");
-       else if (num == UNKNOWN)
+       if (num == UNKNOWN)
                return (" -1");
                return (" -1");
-       else
-               return (ns(sprintf(errbuf, "%3d", num)));
+       return (sprintf(errbuf, "%3d", num));
 }
 }
index a5183ad..afecf46 100644 (file)
@@ -1,4 +1,4 @@
-/*     mkmakefile.c    1.20    82/10/24        */
+/*     mkmakefile.c    1.21    82/10/25        */
 
 /*
  * Build the makefile for the system, from
 
 /*
  * Build the makefile for the system, from
@@ -13,8 +13,8 @@
 
 #define next_word(fp, wd) \
        { register char *word = get_word(fp); \
 
 #define next_word(fp, wd) \
        { register char *word = get_word(fp); \
-         if (word == EOF) \
-               return (EOF); \
+         if (word == (char *)EOF) \
+               return; \
          else \
                wd = word; \
        }
          else \
                wd = word; \
        }
@@ -30,7 +30,7 @@ fl_lookup(file)
 {
        register struct file_list *fp;
 
 {
        register struct file_list *fp;
 
-       for (fp = ftab ; fp != NULL; fp = fp->f_next) {
+       for (fp = ftab ; fp != 0; fp = fp->f_next) {
                if (eq(fp->f_fn, file))
                        return (fp);
        }
                if (eq(fp->f_fn, file))
                        return (fp);
        }
@@ -46,8 +46,9 @@ new_fent()
        register struct file_list *fp;
 
        fp = (struct file_list *) malloc(sizeof *fp);
        register struct file_list *fp;
 
        fp = (struct file_list *) malloc(sizeof *fp);
-       fp->f_needs = fp->f_next = NULL;
-       if (fcur == NULL)
+       fp->f_needs = 0;
+       fp->f_next = 0;
+       if (fcur == 0)
                fcur = ftab = fp;
        else
                fcur->f_next = fp;
                fcur = ftab = fp;
        else
                fcur->f_next = fp;
@@ -68,14 +69,14 @@ makefile()
 
        read_files();
        strcpy(line, "../conf/makefile.");
 
        read_files();
        strcpy(line, "../conf/makefile.");
-       strcat(line, machinename);
+       (void) strcat(line, machinename);
        ifp = fopen(line, "r");
        ifp = fopen(line, "r");
-       if (ifp == NULL) {
+       if (ifp == 0) {
                perror(line);
                exit(1);
        }
        ofp = fopen(path("makefile"), "w");
                perror(line);
                exit(1);
        }
        ofp = fopen(path("makefile"), "w");
-       if (ofp == NULL) {
+       if (ofp == 0) {
                perror(path("makefile"));
                exit(1);
        }
                perror(path("makefile"));
                exit(1);
        }
@@ -110,7 +111,7 @@ makefile()
        }
        fprintf(ofp, "PARAM=-DTIMEZONE=%d -DDST=%d -DMAXUSERS=%d\n",
            timezone, dst, maxusers);
        }
        fprintf(ofp, "PARAM=-DTIMEZONE=%d -DDST=%d -DMAXUSERS=%d\n",
            timezone, dst, maxusers);
-       while (fgets(line, BUFSIZ, ifp) != NULL) {
+       while (fgets(line, BUFSIZ, ifp) != 0) {
                if (*line == '%')
                        goto percent;
                if (profiling && strncmp(line, "COPTS=", 6) == 0) {
                if (*line == '%')
                        goto percent;
                if (profiling && strncmp(line, "COPTS=", 6) == 0) {
@@ -123,7 +124,7 @@ makefile()
                        cp = line + 6;
                        while (*cp && (*cp == ' ' || *cp == '\t'))
                                cp++;
                        cp = line + 6;
                        while (*cp && (*cp == ' ' || *cp == '\t'))
                                cp++;
-                       COPTS = malloc(strlen(cp) + 1);
+                       COPTS = malloc((unsigned)(strlen(cp) + 1));
                        if (COPTS == 0) {
                                printf("config: out of memory\n");
                                exit(1);
                        if (COPTS == 0) {
                                printf("config: out of memory\n");
                                exit(1);
@@ -147,8 +148,8 @@ makefile()
                        fprintf(stderr,
                            "Unknown %% construct in generic makefile: %s",
                            line);
                        fprintf(stderr,
                            "Unknown %% construct in generic makefile: %s",
                            line);
-               fclose(ifp);
-               fclose(ofp);
+               (void) fclose(ifp);
+               (void) fclose(ofp);
        }
 }
 
        }
 }
 
@@ -166,31 +167,31 @@ read_files()
        int nreqs;
        int first = 1;
 
        int nreqs;
        int first = 1;
 
-       ftab = NULL;
-       strcpy(fname, "files");
+       ftab = 0;
+       (void) strcpy(fname, "files");
 openit:
        fp = fopen(fname, "r");
 openit:
        fp = fopen(fname, "r");
-       if (fp == NULL) {
+       if (fp == 0) {
                perror("../conf/files");
                exit(1);
        }
 next:
        /* filename     [ standard | optional dev* ] [ device-driver ] */
        wd = get_word(fp);
                perror("../conf/files");
                exit(1);
        }
 next:
        /* filename     [ standard | optional dev* ] [ device-driver ] */
        wd = get_word(fp);
-       if (wd == EOF) {
-               fclose(fp);
+       if (wd == (char *)EOF) {
+               (void) fclose(fp);
                if (first) {
                if (first) {
-                       sprintf(fname, "files.%s", machinename);
+                       (void) sprintf(fname, "files.%s", machinename);
                        first = 0;
                        goto openit;
                }
                return;
        }
                        first = 0;
                        goto openit;
                }
                return;
        }
-       if (wd == NULL)
+       if (wd == 0)
                goto next;
        this = ns(wd);
        next_word(fp, wd);
                goto next;
        this = ns(wd);
        next_word(fp, wd);
-       if (wd == NULL) {
+       if (wd == 0) {
                printf("%s: No type for %s.\n",
                    fname, this);
                exit(1);
                printf("%s: No type for %s.\n",
                    fname, this);
                exit(1);
@@ -212,7 +213,7 @@ next:
        }
 nextopt:
        next_word(fp, wd);
        }
 nextopt:
        next_word(fp, wd);
-       if (wd == NULL)
+       if (wd == 0)
                goto doneopt;
        devorprof = wd;
        if (eq(wd, "device-driver") || eq(wd, "profiling-routine"))
                goto doneopt;
        devorprof = wd;
        if (eq(wd, "device-driver") || eq(wd, "profiling-routine"))
@@ -220,10 +221,10 @@ nextopt:
        nreqs++;
        if (needs == 0)
                needs = ns(wd);
        nreqs++;
        if (needs == 0)
                needs = ns(wd);
-       for (dp = dtab; dp != NULL; dp = dp->d_next)
+       for (dp = dtab; dp != 0; dp = dp->d_next)
                if (eq(dp->d_name, wd))
                        goto nextopt;
                if (eq(dp->d_name, wd))
                        goto nextopt;
-       while ((wd = get_word(fp)) != NULL)
+       while ((wd = get_word(fp)) != 0)
                ;
        tp = new_fent();
        tp->f_fn = this;
                ;
        tp = new_fent();
        tp->f_fn = this;
@@ -239,13 +240,13 @@ doneopt:
 checkdev:
        if (wd) {
                next_word(fp, wd);
 checkdev:
        if (wd) {
                next_word(fp, wd);
-               if (wd != NULL) {
+               if (wd != 0) {
                        devorprof = wd;
                        next_word(fp, wd);
                }
        }
 save:
                        devorprof = wd;
                        next_word(fp, wd);
                }
        }
 save:
-       if (wd != NULL) {
+       if (wd != 0) {
                printf("%s: syntax error describing %s\n",
                    fname, this);
                exit(1);
                printf("%s: syntax error describing %s\n",
                    fname, this);
                exit(1);
@@ -272,7 +273,7 @@ do_objs(fp)
 
        fprintf(fp, "OBJS=");
        lpos = 6;
 
        fprintf(fp, "OBJS=");
        lpos = 6;
-       for (tp = ftab; tp != NULL; tp = tp->f_next) {
+       for (tp = ftab; tp != 0; tp = tp->f_next) {
                if (tp->f_type == INVISIBLE)
                        continue;
                sp = tail(tp->f_fn);
                if (tp->f_type == INVISIBLE)
                        continue;
                sp = tail(tp->f_fn);
@@ -299,7 +300,7 @@ do_cfiles(fp)
 
        fprintf(fp, "CFILES=");
        lpos = 8;
 
        fprintf(fp, "CFILES=");
        lpos = 8;
-       for (tp = ftab; tp != NULL; tp = tp->f_next) {
+       for (tp = ftab; tp != 0; tp = tp->f_next) {
                if (tp->f_type == INVISIBLE)
                        continue;
                if (tp->f_fn[strlen(tp->f_fn)-1] != 'c')
                if (tp->f_type == INVISIBLE)
                        continue;
                if (tp->f_fn[strlen(tp->f_fn)-1] != 'c')
@@ -338,7 +339,7 @@ do_rules(f)
        register char *cp, *np, och, *tp;
        register struct file_list *ftp;
 
        register char *cp, *np, och, *tp;
        register struct file_list *ftp;
 
-for (ftp = ftab; ftp != NULL; ftp = ftp->f_next) {
+for (ftp = ftab; ftp != 0; ftp = ftp->f_next) {
        if (ftp->f_type == INVISIBLE)
                continue;
        cp = (np = ftp->f_fn) + strlen(ftp->f_fn) - 1;
        if (ftp->f_type == INVISIBLE)
                continue;
        cp = (np = ftp->f_fn) + strlen(ftp->f_fn) - 1;
@@ -427,7 +428,7 @@ do_load(f)
        register struct file_list *fl;
        int first = 1;
 
        register struct file_list *fl;
        int first = 1;
 
-       for (fl = conf_list; fl != NULL; fl = fl->f_next) {
+       for (fl = conf_list; fl != 0; fl = fl->f_next) {
                fprintf(f, "%s: makefile locore.o ${OBJS} param.o",
                    fl->f_needs);
                fprintf(f, " ioconf.o swap%s.o\n", fl->f_fn);
                fprintf(f, "%s: makefile locore.o ${OBJS} param.o",
                    fl->f_needs);
                fprintf(f, " ioconf.o swap%s.o\n", fl->f_fn);
@@ -460,7 +461,7 @@ do_load(f)
                fprintf(f, "\t@size %s\n", fl->f_needs);
                fprintf(f, "\t@chmod 755 %s\n\n", fl->f_needs);
        }
                fprintf(f, "\t@size %s\n", fl->f_needs);
                fprintf(f, "\t@chmod 755 %s\n\n", fl->f_needs);
        }
-       for (fl = conf_list; fl != NULL; fl = fl->f_next) {
+       for (fl = conf_list; fl != 0; fl = fl->f_next) {
                fprintf(f, "swap%s.o: ../%s/swap%s.c\n",
                    fl->f_fn, machinename, fl->f_fn);
                switch (machine) {
                fprintf(f, "swap%s.o: ../%s/swap%s.c\n",
                    fl->f_fn, machinename, fl->f_fn);
                switch (machine) {
@@ -482,11 +483,12 @@ do_load(f)
                }
        }
        fprintf(f, "all:");
                }
        }
        fprintf(f, "all:");
-       for (fl = conf_list; fl != NULL; fl = fl->f_next)
+       for (fl = conf_list; fl != 0; fl = fl->f_next)
                fprintf(f, " %s", fl->f_needs);
        fprintf(f, "\n");
 }
 
                fprintf(f, " %s", fl->f_needs);
        fprintf(f, "\n");
 }
 
+char *
 raise(str)
        register char *str;
 {
 raise(str)
        register char *str;
 {
index fd9f8c3..e9aba09 100644 (file)
@@ -1,4 +1,4 @@
-/*     mkubglue.c      1.6     82/10/24        */
+/*     mkubglue.c      1.7     82/10/25        */
 
 /*
  * Make the uba interrupt file ubglue.s
 
 /*
  * Make the uba interrupt file ubglue.s
@@ -9,55 +9,54 @@
 
 ubglue()
 {
 
 ubglue()
 {
-    register FILE *fp;
-    register struct device *dp, *mp;
+       register FILE *fp;
+       register struct device *dp, *mp;
 
 
-    fp = fopen(path("ubglue.s"), "w");
-    if (fp == NULL) {
-       perror(path("ubglue.s"));
-       exit(1);
-    }
-    for (dp = dtab ; dp != NULL; dp = dp->d_next)
-    {
-       mp = dp->d_conn;
-       if (mp != NULL && mp != -1 && !eq(mp->d_name, "mba"))
-       {
-           struct idlst *id, *id2;
-           for (id = dp->d_vec; id; id = id->id_next) {
-               for (id2 = dp->d_vec; id2; id2 = id2->id_next) {
-                   if (id2 == id) {
-                       dump_vec(fp, id->id, dp->d_unit);
-                       break;
-                   }
-                   if (!strcmp(id->id, id2->id))
-                       break;
+       fp = fopen(path("ubglue.s"), "w");
+       if (fp == 0) {
+               perror(path("ubglue.s"));
+               exit(1);
+       }
+       for (dp = dtab; dp != 0; dp = dp->d_next) {
+               mp = dp->d_conn;
+               if (mp != 0 && mp != (struct device *)-1 &&
+                   !eq(mp->d_name, "mba")) {
+                       struct idlst *id, *id2;
+
+                       for (id = dp->d_vec; id; id = id->id_next) {
+                               for (id2 = dp->d_vec; id2; id2 = id2->id_next) {
+                                       if (id2 == id) {
+                                               dump_vec(fp, id->id, dp->d_unit);
+                                               break;
+                                       }
+                                       if (!strcmp(id->id, id2->id))
+                                               break;
+                               }
+                       }
                }
                }
-           }
        }
        }
-    }
-    fclose(fp);
+       (void) fclose(fp);
 }
 
 /*
 }
 
 /*
- * dump_vec
- *     Print an interrupt vector
+ * print an interrupt vector
  */
  */
-
 dump_vec(fp, vector, number)
 dump_vec(fp, vector, number)
-register FILE *fp;
-char *vector;
-int number;
+       register FILE *fp;
+       char *vector;
+       int number;
 {
 {
-    char nbuf[80];
-    register char *v = nbuf;
+       char nbuf[80];
+       register char *v = nbuf;
 
 
-    sprintf(v, "%s%d", vector, number);
-    fprintf(fp, "\t.globl\t_X%s\n\t.align\t2\n_X%s:\n\tpushr\t$0x3f\n", v, v);
-    if (strncmp(vector, "dzx", 3) == 0)
-       fprintf(fp, "\tmovl\t$%d,r0\n\tjmp\t_dzdma\n\n", number);
-    else
-    {
-       fprintf(fp, "\tpushl\t$%d\n", number);
-       fprintf(fp, "\tcalls\t$1,_%s\n\tpopr\t$0x3f\n\trei\n\n", vector);
-    }
+       (void) sprintf(v, "%s%d", vector, number);
+       fprintf(fp, "\t.globl\t_X%s\n\t.align\t2\n_X%s:\n\tpushr\t$0x3f\n",
+           v, v);
+       if (strncmp(vector, "dzx", 3) == 0)
+               fprintf(fp, "\tmovl\t$%d,r0\n\tjmp\t_dzdma\n\n", number);
+       else {
+               fprintf(fp, "\tpushl\t$%d\n", number);
+               fprintf(fp, "\tcalls\t$1,_%s\n\tpopr\t$0x3f\n\trei\n\n",
+                   vector);
+       }
 }
 }