MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / l_str2dloc

Function l_str2dloc

lib/lua/src/lobject.c:228–235  ·  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

226** means a hexadecimal numeral.
227*/
228static const char *l_str2dloc (const char *s, lua_Number *result, int mode) {
229 char *endptr;
230 *result = (mode == 'x') ? lua_strx2number(s, &endptr) /* try to convert */
231 : lua_str2number(s, &endptr);
232 if (endptr == s) return NULL; /* nothing recognized? */
233 while (lisspace(cast_uchar(*endptr))) endptr++; /* skip trailing spaces */
234 return (*endptr == '\0') ? endptr : NULL; /* OK iff no trailing chars */
235}
236
237
238/*

Callers 1

l_str2dFunction · 0.85

Calls 1

lua_strx2numberFunction · 0.85

Tested by

no test coverage detected