fix compiler warn

This commit is contained in:
fesily 2023-08-18 14:33:51 +08:00
parent 3c79770bcb
commit 41198c8d24

View File

@ -137,7 +137,7 @@ static const char *reader_string(lua_State *L, void *ud, size_t *size)
char* hack_gemcore(const char* base, size_t size) char* hack_gemcore(const char* base, size_t size)
{ {
char* target; char* target;
char* t = base; const char* t = base;
char* s = NULL, *p = NULL, *q = NULL; char* s = NULL, *p = NULL, *q = NULL;
if (strstr(base, "return _debug_getinfo") == NULL) return NULL; if (strstr(base, "return _debug_getinfo") == NULL) return NULL;
@ -195,14 +195,14 @@ LUALIB_API int luaL_loadbufferx(lua_State *L, const char *buf, size_t size,
return ret; return ret;
} }
#ifdef LJ_DS_LOADBUFFER_PATCH #if LJ_DS_LOADBUFFER_PATCH
LUA_API const char* (*lj_path_map)(const char* k); LUA_API const char* (*lj_path_map)(const char* k) = NULL;
#endif #endif
LUALIB_API int luaL_loadbuffer(lua_State *L, const char *buf, size_t size, LUALIB_API int luaL_loadbuffer(lua_State *L, const char *buf, size_t size,
const char *name) const char *name)
{ {
#ifdef LJ_DS_LOADBUFFER_PATCH #if LJ_DS_LOADBUFFER_PATCH
if (buf != name){ if (buf != name){
if (lj_path_map){ if (lj_path_map){
const char* real_path = lj_path_map(name); const char* real_path = lj_path_map(name);