X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fasm6502.c;h=a893b659d987fe72fece9342e4789ca4c4cb2252;hp=af0a9341b7b94e312032dde29217260414743e89;hb=5f9c47ca98dd43d8f59b7c27d3fde6edfde4fe21;hpb=50be9bb40dc60130c99ffa568e6677779904ff70 diff --git a/hacks/asm6502.c b/hacks/asm6502.c index af0a9341..a893b659 100644 --- a/hacks/asm6502.c +++ b/hacks/asm6502.c @@ -95,11 +95,11 @@ typedef struct { } Pointer; -static void *emalloc(size_t n) { +/*static void *emalloc(size_t n) { void *p = malloc(n); if (! p) abort(); return p; -} +}*/ static void *ecalloc(uint32_t nelm, size_t nsize){ void *p = calloc(nelm, nsize); @@ -1130,7 +1130,7 @@ static Param *newParam(void){ Param *newp; int i = 0; - newp = (Param *) emalloc(sizeof(Param)); + newp = (Param *) ecalloc(1, sizeof(Param)); newp->type = SINGLE; for (i = 0; i < MAX_PARAM_VALUE; i++) newp->value[i] = 0; @@ -1153,7 +1153,7 @@ static void copyParam(Param *p1, Param *p2){ static Label *newLabel(void){ Label *newp; - newp = (Label *) emalloc(sizeof(Label)); + newp = (Label *) ecalloc(1, sizeof(Label)); newp->addr = 0; newp->label = ecalloc(MAX_LABEL_LEN,sizeof(char)); @@ -1164,7 +1164,7 @@ static AsmLine *newAsmLine(char *cmd, char *label, BOOL decl, Param *param, int { AsmLine *newp; - newp = (AsmLine *) emalloc(sizeof(AsmLine)); + newp = (AsmLine *) ecalloc(1, sizeof(AsmLine)); newp->labelDecl = decl; newp->label = newLabel(); strncpy(newp->label->label,label,MAX_LABEL_LEN); @@ -2091,7 +2091,7 @@ static void execute(machine_6502 *machine){ machine_6502 *build6502(){ machine_6502 *machine; - machine = emalloc(sizeof(machine_6502)); + machine = ecalloc(1, sizeof(machine_6502)); assignOpCodes(machine->opcodes); buildIndexCache(machine); reset(machine);