diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/lua/src/LuaLib/ldirlib.c | 5 | ||||
-rw-r--r-- | lib/lua/src/luacomp.c | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/lua/src/LuaLib/ldirlib.c b/lib/lua/src/LuaLib/ldirlib.c index d12f1ab..3b14bdc 100644 --- a/lib/lua/src/LuaLib/ldirlib.c +++ b/lib/lua/src/LuaLib/ldirlib.c @@ -1,4 +1,5 @@ #include <stdlib.h> +#include <string.h> #include <dirent.h> #include <errno.h> #include <sys/stat.h> @@ -19,7 +20,7 @@ static int l_dir (lua_State *L) { DIR **d; /* create a userdatum to store a DIR address */ - p = lua_newuserdata(L, sizeof(DIR *) + strlen(path) + 1); + p = (char *) lua_newuserdata(L, sizeof(DIR *) + strlen(path) + 1); d = (DIR **) p; d_path = p + sizeof(DIR *); @@ -58,7 +59,7 @@ static int dir_iter (lua_State *L) { lua_pushstring(L, "name"); lua_pushstring(L, entry->d_name); lua_settable(L, -3); - fullpath = malloc(strlen(path) + strlen(entry->d_name) + 2); + fullpath = (char *) malloc(strlen(path) + strlen(entry->d_name) + 2); sprintf(fullpath, "%s/%s", path, entry->d_name); #ifdef _WIN32 _stat(fullpath, &file_stat); diff --git a/lib/lua/src/luacomp.c b/lib/lua/src/luacomp.c index 1246869..abb7979 100644 --- a/lib/lua/src/luacomp.c +++ b/lib/lua/src/luacomp.c @@ -1,5 +1,5 @@ /* - ** $Id: luacomp.c,v 1.8 2007-07-27 10:05:54 pixel Exp $ + ** $Id: luacomp.c,v 1.9 2008-08-05 09:23:09 pixel Exp $ ** Lua compiler (saves bytecodes to files; also list bytecodes) ** Highly hacked by Nicolas "Pixel" Noble to be transformed into a ** small form-factor LUA compiler. @@ -29,7 +29,7 @@ const char * progname = PROGNAME; /* actual program name */ #define toproto(L, i) (clvalue(L->top + (i))->l.p) -static const Proto * combine(lua_State * L, int n) { +static Proto * combine(lua_State * L, int n) { if (n == 1) return toproto(L, -1); else { |