git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
test for class init code
[swftools.git]
/
lib
/
q.c
diff --git
a/lib/q.c
b/lib/q.c
index
0d0d944
..
221ea5a
100644
(file)
--- a/
lib/q.c
+++ b/
lib/q.c
@@
-625,14
+625,16
@@
dict_t*dict_clone(dict_t*o)
memcpy(h, o, sizeof(dict_t));
h->slots = h->hashsize?(dictentry_t**)rfx_calloc(sizeof(dictentry_t*)*h->hashsize):0;
int t;
memcpy(h, o, sizeof(dict_t));
h->slots = h->hashsize?(dictentry_t**)rfx_calloc(sizeof(dictentry_t*)*h->hashsize):0;
int t;
- for(t=0;t<h->hashsize;t++) {
- dictentry_t*e = h->slots[t];
+ for(t=0;t<o->hashsize;t++) {
+ dictentry_t*e = o->slots[t];
while(e) {
dictentry_t*n = (dictentry_t*)rfx_alloc(sizeof(dictentry_t));
memcpy(n, e, sizeof(dictentry_t));
while(e) {
dictentry_t*n = (dictentry_t*)rfx_alloc(sizeof(dictentry_t));
memcpy(n, e, sizeof(dictentry_t));
- n->data = h->key_type->dup(e->data);
+ n->key = h->key_type->dup(e->key);
+ n->data = e->data;
n->next = h->slots[t];
h->slots[t] = n;
n->next = h->slots[t];
h->slots[t] = n;
+ e = e->next;
}
}
return h;
}
}
return h;
@@
-684,7
+686,7
@@
void dict_dump(dict_t*h, FILE*fi, const char*prefix)
for(t=0;t<h->hashsize;t++) {
dictentry_t*e = h->slots[t];
while(e) {
for(t=0;t<h->hashsize;t++) {
dictentry_t*e = h->slots[t];
while(e) {
- if(h->key_type==&charptr_type) {
+ if(h->key_type!=&charptr_type) {
fprintf(fi, "%s%08x=%08x\n", prefix, e->key, e->data);
} else {
fprintf(fi, "%s%s=%08x\n", prefix, e->key, e->data);
fprintf(fi, "%s%08x=%08x\n", prefix, e->key, e->data);
} else {
fprintf(fi, "%s%s=%08x\n", prefix, e->key, e->data);