MCPcopy Create free account
hub / github.com/DFHack/dfhack / luaO_str2num

Function luaO_str2num

depends/lua/src/lobject.c:331–343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329
330
331size_t luaO_str2num (const char *s, TValue *o) {
332 lua_Integer i; lua_Number n;
333 const char *e;
334 if ((e = l_str2int(s, &i)) != NULL) { /* try as an integer */
335 setivalue(o, i);
336 }
337 else if ((e = l_str2d(s, &n)) != NULL) { /* else try as a float */
338 setfltvalue(o, n);
339 }
340 else
341 return 0; /* conversion failed */
342 return (e - s) + 1; /* success; return string size */
343}
344
345
346int luaO_utf8esc (char *buff, unsigned long x) {

Callers 4

luaV_tonumber_Function · 0.85
luaV_tointegerFunction · 0.85
read_numeralFunction · 0.85
lua_stringtonumberFunction · 0.85

Calls 2

l_str2intFunction · 0.85
l_str2dFunction · 0.85

Tested by

no test coverage detected