diff options
| author | Fabio Mascarenhas <mascarenhas@gmail.com> | 2012-10-04 07:25:54 -0700 |
|---|---|---|
| committer | Fabio Mascarenhas <mascarenhas@gmail.com> | 2012-10-04 07:25:54 -0700 |
| commit | 9c2679f9d78f773471f2a9e58d02d8d6b29a2aa1 (patch) | |
| tree | 7e2e2a21159870243060556b67fbbe5e2b52bc81 /src | |
| parent | 62d5dbe3b6375e19573ad8f8af23df318bb05042 (diff) | |
| parent | a0d6f9d239dd2360158ab49d3084009a52dc2f8e (diff) | |
| download | luafilesystem-9c2679f9d78f773471f2a9e58d02d8d6b29a2aa1.tar.gz luafilesystem-9c2679f9d78f773471f2a9e58d02d8d6b29a2aa1.tar.bz2 luafilesystem-9c2679f9d78f773471f2a9e58d02d8d6b29a2aa1.zip | |
Merge pull request #19 from devurandom/fix/warnings
Fix some warnings GCC produced on Linux
Diffstat (limited to 'src')
| -rw-r--r-- | src/lfs.c | 10 |
1 files changed, 6 insertions, 4 deletions
| @@ -81,9 +81,11 @@ | |||
| 81 | #else | 81 | #else |
| 82 | #define getcwd_error strerror(errno) | 82 | #define getcwd_error strerror(errno) |
| 83 | #ifdef _WIN32 | 83 | #ifdef _WIN32 |
| 84 | #define LFS_MAXPATHLEN MAX_PATH // MAX_PATH seems to be 260. Seems kind of small. Is there a better one? | 84 | /* MAX_PATH seems to be 260. Seems kind of small. Is there a better one? */ |
| 85 | #define LFS_MAXPATHLEN MAX_PATH | ||
| 85 | #else | 86 | #else |
| 86 | #include <sys/param.h> // for MAXPATHLEN | 87 | /* For MAXPATHLEN: */ |
| 88 | #include <sys/param.h> | ||
| 87 | #define LFS_MAXPATHLEN MAXPATHLEN | 89 | #define LFS_MAXPATHLEN MAXPATHLEN |
| 88 | #endif | 90 | #endif |
| 89 | #endif | 91 | #endif |
| @@ -114,7 +116,7 @@ typedef struct dir_data { | |||
| 114 | #else | 116 | #else |
| 115 | #define _O_TEXT 0 | 117 | #define _O_TEXT 0 |
| 116 | #define _O_BINARY 0 | 118 | #define _O_BINARY 0 |
| 117 | #define lfs_setmode(L,file,m) 0 | 119 | #define lfs_setmode(L,file,m) ((void)L, (void)file, (void)m, 0) |
| 118 | #define STAT_STRUCT struct stat | 120 | #define STAT_STRUCT struct stat |
| 119 | #define STAT_FUNC stat | 121 | #define STAT_FUNC stat |
| 120 | #define LSTAT_FUNC lstat | 122 | #define LSTAT_FUNC lstat |
| @@ -166,7 +168,7 @@ static int change_dir (lua_State *L) { | |||
| 166 | */ | 168 | */ |
| 167 | static int get_dir (lua_State *L) { | 169 | static int get_dir (lua_State *L) { |
| 168 | char *path; | 170 | char *path; |
| 169 | // Passing (NULL, 0) is not guaranteed to work. Use a temp buffer and size instead. | 171 | /* Passing (NULL, 0) is not guaranteed to work. Use a temp buffer and size instead. */ |
| 170 | char buf[LFS_MAXPATHLEN]; | 172 | char buf[LFS_MAXPATHLEN]; |
| 171 | if ((path = getcwd(buf, LFS_MAXPATHLEN)) == NULL) { | 173 | if ((path = getcwd(buf, LFS_MAXPATHLEN)) == NULL) { |
| 172 | lua_pushnil(L); | 174 | lua_pushnil(L); |
