MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / HacksComp_UNSAFE_FlagValue

Function HacksComp_UNSAFE_FlagValue

src/EntityComponents.c:165–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165static cc_string HacksComp_UNSAFE_FlagValue(const char* flag, struct HacksComp* hacks) {
166 cc_string* joined = &hacks->HacksFlags;
167 int beg, end;
168
169 beg = String_IndexOfConst(joined, flag);
170 if (beg < 0) return String_Empty;
171 beg += String_Length(flag);
172
173 end = String_IndexOfAt(joined, beg, ' ');
174 if (end < 0) end = joined->length;
175
176 return String_UNSAFE_Substring(joined, beg, end - beg);
177}
178
179static float HacksComp_ParseFlagFloat(const char* flagRaw, struct HacksComp* hacks) {
180 cc_string raw = HacksComp_UNSAFE_FlagValue(flagRaw, hacks);

Callers 2

HacksComp_ParseFlagFloatFunction · 0.85
HacksComp_ParseFlagIntFunction · 0.85

Calls 4

String_IndexOfConstFunction · 0.85
String_LengthFunction · 0.85
String_IndexOfAtFunction · 0.85
String_UNSAFE_SubstringFunction · 0.85

Tested by

no test coverage detected