MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / luaO_str2num

Function luaO_str2num

extlibs/lua/src/lobject.c:303–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

301
302
303size_t luaO_str2num (const char *s, TValue *o) {
304 lua_Integer i; lua_Number n;
305 const char *e;
306 if ((e = l_str2int(s, &i)) != NULL) { /* try as an integer */
307 setivalue(o, i);
308 }
309 else if ((e = l_str2d(s, &n)) != NULL) { /* else try as a float */
310 setfltvalue(o, n);
311 }
312 else
313 return 0; /* conversion failed */
314 return (e - s) + 1; /* success; return string size */
315}
316
317
318int luaO_utf8esc (char *buff, unsigned long x) {

Callers 3

l_strtonFunction · 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