MCPcopy Create free account
hub / github.com/ZDoom/Raze / FindFlag

Function FindFlag

source/core/thingdef_data.cpp:222–244  ·  view source on GitHub ↗

========================================================================== Find a flag by name using a binary search ==========================================================================

Source from the content-addressed store, hash-verified

220//
221//==========================================================================
222static FFlagDef *FindFlag (FFlagDef *flags, int numflags, const char *flag)
223{
224 int min = 0, max = numflags - 1;
225
226 while (min <= max)
227 {
228 int mid = (min + max) / 2;
229 int lexval = stricmp (flag, flags[mid].name);
230 if (lexval == 0)
231 {
232 return &flags[mid];
233 }
234 else if (lexval > 0)
235 {
236 min = mid + 1;
237 }
238 else
239 {
240 max = mid - 1;
241 }
242 }
243 return NULL;
244}
245
246//==========================================================================
247//

Callers 3

ProcessDefaultFlagMethod · 0.85
ModActorFlagFunction · 0.85
CheckActorFlagFunction · 0.85

Calls 4

stricmpFunction · 0.85
IsDescendantOfMethod · 0.80
FindSymbolMethod · 0.45
GetCharsMethod · 0.45

Tested by

no test coverage detected