MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / dav_parse_hexpair

Function dav_parse_hexpair

Engine/source/core/util/uuid.cpp:157–179  ·  view source on GitHub ↗

convert a pair of hex digits to an integer value [0,255] */

Source from the content-addressed store, hash-verified

155
156/* convert a pair of hex digits to an integer value [0,255] */
157static int dav_parse_hexpair(const char *s)
158{
159 int result;
160 int temp;
161
162 result = s[0] - '0';
163 if (result > 48)
164 result = (result - 39) << 4;
165 else if (result > 16)
166 result = (result - 7) << 4;
167 else
168 result = result << 4;
169
170 temp = s[1] - '0';
171 if (temp > 48)
172 result |= temp - 39;
173 else if (temp > 16)
174 result |= temp - 7;
175 else
176 result |= temp;
177
178 return result;
179}
180
181/* dav_parse_locktoken: Parses string produced from
182 * dav_format_opaquelocktoken back into a xuuid_t

Callers 1

parse_tokenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected