From 7ee2d8e1b24a0ae3f671fc852e42301c017f0576 Mon Sep 17 00:00:00 2001 From: tomas Date: Tue, 15 May 2007 12:58:35 +0000 Subject: Compilation bug fix: ISO C90 forbids mixed declarations and code --- config | 4 ++-- src/lfs.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/config b/config index 3dae91c..eca849d 100644 --- a/config +++ b/config @@ -11,9 +11,9 @@ LIB_OPTION= -shared #for Linux LIBNAME= $T.so.$V # Compilation directives -WARN= -O2 -Wall -fPIC -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings +WARN= -O2 -Wall -fPIC -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings -pedantic INCS= -I$(LUA_INC) CFLAGS= $(WARN) $(INCS) CC= gcc -# $Id: config,v 1.18 2006/12/15 18:04:50 mascarenhas Exp $ +# $Id: config,v 1.19 2007/05/15 12:58:35 tomas Exp $ diff --git a/src/lfs.c b/src/lfs.c index 13c014e..bc763c1 100644 --- a/src/lfs.c +++ b/src/lfs.c @@ -14,7 +14,7 @@ ** lfs.touch (filepath [, atime [, mtime]]) ** lfs.unlock (fh) ** -** $Id: lfs.c,v 1.36 2007/05/08 19:23:12 carregal Exp $ +** $Id: lfs.c,v 1.37 2007/05/15 12:58:35 tomas Exp $ */ #include @@ -254,6 +254,8 @@ static int remove_dir (lua_State *L) { static int dir_iter (lua_State *L) { #ifdef _WIN32 struct _finddata_t c_file; +#else + struct dirent *entry; #endif dir_data *d = (dir_data *)lua_touserdata (L, lua_upvalueindex (1)); luaL_argcheck (L, !d->closed, 1, "closed directory"); @@ -279,7 +281,6 @@ static int dir_iter (lua_State *L) { } } #else - struct dirent *entry; if ((entry = readdir (d->dir)) != NULL) { lua_pushstring (L, entry->d_name); return 1; -- cgit v1.2.3-55-g6feb