From d48265348a027a4a31cb2e1b76a7c80e252a1d36 Mon Sep 17 00:00:00 2001 From: Johny Mattsson Date: Sun, 27 Nov 2016 13:28:48 +1100 Subject: [PATCH] Fixed various warnings. --- components/base_nodemcu/user_main.c | 2 +- components/lua/lauxlib.c | 4 ++-- components/lua/liolib.c | 2 ++ components/lua/lua.c | 8 +++----- components/modules/node.c | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/components/base_nodemcu/user_main.c b/components/base_nodemcu/user_main.c index 0df74f45..b663e956 100644 --- a/components/base_nodemcu/user_main.c +++ b/components/base_nodemcu/user_main.c @@ -122,7 +122,7 @@ void nodemcu_init(void) flash_rom_set_size_byte(flash_safe_get_size_byte()); // Reboot to get SDK to use (or write) init data at new location - system_restart (); + esp_restart (); // Don't post the start_lua task, we're about to reboot... return; diff --git a/components/lua/lauxlib.c b/components/lua/lauxlib.c index b79f5c24..c4577206 100644 --- a/components/lua/lauxlib.c +++ b/components/lua/lauxlib.c @@ -649,7 +649,7 @@ LUALIB_API int luaL_loadfile (lua_State *L, const char *filename) { #else -#include C_HEADER_FCNTL +#include typedef struct LoadFSF { int extraline; @@ -688,7 +688,7 @@ static int errfsfile (lua_State *L, const char *what, int fnameindex) { LUALIB_API int luaL_loadfsfile (lua_State *L, const char *filename) { LoadFSF lf; - int status, readstatus; + int status; int c; int fnameindex = lua_gettop(L) + 1; /* index of filename on the stack */ lf.extraline = 0; diff --git a/components/lua/liolib.c b/components/lua/liolib.c index 2d3d56ba..ad4d5d4b 100644 --- a/components/lua/liolib.c +++ b/components/lua/liolib.c @@ -603,6 +603,7 @@ static void createmeta (lua_State *L) { } +#if 0 static void createstdfile (lua_State *L, int f, int k, const char *fname) { *newfile(L) = f; #if LUA_OPTIMIZE_MEMORY != 2 @@ -619,6 +620,7 @@ static void createstdfile (lua_State *L, int f, int k, const char *fname) { lua_setfield(L, -2, fname); #endif } +#endif #if LUA_OPTIMIZE_MEMORY != 2 static void newfenv (lua_State *L, lua_CFunction cls) { diff --git a/components/lua/lua.c b/components/lua/lua.c index b9916b67..2225ef5e 100644 --- a/components/lua/lua.c +++ b/components/lua/lua.c @@ -128,15 +128,14 @@ static int docall (lua_State *L, int narg, int clear) { static void print_version (lua_State *L) { - lua_pushliteral (L, NODE_VERSION " build " BUILD_DATE " powered by " LUA_RELEASE " on IDF "); - lua_pushstring (L, system_get_sdk_version ()); - lua_concat (L, 2); + lua_pushliteral (L, NODE_VERSION " build " BUILD_DATE " powered by " LUA_RELEASE); const char *msg = lua_tostring (L, -1); l_message (NULL, msg); lua_pop (L, 1); } +#if 0 static int getargs (lua_State *L, char **argv, int n) { int narg; int i; @@ -154,7 +153,6 @@ static int getargs (lua_State *L, char **argv, int n) { return narg; } -#if 0 static int dofile (lua_State *L, const char *name) { int status = luaL_loadfile(L, name) || docall(L, 0, 1); return report(L, status); @@ -477,7 +475,7 @@ void donejob(lua_Load *load){ } static void dojob(lua_Load *load){ - size_t l, rs; + size_t l; int status; char *b = load->line; lua_State *L = load->L; diff --git a/components/modules/node.c b/components/modules/node.c index 51153bfc..e9d21a84 100644 --- a/components/modules/node.c +++ b/components/modules/node.c @@ -12,7 +12,7 @@ // Lua: heap() static int node_heap( lua_State* L ) { - uint32_t sz = system_get_free_heap_size(); + uint32_t sz = esp_get_free_heap_size(); lua_pushinteger(L, sz); return 1; }