- Functions luaK_goiffalse, luaS_hash made private.
- Removed unused macro log2maxs.
This commit is contained in:
Roberto I 2025-10-14 13:50:24 -03:00
parent 30a7b93439
commit 9c66903cc5
5 changed files with 2 additions and 11 deletions

View File

@ -1181,7 +1181,7 @@ void luaK_goiftrue (FuncState *fs, expdesc *e) {
/* /*
** Emit code to go through if 'e' is false, jump otherwise. ** Emit code to go through if 'e' is false, jump otherwise.
*/ */
void luaK_goiffalse (FuncState *fs, expdesc *e) { static void luaK_goiffalse (FuncState *fs, expdesc *e) {
int pc; /* pc of new jump */ int pc; /* pc of new jump */
luaK_dischargevars(fs, e); luaK_dischargevars(fs, e);
switch (e->k) { switch (e->k) {

View File

@ -80,7 +80,6 @@ LUAI_FUNC void luaK_exp2val (FuncState *fs, expdesc *e);
LUAI_FUNC void luaK_self (FuncState *fs, expdesc *e, expdesc *key); LUAI_FUNC void luaK_self (FuncState *fs, expdesc *e, expdesc *key);
LUAI_FUNC void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k); LUAI_FUNC void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k);
LUAI_FUNC void luaK_goiftrue (FuncState *fs, expdesc *e); LUAI_FUNC void luaK_goiftrue (FuncState *fs, expdesc *e);
LUAI_FUNC void luaK_goiffalse (FuncState *fs, expdesc *e);
LUAI_FUNC void luaK_storevar (FuncState *fs, expdesc *var, expdesc *e); LUAI_FUNC void luaK_storevar (FuncState *fs, expdesc *var, expdesc *e);
LUAI_FUNC void luaK_setreturns (FuncState *fs, expdesc *e, int nresults); LUAI_FUNC void luaK_setreturns (FuncState *fs, expdesc *e, int nresults);
LUAI_FUNC void luaK_setoneret (FuncState *fs, expdesc *e); LUAI_FUNC void luaK_setoneret (FuncState *fs, expdesc *e);

View File

@ -59,13 +59,6 @@ typedef lu_byte TStatus;
#define MAX_SIZE (sizeof(size_t) < sizeof(lua_Integer) ? MAX_SIZET \ #define MAX_SIZE (sizeof(size_t) < sizeof(lua_Integer) ? MAX_SIZET \
: cast_sizet(LUA_MAXINTEGER)) : cast_sizet(LUA_MAXINTEGER))
/*
** floor of the log2 of the maximum signed value for integral type 't'.
** (That is, maximum 'n' such that '2^n' fits in the given signed type.)
*/
#define log2maxs(t) (l_numbits(t) - 2)
/* /*
** test whether an unsigned value is a power of 2 (or zero) ** test whether an unsigned value is a power of 2 (or zero)
*/ */

View File

@ -50,7 +50,7 @@ int luaS_eqstr (TString *a, TString *b) {
} }
unsigned luaS_hash (const char *str, size_t l, unsigned seed) { static unsigned luaS_hash (const char *str, size_t l, unsigned seed) {
unsigned int h = seed ^ cast_uint(l); unsigned int h = seed ^ cast_uint(l);
for (; l > 0; l--) for (; l > 0; l--)
h ^= ((h<<5) + (h>>2) + cast_byte(str[l - 1])); h ^= ((h<<5) + (h>>2) + cast_byte(str[l - 1]));

View File

@ -54,7 +54,6 @@
#define eqshrstr(a,b) check_exp((a)->tt == LUA_VSHRSTR, (a) == (b)) #define eqshrstr(a,b) check_exp((a)->tt == LUA_VSHRSTR, (a) == (b))
LUAI_FUNC unsigned luaS_hash (const char *str, size_t l, unsigned seed);
LUAI_FUNC unsigned luaS_hashlongstr (TString *ts); LUAI_FUNC unsigned luaS_hashlongstr (TString *ts);
LUAI_FUNC int luaS_eqstr (TString *a, TString *b); LUAI_FUNC int luaS_eqstr (TString *a, TString *b);
LUAI_FUNC void luaS_resize (lua_State *L, int newsize); LUAI_FUNC void luaS_resize (lua_State *L, int newsize);