From b35607e8a4e8b5c7286d7dc5ab563dcb478e1033 Mon Sep 17 00:00:00 2001 From: Dennis Schridde Date: Thu, 4 Oct 2012 10:51:44 +0200 Subject: Fix warning: C++ style comments are not allowed in ISO C90 --- src/lfs.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lfs.c b/src/lfs.c index 8234711..452eeca 100644 --- a/src/lfs.c +++ b/src/lfs.c @@ -84,9 +84,11 @@ #else #define getcwd_error strerror(errno) #ifdef _WIN32 - #define LFS_MAXPATHLEN MAX_PATH // MAX_PATH seems to be 260. Seems kind of small. Is there a better one? + /* MAX_PATH seems to be 260. Seems kind of small. Is there a better one? */ + #define LFS_MAXPATHLEN MAX_PATH #else - #include // for MAXPATHLEN + /* For MAXPATHLEN: */ + #include #define LFS_MAXPATHLEN MAXPATHLEN #endif #endif @@ -169,7 +171,7 @@ static int change_dir (lua_State *L) { */ static int get_dir (lua_State *L) { char *path; - // Passing (NULL, 0) is not guaranteed to work. Use a temp buffer and size instead. + /* Passing (NULL, 0) is not guaranteed to work. Use a temp buffer and size instead. */ char buf[LFS_MAXPATHLEN]; if ((path = getcwd(buf, LFS_MAXPATHLEN)) == NULL) { lua_pushnil(L); -- cgit v1.2.3-55-g6feb From a0d6f9d239dd2360158ab49d3084009a52dc2f8e Mon Sep 17 00:00:00 2001 From: Dennis Schridde Date: Thu, 4 Oct 2012 10:55:13 +0200 Subject: Fix warnings: unused variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On non-win32 lfs_setmode was defined to 0, ignoring all parameters. Now the parameters are explicitly discarded. Fixes: src/lfs.c: In function ‘lfs_g_setmode’: src/lfs.c:324:7: warning: unused variable ‘op’ [-Wunused-variable] src/lfs.c:321:47: warning: unused parameter ‘f’ [-Wunused-parameter] --- src/lfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lfs.c b/src/lfs.c index 452eeca..1a09282 100644 --- a/src/lfs.c +++ b/src/lfs.c @@ -119,7 +119,7 @@ typedef struct dir_data { #else #define _O_TEXT 0 #define _O_BINARY 0 -#define lfs_setmode(L,file,m) 0 +#define lfs_setmode(L,file,m) ((void)L, (void)file, (void)m, 0) #define STAT_STRUCT struct stat #define STAT_FUNC stat #define LSTAT_FUNC lstat -- cgit v1.2.3-55-g6feb