Lines Matching +full:a +full:- +full:8
36 static const lu_byte log_2[256] = { /* log_2[i] = ceil(log2(i - 1)) */ in luaO_ceillog2()
41 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, in luaO_ceillog2()
42 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, in luaO_ceillog2()
43 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, in luaO_ceillog2()
44 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8 in luaO_ceillog2()
47 x--; in luaO_ceillog2()
48 while (x >= 256) { l += 8; x >>= 8; } in luaO_ceillog2()
57 case LUA_OPSUB:return intop(-, v1, v2); in intarith()
66 case LUA_OPUNM: return intop(-, 0, v1); in intarith()
130 luaT_trybinTM(L, p1, p2, res, cast(TMS, (op - LUA_OPADD) + TM_ADD)); in luaO_arith()
136 if (lisdigit(c)) return c - '0'; in luaO_hexavalue()
137 else return (ltolower(c) - 'a') + 10; in luaO_hexavalue()
142 if (**s == '-') { (*s)++; return 1; } in isneg()
162 ** convert a hexadecimal numeric string to a number, following
169 int nosigdig = 0; /* number of non-significant digits */ in lua_strx2number()
172 int hasdot = 0; /* true after seen a dot */ in lua_strx2number()
184 if (sigdig == 0 && *s == '0') /* non-significant digit (zero)? */ in lua_strx2number()
189 if (hasdot) e--; /* decimal digit? correct exponent */ in lua_strx2number()
191 else break; /* neither a dot nor a digit */ in lua_strx2number()
205 exp1 = exp1 * 10 + *(s++) - '0'; in lua_strx2number()
206 if (neg1) exp1 = -exp1; in lua_strx2number()
210 if (neg) r = -r; in lua_strx2number()
218 /* maximum length of a numeral to be converted to a number */
224 ** Convert string 's' to a Lua number (put in 'result'). Return NULL on
226 ** means a hexadecimal numeral.
239 ** Convert string 's' to a Lua number (put in 'result') handling the
241 ** This function accepts both the current locale or a dot as the radix
242 ** mark. If the conversion fails, it may mean number has a dot but
244 ** to a buffer (because 's' is read-only), changes the dot to the
247 ** - 'n' means 'inf' or 'nan' (which should be rejected)
248 ** - 'x' means a hexadecimal numeral
249 ** - '.' just optimizes the search for the common case (no special chars)
258 if (endptr == NULL) { /* failed? may be a different locale */ in l_str2d()
264 buff[pdot - s] = lua_getlocaledecpoint(); /* correct decimal point */ in l_str2d()
267 endptr = s + (endptr - buff); /* make relative to 's' */ in l_str2d()
277 lua_Unsigned a = 0; in l_str2int() local
286 a = a * 16 + luaO_hexavalue(*s); in l_str2int()
292 int d = *s - '0'; in l_str2int()
293 if (a >= MAXBY10 && (a > MAXBY10 || d > MAXLASTD + neg)) /* overflow? */ in l_str2int()
295 a = a * 10 + d; in l_str2int()
302 *result = l_castU2S((neg) ? 0u - a : a); in l_str2int()
314 else if ((e = l_str2d(s, &n)) != NULL) { /* else try as a float */ in luaO_str2num()
319 return (e - s) + 1; /* success; return string size */ in luaO_str2num()
327 buff[UTF8BUFFSZ - 1] = cast_char(x); in luaO_utf8esc()
331 buff[UTF8BUFFSZ - (n++)] = cast_char(0x80 | (x & 0x3f)); in luaO_utf8esc()
335 buff[UTF8BUFFSZ - n] = cast_char((~mfb << 1) | x); /* add first byte */ in luaO_utf8esc()
342 ** Maximum length of the conversion of a number to a string. Must be
344 ** (For a long long int, this is 19 digits plus a sign and a final '\0',
345 ** adding to 21. For a long double, it can go to a sign, 33 digits,
347 ** and a final '\0', adding to 43.)
353 ** Convert a number object to a string, adding it to a buffer
362 if (buff[strspn(buff, "-0123456789")] == '\0') { /* looks like an int? */ in tostringbuff()
372 ** Convert a number object to a Lua string, replacing the value at 'obj'
391 ** (LUA_IDSIZE + MAXNUMBER2STR) + a minimal space for basic messages,
399 int pushed; /* true if there is a part of the result on the stack */
415 lua_State *L = buff->L; in pushstr()
416 setsvalue2s(L, L->top.p, luaS_newlstr(L, str, lstr)); in pushstr()
417 L->top.p++; /* may use one slot from EXTRA_STACK */ in pushstr()
418 if (!buff->pushed) /* no previous string on the stack? */ in pushstr()
419 buff->pushed = 1; /* now there is one */ in pushstr()
429 pushstr(buff, buff->space, buff->blen); /* push buffer contents */ in clearbuff()
430 buff->blen = 0; /* space now is empty */ in clearbuff()
435 ** Get a space of size 'sz' in the buffer. If buffer has not enough
439 lua_assert(buff->blen <= BUFVFS); lua_assert(sz <= BUFVFS); in getbuff()
440 if (sz > BUFVFS - buff->blen) /* not enough space? */ in getbuff()
442 return buff->space + buff->blen; in getbuff()
446 #define addsize(b,sz) ((b)->blen += (sz))
467 ** Add a numeral to the buffer.
478 conventional formats, plus Lua-specific '%I' and '%U'
486 addstr2buff(&buff, fmt, e - fmt); /* add 'fmt' up to '%' */ in luaO_pushvfstring()
488 case 's': { /* zero-terminated string */ in luaO_pushvfstring()
494 case 'c': { /* an 'int' as a character */ in luaO_pushvfstring()
505 case 'I': { /* a 'lua_Integer' */ in luaO_pushvfstring()
511 case 'f': { /* a 'lua_Number' */ in luaO_pushvfstring()
517 case 'p': { /* a pointer */ in luaO_pushvfstring()
518 const int sz = 3 * sizeof(void*) + 8; /* enough space for '%p' */ in luaO_pushvfstring()
525 case 'U': { /* a 'long' as a UTF-8 sequence */ in luaO_pushvfstring()
528 addstr2buff(&buff, bf + UTF8BUFFSZ - len, len); in luaO_pushvfstring()
545 return svalue(s2v(L->top.p - 1)); in luaO_pushvfstring()
565 #define addstr(a,b,l) ( memcpy(a,b,(l) * sizeof(char)), a += (l) ) argument
573 addstr(out, source + 1, bufflen - 1); in luaO_chunkid()
582 bufflen -= LL(RETS); in luaO_chunkid()
583 memcpy(out, source + 1 + srclen - bufflen, bufflen * sizeof(char)); in luaO_chunkid()
589 bufflen -= LL(PRE RETS POS) + 1; /* save space for prefix+suffix+'\0' */ in luaO_chunkid()
590 if (srclen < bufflen && nl == NULL) { /* small one-line source? */ in luaO_chunkid()
594 if (nl != NULL) srclen = nl - source; /* stop at first newline */ in luaO_chunkid()