From: jtvolpe Date: Wed, 28 Feb 2001 05:47:30 +0000 (+0000) Subject: Additional corrections for Safe_calloc in sdcdb X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=331ae7a198d9092d6c3b0588572c70812810bfc6;p=fw%2Fsdcc Additional corrections for Safe_calloc in sdcdb git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@660 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/debugger/mcs51/break.c b/debugger/mcs51/break.c index fe412946..4e5c263c 100644 --- a/debugger/mcs51/break.c +++ b/debugger/mcs51/break.c @@ -24,6 +24,7 @@ #include "sdcdb.h" #include "symtab.h" #include "break.h" +#include "newalloc.h" static hTab *bptable = NULL; char userBpPresent = 0; @@ -42,7 +43,7 @@ int setBreakPoint (unsigned addr, char addrType, char bpType, char simbuf[50]; /* allocate & init a new bp */ - Safe_calloc(1,bp,sizeof(breakp)); + bp = Safe_calloc(1,sizeof(breakp)); bp->addr = addr; bp->addrType = addrType; bp->bpType = bpType; diff --git a/debugger/mcs51/sdcdb.c b/debugger/mcs51/sdcdb.c index 3d53fd83..f23dba38 100644 --- a/debugger/mcs51/sdcdb.c +++ b/debugger/mcs51/sdcdb.c @@ -238,7 +238,7 @@ static int readCdb (FILE *file) } bp += 2; - currl->line = Safe_calloc(1,strlen(bp)); + currl->line = Safe_malloc(strlen(bp)); strncpy(currl->line,bp,strlen(bp)-1); currl->line[strlen(bp)-1] = '\0'; } diff --git a/debugger/mcs51/symtab.c b/debugger/mcs51/symtab.c index 5333eae4..0e5b8c6a 100644 --- a/debugger/mcs51/symtab.c +++ b/debugger/mcs51/symtab.c @@ -23,6 +23,7 @@ #include "sdcdb.h" #include "symtab.h" +#include "newalloc.h" extern char *currModName ; structdef *structWithName (char *); @@ -90,7 +91,7 @@ void parseFunc (char *line) function *func ; char *rs; int i; - Safe_calloc(1,func,sizeof(function)); + func = Safe_calloc(1,sizeof(function)); func->sym = parseSymbol(line,&rs); func->sym->isfunc = 1; func->modName = currModName ; @@ -119,7 +120,7 @@ static char *parseTypeInfo (symbol *sym, char *s) s = ++bp; while (*s != ')') { /* till we reach the end */ link *type; - Safe_calloc(1,type,sizeof(link)); + type = Safe_calloc(1,sizeof(link)); if (*s == ',') s++; /* is a declarator */ @@ -240,7 +241,7 @@ symbol *parseSymbol (char *s, char **rs) symbol *nsym ; char *bp = s; - Safe_calloc(1,nsym,sizeof(symbol)); + nsym = Safe_calloc(1,sizeof(symbol)); /* copy over the mangled name */ while (*bp != '(') bp++; @@ -335,7 +336,7 @@ module *parseModule (char *s, bool createName ) module *nmod ; char buffer[512]; - Safe_calloc(1,nmod,sizeof(module)); + nmod = Safe_calloc(1,sizeof(module)); addSet (&modules,nmod); @@ -346,11 +347,11 @@ module *parseModule (char *s, bool createName ) if (createName) { sprintf(buffer,"%s.c",s); - Safe_calloc(1,nmod->c_name,strlen(buffer)+1); + nmod->c_name = Safe_malloc(strlen(buffer)+1); strcpy(nmod->c_name,buffer); sprintf(buffer,"%s.asm",s); - Safe_calloc(1,nmod->asm_name,strlen(buffer)+1); + nmod->asm_name = Safe_malloc(strlen(buffer)+1); strcpy(nmod->asm_name,buffer); } @@ -432,7 +433,7 @@ structdef *structWithName (char *s) return structs[i]; } - Safe_calloc(1,nsdef,sizeof(structdef)); + nsdef = Safe_calloc(1,sizeof(structdef)); nsdef->tag = alloccpy(s,strlen(s)); nsdef->sname = currModName ; diff --git a/device/lib/ds390/Makefile b/device/lib/ds390/Makefile index da5e9855..5770d98b 100755 --- a/device/lib/ds390/Makefile +++ b/device/lib/ds390/Makefile @@ -2,7 +2,7 @@ CC = ../../../bin/sdcc #VERBOSE = --verbose -OBJECTS = tinibios.rel memcpyx.rel lcd390.rel i2c390.rel rstc390.rel +OBJECTS = tinibios.rel memcpyx.rel lcd390.rel i2c390.rel rtc390.rel SOURCES = $(patsubst %.rel,%.c,$(OBJECTS))