prevent confusion by not using a standard name.

This commit is contained in:
ehofman 2006-01-02 10:04:10 +00:00
parent 8f9921d00c
commit a807e66d4a
2 changed files with 6 additions and 6 deletions

View File

@ -49,7 +49,7 @@ static unsigned int hashcolumn(struct HashRec* h, naRef key)
return (HASH_MAGIC * hashcode(key)) >> (32 - h->lgalloced);
}
static struct HashRec* realloc(struct naHash* hash)
static struct HashRec* hashrealloc(struct naHash* hash)
{
struct HashRec *h, *h0 = hash->rec;
int lga, cols, need = h0 ? h0->size - h0->dels : MIN_HASH_SIZE;
@ -171,7 +171,7 @@ void naHash_newsym(struct naHash* hash, naRef* sym, naRef* val)
int col;
struct HashRec* h = hash->rec;
while(!h || h->size >= 1<<h->lgalloced)
h = realloc(hash);
h = hashrealloc(hash);
col = (HASH_MAGIC * sym->ref.ptr.str->hashcode) >> (32 - h->lgalloced);
INSERT(h, *sym, *val, col);
}
@ -198,7 +198,7 @@ void naHash_set(naRef hash, naRef key, naRef val)
if((n = find(hash.ref.ptr.hash, key))) { n->val = val; return; }
h = hash.ref.ptr.hash->rec;
while(!h || h->size >= 1<<h->lgalloced)
h = realloc(hash.ref.ptr.hash);
h = hashrealloc(hash.ref.ptr.hash);
col = hashcolumn(h, key);
INSERT(h, key, val, hashcolumn(h, key));
chkcycle(h->table[col], h->size - h->dels);

View File

@ -13,7 +13,7 @@ static struct VecRec* newvecrec(struct VecRec* old)
return vr;
}
static void realloc(struct naVec* v)
static void vecrealloc(struct naVec* v)
{
struct VecRec* vr = newvecrec(v->rec);
naGC_swapfree((void**)&(v->rec), vr);
@ -60,7 +60,7 @@ int naVec_append(naRef vec, naRef o)
if(IS_VEC(vec)) {
struct VecRec* r = vec.ref.ptr.vec->rec;
while(!r || r->size >= r->alloced) {
realloc(vec.ref.ptr.vec);
vecrealloc(vec.ref.ptr.vec);
r = vec.ref.ptr.vec->rec;
}
r->array[r->size] = o;
@ -91,7 +91,7 @@ naRef naVec_removelast(naRef vec)
o = v->array[v->size - 1];
v->size--;
if(v->size < (v->alloced >> 1))
realloc(vec.ref.ptr.vec);
vecrealloc(vec.ref.ptr.vec);
return o;
}
return naNil();