Additional corrections for Safe_calloc in sdcdb
authorjtvolpe <jtvolpe@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 28 Feb 2001 05:47:30 +0000 (05:47 +0000)
committerjtvolpe <jtvolpe@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 28 Feb 2001 05:47:30 +0000 (05:47 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@660 4a8a32a2-be11-0410-ad9d-d568d2c75423

debugger/mcs51/break.c
debugger/mcs51/sdcdb.c
debugger/mcs51/symtab.c
device/lib/ds390/Makefile

index fe412946ed06e74a3f9318c16ea543709fbdb633..4e5c263c5079176aeb808bdf1fcd714986df81cf 100644 (file)
@@ -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;
index 3d53fd83418574b66adf7cb9e802e2804867b3cf..f23dba382323e584626d477e2f6742312c660f29 100644 (file)
@@ -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';
   }
index 5333eae4ef7a9ea8dc46676f6d53c19b81702856..0e5b8c6a0741770b6de0a90e05915a04da3da856 100644 (file)
@@ -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 ;
 
index da5e98555315963ba820833a00a2eeffeec220fc..5770d98b5b8b281abc727da28d0f1c09b9e4b77c 100755 (executable)
@@ -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))