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

Function bm_deleteNode

bitmap/bitmain.cpp:402–426  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

400 return p;
401}
402void bm_deleteNode(bm_T data) {
403 bm_Node *p0, *p;
404 bm_hashTableIndex bucket;
405 /********************************************
406 * delete bm_Node containing data from table *
407 ********************************************/
408 /* find bm_Node */
409 p0 = 0;
410 bucket = bm_hash(data);
411 p = bm_hashTable[bucket];
412 while (p && !compEQ(p->data, data)) {
413 p0 = p;
414 p = p->next;
415 }
416 if (!p)
417 return;
418 /* p designates bm_Node to delete, remove it from list */
419 if (p0)
420 /* not first bm_Node, p0 points to previous bm_Node */
421 p0->next = p->next;
422 else
423 /* first bm_Node on chain */
424 bm_hashTable[bucket] = p->next;
425 mem_free(p);
426}
427bm_Node *bm_findNode(bm_T data) {
428 bm_Node *p;
429 if (!bm_hashTable)

Callers 1

bm_FreeBitmapMainFunction · 0.85

Calls 1

bm_hashFunction · 0.85

Tested by

no test coverage detected