Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netiso/xebec Make compilable with -Wall, in hope this co...



details:   https://anonhg.NetBSD.org/src/rev/799aa60bd13f
branches:  trunk
changeset: 511340:799aa60bd13f
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Mon Jun 18 09:57:27 2001 +0000

description:
Make compilable with -Wall, in hope this could be actually useful
(which is unlikely)

diffstat:

 sys/netiso/xebec/Makefile    |   5 +-
 sys/netiso/xebec/llparse.c   |  58 +++++++++++++++++++-------------
 sys/netiso/xebec/llparse.h   |  41 ++++++++++++++--------
 sys/netiso/xebec/llscan.c    |  25 +++++++++----
 sys/netiso/xebec/main.c      |  46 ++++++++++++++++++-------
 sys/netiso/xebec/main.h      |   7 ++-
 sys/netiso/xebec/malloc.c    |  18 +++++----
 sys/netiso/xebec/procs.c     |  61 ++++++++++++++++++++--------------
 sys/netiso/xebec/procs.h     |   6 ++-
 sys/netiso/xebec/putdriver.c |   7 ++-
 sys/netiso/xebec/sets.c      |  78 ++++++++++++++++++++++++++-----------------
 sys/netiso/xebec/sets.h      |  10 +++-
 sys/netiso/xebec/xebec.bnf   |   3 +-
 sys/netiso/xebec/xebec.c     |   4 +-
 14 files changed, 232 insertions(+), 137 deletions(-)

diffs (truncated from 1106 to 300 lines):

diff -r f582e3ac4249 -r 799aa60bd13f sys/netiso/xebec/Makefile
--- a/sys/netiso/xebec/Makefile Mon Jun 18 09:41:06 2001 +0000
+++ b/sys/netiso/xebec/Makefile Mon Jun 18 09:57:27 2001 +0000
@@ -1,9 +1,10 @@
-#      $NetBSD: Makefile,v 1.7 1999/02/13 02:54:54 lukem Exp $
+#      $NetBSD: Makefile,v 1.8 2001/06/18 09:57:27 jdolecek Exp $
 #      @(#)Makefile    5.16 (Berkeley) 4/26/91
 
 PROG=  xebec
 SRCS=  llparse.c llscan.c main.c malloc.c procs.c putdriver.c sets.c xebec.c
-CPPFLAGS+= -DDEBUG -traditional
+CPPFLAGS+= -Wall -DDEBUG -traditional
 MKMAN= no
+WARNS=0
 
 .include <bsd.prog.mk>
diff -r f582e3ac4249 -r 799aa60bd13f sys/netiso/xebec/llparse.c
--- a/sys/netiso/xebec/llparse.c        Mon Jun 18 09:41:06 2001 +0000
+++ b/sys/netiso/xebec/llparse.c        Mon Jun 18 09:57:27 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: llparse.c,v 1.4 1994/06/29 06:41:02 cgd Exp $  */
+/*     $NetBSD: llparse.c,v 1.5 2001/06/18 09:57:27 jdolecek Exp $     */
 
 /*
  * ************************* NOTICE *******************************
@@ -24,13 +24,16 @@
 short          llstackptr = 0;
 LLtoken                lltoken;
 
+void           prt_token();
+
+int
 llparse()
 {
-       register                havetoken = FALSE;
-       register                sym;
+       register int            havetoken = FALSE;
+       register int            sym;
        register LLtoken        *t = &lltoken;
-       register                parseaction;
-       register                accepted = FALSE;
+       register int            parseaction;
+       register int            accepted = FALSE;
 
        llpushprod(llnprods-1); /* $$$ ::= <start symbol>  */
 
@@ -115,12 +118,13 @@
        return(0);
 }
 
+void
 llpushprod(prod)       /* recognize production prod - push rhs on stack */
-short prod;
+       short prod;
 {
-       register        start;
-       register        length;
-       register        count;
+       register int    start;
+       register int    length;
+       register int    count;
 
        start = llprodindex[prod].llprodstart;
        length = llprodindex[prod].llprodlength;
@@ -162,14 +166,14 @@
        }
 }
 
-
+int
 llepsilonok(term)
 {
-       register        ptr;
-       register        sym;
-       register        pact;
-       register        nomore;
-       register        rval;
+       register int    ptr;
+       register int    sym;
+       register int    pact;
+       register int    nomore;
+       register int    rval;
 
        IFDEBUG(L)
                printf("llepsilonok() enter\n");
@@ -215,9 +219,10 @@
 }
 
 
-short llfindaction(sym, term)
+short
+llfindaction(sym, term)
 {
-       register        index;
+       register int    index;
 
        IFDEBUG(L)
                printf("llfindaction(sym=%d, term=%d) enter \n", sym, term);
@@ -233,7 +238,7 @@
        return(0);
 }
 
-
+void
 llparsererror(token)
 LLtoken *token;
 {
@@ -248,9 +253,9 @@
        Exit(-1);
 }
 
-
+void
 llgettoken(token)
