MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / bm_insertNode

Function bm_insertNode

bitmap/bitmain.cpp:385–401  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

383 return (hval % (MAX_BITMAPS / 2));
384}
385bm_Node *bm_insertNode(bm_T data) {
386 bm_Node *p, *p0;
387 bm_hashTableIndex bucket;
388 /************************************************
389 * allocate bm_Node for data and insert in table *
390 ************************************************/
391 /* insert bm_Node at beginning of list */
392 bucket = bm_hash(data);
393 if ((p = (bm_Node *)mem_malloc(sizeof(bm_Node))) == 0) {
394 exit(1);
395 }
396 p0 = bm_hashTable[bucket];
397 bm_hashTable[bucket] = p;
398 p->next = p0;
399 p->data = data;
400 return p;
401}
402void bm_deleteNode(bm_T data) {
403 bm_Node *p0, *p;
404 bm_hashTableIndex bucket;

Callers 1

bm_AllocLoadFileBitmapFunction · 0.85

Calls 1

bm_hashFunction · 0.85

Tested by

no test coverage detected