Added lintlib

This commit is contained in:
ceriel 1987-05-18 13:49:59 +00:00
parent 869e3bdc9a
commit e938380cb8
5 changed files with 18 additions and 11 deletions

View 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

View 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;

View 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;

View 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);

View 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