MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / l_str2dloc

Function l_str2dloc

third-party/lua-5.5.0/src/lobject.c:291–298  ·  view source on GitHub ↗

** Convert string 's' to a Lua number (put in 'result'). Return NULL on ** fail or the address of the ending '\0' on success. ('mode' == 'x') ** means a hexadecimal numeral. */

Source from the content-addressed store, hash-verified

289** means a hexadecimal numeral.
290*/
291static const char *l_str2dloc (const char *s, lua_Number *result, int mode) {
292 char *endptr;
293 *result = (mode == 'x') ? lua_strx2number(s, &endptr) /* try to convert */
294 : lua_str2number(s, &endptr);
295 if (endptr == s) return NULL; /* nothing recognized? */
296 while (lisspace(cast_uchar(*endptr))) endptr++; /* skip trailing spaces */
297 return (*endptr == '\0') ? endptr : NULL; /* OK iff no trailing chars */
298}
299
300
301/*

Callers 1

l_str2dFunction · 0.70

Calls 1

lua_strx2numberFunction · 0.70

Tested by

no test coverage detected