From b14dd671b5f1dd0e06425d223ac8abcb4a5283f2 Mon Sep 17 00:00:00 2001 From: ceriel Date: Mon, 18 May 1987 13:34:06 +0000 Subject: [PATCH] Added lintlib, minor fixes --- modules/src/read_em/Makefile | 18 ++++++++++++++++-- modules/src/read_em/mkcalls.c | 4 ++-- modules/src/read_em/read_em.c | 6 +++--- modules/src/read_em/reade.c | 2 +- modules/src/read_em/readk.c | 8 ++++---- 5 files changed, 26 insertions(+), 12 deletions(-) diff --git a/modules/src/read_em/Makefile b/modules/src/read_em/Makefile index 2c4baf87b..4f9396d18 100644 --- a/modules/src/read_em/Makefile +++ b/modules/src/read_em/Makefile @@ -3,7 +3,8 @@ MODULES = $(EMHOME)/modules HDIR = $(MODULES)/h EMHDIR = $(EMHOME)/h INCLUDES = -I$(HDIR) -I$(EMHDIR) -CFLAGS = -O $(INCLUDES) -DPRIVATE=static -DEXPORT= +DEFINES = -DPRIVATE=static -DEXPORT= +CFLAGS = -O $(INCLUDES) $(DEFINES) INSTALL = $(MODULES)/install COMPARE = $(MODULES)/compare @@ -11,10 +12,18 @@ TARGETS = libread_emk.a\ libread_emkV.a\ libread_emeV.a +ESRCFILES = read_em.c\ + mkcalls.c\ + EM_vars.c + +KSRCFILES = read_em.c\ + mkcalls.c\ + EM_vars.c + SRCFILES = em_comp.h\ read_em.c\ reade.c\ - readk.c\ + readk.c \ mkcalls.c\ EM_vars.c @@ -84,3 +93,8 @@ C_mnem: m_C_mnem argtype C_mnem_narg: m_C_mnem_na argtype sh m_C_mnem_na > C_mnem_narg + +lintlib: C_mnem C_mnem_narg + lint $(INCLUDES) $(DEFINES) -DCOMPACT -DCHECKING -Cread_emkV $(KSRCFILES) + lint $(INCLUDES) $(DEFINES) -DCHECKING -Cread_emeV $(ESRCFILES) + mv llib-lread_emeV.ln llib-lread_emkV.ln $(MODULES)/lib diff --git a/modules/src/read_em/mkcalls.c b/modules/src/read_em/mkcalls.c index 66971c9c6..d3bb31ea9 100644 --- a/modules/src/read_em/mkcalls.c +++ b/modules/src/read_em/mkcalls.c @@ -308,7 +308,7 @@ EM_dopseudo(opcode, args) break; default: EM_error = "Illegal argument type"; - return 0; + return; } break; case ps_rom: @@ -344,7 +344,7 @@ EM_dopseudo(opcode, args) break; default: EM_error = "Illegal argument type"; - return 0; + return; } break; default: diff --git a/modules/src/read_em/read_em.c b/modules/src/read_em/read_em.c index 49aae9e12..48f1215c0 100644 --- a/modules/src/read_em/read_em.c +++ b/modules/src/read_em/read_em.c @@ -80,9 +80,11 @@ static struct string *i_strings; /* Index of last one used */ static struct e_args *argp; /* Indicates arguments yet to be delivered */ +#ifdef COMPACT static arith strleft; /* count # of chars left to read in a string */ +#endif static int state; /* What state are we in? */ #define CON 01 /* Reading a CON */ @@ -122,6 +124,7 @@ xerror(s) if (!EM_error) EM_error = s; } +#ifdef COMPACT PRIVATE xfatal(s) char *s; @@ -130,7 +133,6 @@ xfatal(s) if (!EM_error) EM_error = s; } -#ifdef COMPACT #include "readk.c" #else not COMPACT #include "reade.c" @@ -176,8 +178,6 @@ EXPORT EM_close() { - register struct string *pstr; - if (fd != STDIN) { sys_close(fd); fd = STDIN; diff --git a/modules/src/read_em/reade.c b/modules/src/read_em/reade.c index a4932612f..0e528b602 100644 --- a/modules/src/read_em/reade.c +++ b/modules/src/read_em/reade.c @@ -621,7 +621,7 @@ getlabel(c, p) PRIVATE struct e_instr * gethead() { - register int c, i; + register int c; register struct e_instr *p = &emhead; argnum = 1; diff --git a/modules/src/read_em/readk.c b/modules/src/read_em/readk.c index 8ef38e580..c8534e866 100644 --- a/modules/src/read_em/readk.c +++ b/modules/src/read_em/readk.c @@ -71,7 +71,7 @@ getarg(typset) ap->em_noff = 0; ap->em_argtype = nof_ptyp; #ifdef CHECKING - if (ap->em_dlb < 0 && !EM_error) { + if (ap->em_dlb > 32767 && !EM_error) { EM_error = "Illegal data label"; break; } @@ -87,7 +87,7 @@ getarg(typset) ap->em_ilb = get16(); ap->em_argtype = ilb_ptyp; #ifdef CHECKING - if (ap->em_ilb < 0 && !EM_error) { + if (ap->em_ilb > 32767 && !EM_error) { EM_error = "Illegal instruction label"; break; } @@ -326,7 +326,7 @@ gethead() p->em_type = EM_DEFILB; p->em_deflb = get16(); #ifdef CHECKING - if (p->em_deflb < 0 && !EM_error) { + if (p->em_deflb > 32767 && !EM_error) { EM_error = "Illegal instruction label definition"; } #endif CHECKING @@ -341,7 +341,7 @@ gethead() p->em_type = EM_DEFDLB; p->em_deflb = get16(); #ifdef CHECKING - if (p->em_deflb < 0 && !EM_error) { + if (p->em_deflb > 32767 && !EM_error) { EM_error = "Illegal data label definition"; } #endif CHECKING