projects
/
YACASL2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ソースの推敲
[YACASL2.git]
/
src
/
label.c
diff --git
a/src/label.c
b/src/label.c
index
2a39f41
..
e88cc90
100644
(file)
--- a/
src/label.c
+++ b/
src/label.c
@@
-1,10
+1,3
@@
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-
-#include "cerr.h"
-#include "cmem.h"
-#include "hash.h"
#include "assemble.h"
/**
#include "assemble.h"
/**
@@
-115,7
+108,7
@@
bool addlabel(const char *prog, const char *label, WORD adr)
assert(label != NULL);
LABELTAB *p;
LABELARRAY *l;
assert(label != NULL);
LABELTAB *p;
LABELARRAY *l;
- unsigned h
ashval
;
+ unsigned h;
/* 登録されたラベルを検索。すでに登録されている場合はエラー発生 */
if(getlabel(prog, label) != 0xFFFF) {
/* 登録されたラベルを検索。すでに登録されている場合はエラー発生 */
if(getlabel(prog, label) != 0xFFFF) {
@@
-134,9
+127,8
@@
bool addlabel(const char *prog, const char *label, WORD adr)
/* ラベル数を設定 */
labelcnt++;
/* ハッシュ表へ追加 */
/* ラベル数を設定 */
labelcnt++;
/* ハッシュ表へ追加 */
- hashval = labelhash(prog, label);
- p->next = labels[hashval];
- labels[hashval] = p;
+ p->next = labels[h = labelhash(prog, label)];
+ labels[h] = p;
return true;
}
return true;
}
@@
-176,5
+168,6
@@
void freelabel()
FREE(p->label);
FREE(p);
}
FREE(p->label);
FREE(p);
}
+ labels[i] = NULL;
}
}
}
}