Added lintlib
authorceriel <none@none>
Mon, 18 May 1987 13:49:59 +0000 (13:49 +0000)
committerceriel <none@none>
Mon, 18 May 1987 13:49:59 +0000 (13:49 +0000)
modules/src/alloc/Makefile
modules/src/alloc/botch.c
modules/src/alloc/clear.c
modules/src/alloc/st_alloc.c
modules/src/assert/Makefile

index 964238a..7c0e1ff 100644 (file)
@@ -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
index c9ab827..c47c67d 100644 (file)
@@ -7,15 +7,13 @@
                to check if freed memory is used inappopriately.
 */
 
-#include <assert.h>
 #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;
index 4ebd20e..bc83bed 100644 (file)
@@ -6,7 +6,6 @@
 /*     clear - clear a block of memory, and try to do it fast.
 */
 
-#include <assert.h>
 #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;
index b5d9b3c..9b76050 100644 (file)
@@ -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);
index 7afc279..f3e2d06 100644 (file)
@@ -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