From 531cf5f3fbffba3a2b5da4a48ad7574bd4209ba0 Mon Sep 17 00:00:00 2001 From: bugobliterator Date: Thu, 19 Mar 2020 07:25:30 +0530 Subject: [PATCH] AP_Scripting: remove unused user of realloc from lua --- libraries/AP_Scripting/lua/src/lauxlib.c | 38 ++++++++++++------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/libraries/AP_Scripting/lua/src/lauxlib.c b/libraries/AP_Scripting/lua/src/lauxlib.c index 8bdada50a7..3f7a0010ff 100644 --- a/libraries/AP_Scripting/lua/src/lauxlib.c +++ b/libraries/AP_Scripting/lua/src/lauxlib.c @@ -1005,29 +1005,29 @@ LUALIB_API const char *luaL_gsub (lua_State *L, const char *s, const char *p, } -static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) { - (void)ud; (void)osize; /* not used */ - if (nsize == 0) { - free(ptr); - return NULL; - } - else - return realloc(ptr, nsize); -} +// static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) { +// (void)ud; (void)osize; /* not used */ +// if (nsize == 0) { +// free(ptr); +// return NULL; +// } +// else +// return realloc(ptr, nsize); +// } -static int panic (lua_State *L) { - lua_writestringerror("PANIC: unprotected error in call to Lua API (%s)\n", - lua_tostring(L, -1)); - return 0; /* return to Lua to abort */ -} +// static int panic (lua_State *L) { +// lua_writestringerror("PANIC: unprotected error in call to Lua API (%s)\n", +// lua_tostring(L, -1)); +// return 0; /* return to Lua to abort */ +// } -LUALIB_API lua_State *luaL_newstate (void) { - lua_State *L = lua_newstate(l_alloc, NULL); - if (L) lua_atpanic(L, &panic); - return L; -} +// LUALIB_API lua_State *luaL_newstate (void) { +// lua_State *L = lua_newstate(l_alloc, NULL); +// if (L) lua_atpanic(L, &panic); +// return L; +// } LUALIB_API void luaL_checkversion_ (lua_State *L, lua_Number ver, size_t sz) {