MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / compare_left

Function compare_left

Engine/source/core/strings/stringFunctions.cpp:130–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128
129
130static int
131compare_left(const nat_char* a, const nat_char* b)
132{
133 /* Compare two left-aligned numbers: the first to have a
134 different value wins. */
135 for (;; a++, b++) {
136 if (!nat_isdigit(*a) && !nat_isdigit(*b))
137 break;
138 else if (!nat_isdigit(*a))
139 return -1;
140 else if (!nat_isdigit(*b))
141 return +1;
142 else if (*a < *b)
143 return -1;
144 else if (*a > *b)
145 return +1;
146 }
147
148 return 0;
149}
150
151
152static S32 strnatcmp0(const nat_char* a, const nat_char* b, S32 fold_case)

Callers 1

strnatcmp0Function · 0.85

Calls 1

nat_isdigitFunction · 0.85

Tested by

no test coverage detected