Added lintlib
This commit is contained in:
parent
869e3bdc9a
commit
e938380cb8
5 changed files with 18 additions and 11 deletions
|
@ -2,16 +2,18 @@ EMHOME=../../..
|
||||||
HDIR = $(EMHOME)/modules/h
|
HDIR = $(EMHOME)/modules/h
|
||||||
INSTALL=$(EMHOME)/modules/install
|
INSTALL=$(EMHOME)/modules/install
|
||||||
COMPARE=$(EMHOME)/modules/compare
|
COMPARE=$(EMHOME)/modules/compare
|
||||||
|
INCLUDES = -I. -I$(HDIR)
|
||||||
|
|
||||||
CFLAGS = -O -I. -I$(HDIR)
|
CFLAGS = -O $(INCLUDES)
|
||||||
|
|
||||||
SOURCES = alloc.h\
|
CSRC = Malloc.c\
|
||||||
Malloc.c\
|
|
||||||
botch.c\
|
botch.c\
|
||||||
clear.c\
|
clear.c\
|
||||||
st_alloc.c\
|
st_alloc.c\
|
||||||
std_alloc.c \
|
std_alloc.c \
|
||||||
No_Mem.c
|
No_Mem.c
|
||||||
|
SOURCES = alloc.h\
|
||||||
|
$(CSRC)
|
||||||
|
|
||||||
OBJECTS = botch.o clear.o st_alloc.o Malloc.o std_alloc.o No_Mem.o
|
OBJECTS = botch.o clear.o st_alloc.o Malloc.o std_alloc.o No_Mem.o
|
||||||
|
|
||||||
|
@ -40,6 +42,9 @@ opr:
|
||||||
clean:
|
clean:
|
||||||
rm -f *.[oa]
|
rm -f *.[oa]
|
||||||
|
|
||||||
|
lintlib:
|
||||||
|
lint $(INCLUDES) -Calloc $(CSRC)
|
||||||
|
mv llib-lalloc.ln $(EMHOME)/modules/lib
|
||||||
st_alloc.o: alloc.h
|
st_alloc.o: alloc.h
|
||||||
std_alloc.o: alloc.h
|
std_alloc.o: alloc.h
|
||||||
Malloc.o: alloc.h
|
Malloc.o: alloc.h
|
||||||
|
|
|
@ -7,15 +7,13 @@
|
||||||
to check if freed memory is used inappopriately.
|
to check if freed memory is used inappopriately.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
#include "in_all.h"
|
#include "in_all.h"
|
||||||
|
|
||||||
EXPORT
|
EXPORT
|
||||||
botch(ptr, n)
|
botch(ptr, n)
|
||||||
char *ptr;
|
register char *ptr;
|
||||||
int n;
|
register int n;
|
||||||
{
|
{
|
||||||
assert((long)ptr % sizeof (long) == 0);
|
|
||||||
while (n >= sizeof (long)) {
|
while (n >= sizeof (long)) {
|
||||||
/* high-speed botch loop */
|
/* high-speed botch loop */
|
||||||
*(long *)ptr = 025252525252L;
|
*(long *)ptr = 025252525252L;
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
/* clear - clear a block of memory, and try to do it fast.
|
/* clear - clear a block of memory, and try to do it fast.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
#include "in_all.h"
|
#include "in_all.h"
|
||||||
|
|
||||||
/* instead of Calloc: */
|
/* instead of Calloc: */
|
||||||
|
@ -17,7 +16,6 @@ clear(ptr, n)
|
||||||
{
|
{
|
||||||
register long *q = (long *) ptr;
|
register long *q = (long *) ptr;
|
||||||
|
|
||||||
assert((long)q % sizeof (long) == 0);
|
|
||||||
while (n >= sizeof (long)) {
|
while (n >= sizeof (long)) {
|
||||||
/* high-speed clear loop */
|
/* high-speed clear loop */
|
||||||
*q++ = 0;
|
*q++ = 0;
|
||||||
|
|
|
@ -22,6 +22,7 @@ st_alloc(phead, size, count)
|
||||||
register unsigned int size;
|
register unsigned int size;
|
||||||
{
|
{
|
||||||
register char *p;
|
register char *p;
|
||||||
|
register long *q;
|
||||||
char *retval;
|
char *retval;
|
||||||
|
|
||||||
if (*phead == 0) {
|
if (*phead == 0) {
|
||||||
|
@ -38,7 +39,7 @@ st_alloc(phead, size, count)
|
||||||
*phead = ((struct xxx *)p)->next;
|
*phead = ((struct xxx *)p)->next;
|
||||||
retval = p;
|
retval = p;
|
||||||
if (size >= sizeof(long)) {
|
if (size >= sizeof(long)) {
|
||||||
register long *q = (long *) p;
|
q = (long *) p;
|
||||||
do {
|
do {
|
||||||
*q++ = 0;
|
*q++ = 0;
|
||||||
size -= sizeof(long);
|
size -= sizeof(long);
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
EMHOME=../../..
|
EMHOME=../../..
|
||||||
MODULES=$(EMHOME)/modules
|
MODULES=$(EMHOME)/modules
|
||||||
HDIR = $(MODULES)/h
|
HDIR = $(MODULES)/h
|
||||||
CFLAGS = -I$(HDIR) -O
|
INCLUDES = -I$(HDIR)
|
||||||
|
CFLAGS = $(INCLUDES) -O
|
||||||
INSTALL = $(MODULES)/install
|
INSTALL = $(MODULES)/install
|
||||||
COMPARE = $(MODULES)/compare
|
COMPARE = $(MODULES)/compare
|
||||||
|
|
||||||
|
@ -29,3 +30,7 @@ opr:
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.[oa]
|
rm -f *.[oa]
|
||||||
|
|
||||||
|
lintlib:
|
||||||
|
lint $(INCLUDES) -Cassert BadAssert.c
|
||||||
|
mv llib-lassert.ln $(MODULES)/lib
|
||||||
|
|
Loading…
Add table
Reference in a new issue