From e938380cb894f40d94d399cd5f5032bec2094ce9 Mon Sep 17 00:00:00 2001 From: ceriel Date: Mon, 18 May 1987 13:49:59 +0000 Subject: [PATCH] Added lintlib --- modules/src/alloc/Makefile | 11 ++++++++--- modules/src/alloc/botch.c | 6 ++---- modules/src/alloc/clear.c | 2 -- modules/src/alloc/st_alloc.c | 3 ++- modules/src/assert/Makefile | 7 ++++++- 5 files changed, 18 insertions(+), 11 deletions(-) diff --git a/modules/src/alloc/Makefile b/modules/src/alloc/Makefile index 964238a9c..7c0e1ff0b 100644 --- a/modules/src/alloc/Makefile +++ b/modules/src/alloc/Makefile @@ -2,16 +2,18 @@ EMHOME=../../.. HDIR = $(EMHOME)/modules/h INSTALL=$(EMHOME)/modules/install COMPARE=$(EMHOME)/modules/compare +INCLUDES = -I. -I$(HDIR) -CFLAGS = -O -I. -I$(HDIR) +CFLAGS = -O $(INCLUDES) -SOURCES = alloc.h\ - Malloc.c\ +CSRC = Malloc.c\ botch.c\ clear.c\ st_alloc.c\ std_alloc.c \ No_Mem.c +SOURCES = alloc.h\ + $(CSRC) OBJECTS = botch.o clear.o st_alloc.o Malloc.o std_alloc.o No_Mem.o @@ -40,6 +42,9 @@ opr: clean: rm -f *.[oa] +lintlib: + lint $(INCLUDES) -Calloc $(CSRC) + mv llib-lalloc.ln $(EMHOME)/modules/lib st_alloc.o: alloc.h std_alloc.o: alloc.h Malloc.o: alloc.h diff --git a/modules/src/alloc/botch.c b/modules/src/alloc/botch.c index c9ab82713..c47c67d50 100644 --- a/modules/src/alloc/botch.c +++ b/modules/src/alloc/botch.c @@ -7,15 +7,13 @@ to check if freed memory is used inappopriately. */ -#include #include "in_all.h" EXPORT botch(ptr, n) - char *ptr; - int n; + register char *ptr; + register int n; { - assert((long)ptr % sizeof (long) == 0); while (n >= sizeof (long)) { /* high-speed botch loop */ *(long *)ptr = 025252525252L; diff --git a/modules/src/alloc/clear.c b/modules/src/alloc/clear.c index 4ebd20e7f..bc83bed01 100644 --- a/modules/src/alloc/clear.c +++ b/modules/src/alloc/clear.c @@ -6,7 +6,6 @@ /* clear - clear a block of memory, and try to do it fast. */ -#include #include "in_all.h" /* instead of Calloc: */ @@ -17,7 +16,6 @@ clear(ptr, n) { register long *q = (long *) ptr; - assert((long)q % sizeof (long) == 0); while (n >= sizeof (long)) { /* high-speed clear loop */ *q++ = 0; diff --git a/modules/src/alloc/st_alloc.c b/modules/src/alloc/st_alloc.c index b5d9b3c5c..9b760509f 100644 --- a/modules/src/alloc/st_alloc.c +++ b/modules/src/alloc/st_alloc.c @@ -22,6 +22,7 @@ st_alloc(phead, size, count) register unsigned int size; { register char *p; + register long *q; char *retval; if (*phead == 0) { @@ -38,7 +39,7 @@ st_alloc(phead, size, count) *phead = ((struct xxx *)p)->next; retval = p; if (size >= sizeof(long)) { - register long *q = (long *) p; + q = (long *) p; do { *q++ = 0; size -= sizeof(long); diff --git a/modules/src/assert/Makefile b/modules/src/assert/Makefile index 7afc27965..f3e2d0600 100644 --- a/modules/src/assert/Makefile +++ b/modules/src/assert/Makefile @@ -1,7 +1,8 @@ EMHOME=../../.. MODULES=$(EMHOME)/modules HDIR = $(MODULES)/h -CFLAGS = -I$(HDIR) -O +INCLUDES = -I$(HDIR) +CFLAGS = $(INCLUDES) -O INSTALL = $(MODULES)/install COMPARE = $(MODULES)/compare @@ -29,3 +30,7 @@ opr: clean: rm -f *.[oa] + +lintlib: + lint $(INCLUDES) -Cassert BadAssert.c + mv llib-lassert.ln $(MODULES)/lib -- 2.34.1