-LLtoken *token;
+       LLtoken *token;
 {
        llscan(token);
        token->llstate = NORMAL;
@@ -283,8 +288,9 @@
 
 int    lldescindex = 1;
 
-
+void
 llsetattr(n)
+       int n;
 {
        register struct llattr *ptr;
 
@@ -306,8 +312,9 @@
        lldescindex++;
 }
 
+void
 llpushattr(attr)
-LLattrib attr;
+       LLattrib attr;
 {
        struct llattr *a;
 
@@ -323,6 +330,7 @@
        a->llaindex++; /* inc count of attrs on the stack for this prod */
 }
 
+void
 llfinprod()
 {
        IFDEBUG(L)
@@ -337,6 +345,7 @@
 
 #ifndef LINT
 #ifdef DEBUG
+void
 dump_parse_stack()
 {
        int ind;
@@ -352,10 +361,11 @@
 #endif DEBUG
 #endif LINT
 
+void
 prt_token(t)
-LLtoken *t;
+       LLtoken *t;
 {
-       fprintf(stdout, "t at 0x%x\n", t);
+       fprintf(stdout, "t at 0x%p\n", t);
        fprintf(stdout, "t->llterm=0x%x\n", t->llterm); (void) fflush(stdout);
        fprintf(stdout, "TOK: %s\n", llstrings[t->llterm]);
        (void) fflush(stdout);
diff -r f582e3ac4249 -r 799aa60bd13f sys/netiso/xebec/llparse.h
--- a/sys/netiso/xebec/llparse.h        Mon Jun 18 09:41:06 2001 +0000
+++ b/sys/netiso/xebec/llparse.h        Mon Jun 18 09:57:27 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: llparse.h,v 1.4 1994/06/29 06:41:04 cgd Exp $  */
+/*     $NetBSD: llparse.h,v 1.5 2001/06/18 09:57:27 jdolecek Exp $     */
 
        /************************************************************
                attributes stack garbage
@@ -127,18 +127,29 @@
        routines defined in llparse.c
 ************************************************************/
 
-extern llparse();
-extern llcopye();
-extern llcopys();
-extern llcorrector();
-extern llepsilonok();
-extern llexpand();
+extern int llparse();
+extern void llcopye();
+extern void llcopys();
+extern void llcorrector();
+extern int llepsilonok();
+extern void llexpand();
 extern short llfindaction();
-extern llgetprefix();
-extern llgettoken();
-extern llinsert();
-extern llinsertsym();
-extern llinserttokens();
-extern llparsererror();
-extern llpushprod();
-extern llreadetab();
+extern void llgetprefix();
+extern void llgettoken();
+extern void llinsert();
+extern void llinsertsym();
+extern void llinserttokens();
+extern void llparsererror();
+extern void llpushprod();
+extern void llreadetab();
+extern void llaction();
+extern void llpushattr();
+extern void llsetattr();
+extern void llfinprod();
+
+/************************************************************
+       routines defined in llscan.c
+************************************************************/
+extern void llscan();
+extern void dump_buffer();
+extern void llaccept();
diff -r f582e3ac4249 -r 799aa60bd13f sys/netiso/xebec/llscan.c
--- a/sys/netiso/xebec/llscan.c Mon Jun 18 09:41:06 2001 +0000
+++ b/sys/netiso/xebec/llscan.c Mon Jun 18 09:57:27 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: llscan.c,v 1.5 1994/06/29 06:41:05 cgd Exp $   */
+/*     $NetBSD: llscan.c,v 1.6 2001/06/18 09:57:27 jdolecek Exp $      */
 
 /*
  * ************************* NOTICE *******************************
@@ -16,6 +16,7 @@
 #include <stdio.h>
 #include "procs.h"
 #include "debug.h"
+#include <string.h>
 
 #define EOFILE 0x01
 #define UNUSED 0x02
@@ -72,6 +73,10 @@
 
 static int ch = ' ';
 
+int getch();
+extern void AddCurrentEventName();
+
+void
 skip()
 {
        while((chtype[ch] == IGNORE) ) {
@@ -79,8 +84,9 @@
        }
 }
 
+void
 llaccept(t)
-LLtoken *t;
+       LLtoken *t;
 {
        switch(t->llstate) {
        case NORMAL:
@@ -96,7 +102,7 @@
 
 #define        TVAL    (t->llattrib)
 
-
+void
 dump_buffer()
 {
        register int i;
@@ -135,6 +141,7 @@
        return(0);
 }
 
+void
 getstr(o,c) 
        /* c is the string delimiter 
         * allow the delimiter to be escaped 
@@ -151,7 +158,7 @@
        IFDEBUG(S)
                fprintf(stdout,"getstr: ch=%c, delimiters %c %c\n",
                        ch,o, c);
-               fprintf(stdout,"getstr: buffptr 0x%x, currentbuf 0x%x\n",
+               fprintf(stdout,"getstr: buffptr 0x%p, currentbuf 0x%x\n",
                        buffptr, currentbuf);
        ENDDEBUG
 
@@ -234,7 +241,7 @@
                        fprintf(stderr, 
                        "%s too long.\n", (o=='{')?"Action":"Predicate"); /*}*/
                        fprintf(stderr, 
-                       "buffptr, currentbuf 0x%x, 0x%x\n",buffptr,currentbuf );
+                       "buffptr, currentbuf 0x%p, 0x%x\n",buffptr,currentbuf );
                        Exit(-1);
                }
                IFDEBUG(S)
@@ -247,11 +254,12 @@
 



Home | Main Index | Thread Index | Old Index