#include <stdio.h>
#include <sys/types.h>
+#ifndef MULTICORE
#include <sys/stat.h>
#include <fcntl.h>
+#endif
#include <stdlib.h>
#include <limits.h>
for(i=0; i<oldcurrentsize; i++) {
struct genpointerlist * tmpptr=oldbins[i];
while(tmpptr!=NULL) {
- unsigned int hashcode=genhashfunction(ht, tmpptr->src);
- struct genpointerlist *nextptr=tmpptr->next;
- tmpptr->next=newbins[hashcode];
- newbins[hashcode]=tmpptr;
- tmpptr=nextptr;
+ unsigned int hashcode=genhashfunction(ht, tmpptr->src);
+ struct genpointerlist *nextptr=tmpptr->next;
+ tmpptr->next=newbins[hashcode];
+ newbins[hashcode]=tmpptr;
+ tmpptr=nextptr;
}
}
ht->bins=newbins;
for(i=0; i<oldcurrentsize; i++) {
struct genpointerlist * tmpptr=oldbins[i];
while(tmpptr!=NULL) {
- unsigned int hashcode=genhashfunction(ht, tmpptr->src);
- struct genpointerlist *nextptr=tmpptr->next;
- tmpptr->next=newbins[hashcode];
- newbins[hashcode]=tmpptr;
- tmpptr=nextptr;
+ unsigned int hashcode=genhashfunction(ht, tmpptr->src);
+ struct genpointerlist *nextptr=tmpptr->next;
+ tmpptr->next=newbins[hashcode];
+ newbins[hashcode]=tmpptr;
+ tmpptr=nextptr;
}
}
ht->bins=newbins;
void genrehash(struct genhashtable * ht) {
struct genpointerlist **newbins=(struct genpointerlist **) RUNMALLOC(sizeof (struct genpointerlist *)*ht->currentsize);
struct genpointerlist **oldbins=ht->bins;
- long j,i;
+ long i;
for(i=0; i<ht->currentsize; i++) {
struct genpointerlist * tmpptr=oldbins[i];
return ptr->object;
ptr=ptr->next;
}
-#ifndef RAW
+#ifndef MULTICORE
printf("XXXXXXXXX: COULDN'T FIND ENTRY FOR KEY %p\n",key);
#endif
return NULL;
while(ptr!=NULL) {
if (((ht->comp_function==NULL)&&(ptr->src==key))||((ht->comp_function!=NULL)&&(*ht->comp_function)(ptr->src,key)))
if (ptr->inext!=NULL) {
- return ptr->inext->src;
+ return ptr->inext->src;
} else
- return NULL;
+ return NULL;
ptr=ptr->next;
}
-#ifndef RAW
+#ifndef MULTICORE
printf("XXXXXXXXX: COULDN'T FIND ENTRY FOR KEY %p...\n Likely concurrent removal--bad user!!!\n",key);
#endif
return NULL;
struct genpointerlist *tmpptr=ptr->next;
ptr->next=tmpptr->next;
if (tmpptr==ht->list)
- ht->list=tmpptr->inext;
+ ht->list=tmpptr->inext;
if (tmpptr==ht->last)
- ht->last=tmpptr->iprev;
+ ht->last=tmpptr->iprev;
if (tmpptr->iprev!=NULL)
- tmpptr->iprev->inext=tmpptr->inext;
+ tmpptr->iprev->inext=tmpptr->inext;
if (tmpptr->inext!=NULL)
- tmpptr->inext->iprev=tmpptr->iprev;
+ tmpptr->inext->iprev=tmpptr->iprev;
RUNFREE(tmpptr);
ht->counter--;
return;
}
ptr=ptr->next;
}
-#ifndef RAW
+#ifndef MULTICORE
printf("XXXXXXXXX: COULDN'T FIND ENTRY FOR KEY %p\n",key);
#endif
}
if (ht->bins[i]!=NULL) {
struct genpointerlist *genptr=ht->bins[i];
while(genptr!=NULL) {
- struct genpointerlist *tmpptr=genptr->next;
- RUNFREE(genptr);
- genptr=tmpptr;
+ struct genpointerlist *tmpptr=genptr->next;
+ RUNFREE(genptr);
+ genptr=tmpptr;
}
}
}
if(curr->inext!=NULL)
it->ptr=curr->inext;
else
- it->finished=1; /* change offsetting scheme */
+ it->finished=1; /* change offsetting scheme */
return curr->src;
}