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

Function GetListItem

Descent3/list.cpp:136–145  ·  view source on GitHub ↗

returns a pointer the given item index in a list Returns NULL if point not found

Source from the content-addressed store, hash-verified

134// returns a pointer the given item index in a list
135// Returns NULL if point not found
136void *GetListItem(listnode **listp, int index) {
137 listnode *node;
138
139 for (node = *listp; node != NULL; node = node->next) {
140 if (index-- == 0)
141 return node->data;
142 }
143
144 return NULL;
145}
146
147// Returns how far from the head of the list a given item is
148// Returns -1 if not found

Callers 1

DestroyBSPNodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected