a44421a79fb36cc2036fe116b97ea3bc9590cd0c braney Fri Dec 2 09:34:39 2011 -0800 removed rcsid (#295) diff --git src/lib/colHash.c src/lib/colHash.c index e8cb3d2..49d1537 100644 --- src/lib/colHash.c +++ src/lib/colHash.c @@ -1,49 +1,48 @@ /* colHash - stuff for fast lookup of index given an * rgb value. */ #include "common.h" #include "memgfx.h" #include "colHash.h" -static char const rcsid[] = "$Id: colHash.c,v 1.3 2003/05/06 07:33:41 kate Exp $"; struct colHash *colHashNew() /* Get a new color hash. */ { struct colHash *cHash; AllocVar(cHash); cHash->freeEl = cHash->elBuf; return cHash; } void colHashFree(struct colHash **pEl) /* Free up color hash. */ { freez(pEl); } struct colHashEl *colHashAdd(struct colHash *cHash, unsigned r, unsigned g, unsigned b, int ix) /* Add new element to color hash. */ { struct colHashEl *che = cHash->freeEl++, **pCel; che->col.r = r; che->col.g = g; che->col.b = b; che->ix = ix; pCel = &cHash->lists[colHashFunc(r,g,b)]; slAddHead(pCel, che); return che; } struct colHashEl *colHashLookup(struct colHash *cHash, unsigned r, unsigned g, unsigned b) /* Lookup value in hash. */ { struct colHashEl *che; for (che = cHash->lists[colHashFunc(r,g,b)]; che != NULL; che = che->next) if (che->col.r == r && che->col.g == g && che->col.b == b) return che; return NULL; }