projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
http://www.jwz.org/xscreensaver/xscreensaver-5.13.tar.gz
[xscreensaver]
/
hacks
/
asm6502.c
diff --git
a/hacks/asm6502.c
b/hacks/asm6502.c
index af0a9341b7b94e312032dde29217260414743e89..a893b659d987fe72fece9342e4789ca4c4cb2252 100644
(file)
--- a/
hacks/asm6502.c
+++ b/
hacks/asm6502.c
@@
-95,11
+95,11
@@
typedef struct {
} Pointer;
} Pointer;
-static void *emalloc(size_t n) {
+
/*
static void *emalloc(size_t n) {
void *p = malloc(n);
if (! p) abort();
return p;
void *p = malloc(n);
if (! p) abort();
return p;
-}
+}
*/
static void *ecalloc(uint32_t nelm, size_t nsize){
void *p = calloc(nelm, nsize);
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;
Param *newp;
int i = 0;
- newp = (Param *) e
malloc(
sizeof(Param));
+ newp = (Param *) e
calloc(1,
sizeof(Param));
newp->type = SINGLE;
for (i = 0; i < MAX_PARAM_VALUE; i++)
newp->value[i] = 0;
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;
static Label *newLabel(void){
Label *newp;
- newp = (Label *) e
malloc(
sizeof(Label));
+ newp = (Label *) e
calloc(1,
sizeof(Label));
newp->addr = 0;
newp->label = ecalloc(MAX_LABEL_LEN,sizeof(char));
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;
{
AsmLine *newp;
- newp = (AsmLine *) e
malloc(
sizeof(AsmLine));
+ newp = (AsmLine *) e
calloc(1,
sizeof(AsmLine));
newp->labelDecl = decl;
newp->label = newLabel();
strncpy(newp->label->label,label,MAX_LABEL_LEN);
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_6502 *build6502(){
machine_6502 *machine;
- machine = e
malloc(
sizeof(machine_6502));
+ machine = e
calloc(1,
sizeof(machine_6502));
assignOpCodes(machine->opcodes);
buildIndexCache(machine);
reset(machine);
assignOpCodes(machine->opcodes);
buildIndexCache(machine);
reset(machine);