MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / luaO_str2num

Function luaO_str2num

src/Chain/libraries/glua/lobject.cpp:289–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

287
288
289size_t luaO_str2num(const char *s, TValue *o) {
290 lua_Integer i; lua_Number n;
291 const char *e;
292 if ((e = l_str2int(s, &i)) != nullptr) { /* try as an integer */
293 setivalue(o, i);
294 }
295 else if ((e = l_str2d(s, &n)) != nullptr) { /* else try as a float */
296 setfltvalue(o, n);
297 }
298 else
299 return 0; /* conversion failed */
300 return (e - s) + 1; /* success; return string size */
301}
302
303
304int luaO_utf8esc(char *buff, unsigned long x) {

Callers 5

luaV_tonumber_Function · 0.85
luaV_tointegerFunction · 0.85
trydecpointFunction · 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