mirror of
https://github.com/lunarmodules/luafilesystem.git
synced 2026-07-24 20:33:06 +00:00
Merge pull request #19 from devurandom/fix/warnings
Fix some warnings GCC produced on Linux
This commit is contained in:
10
src/lfs.c
10
src/lfs.c
@@ -81,9 +81,11 @@
|
|||||||
#else
|
#else
|
||||||
#define getcwd_error strerror(errno)
|
#define getcwd_error strerror(errno)
|
||||||
#ifdef _WIN32
|
#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
|
#else
|
||||||
#include <sys/param.h> // for MAXPATHLEN
|
/* For MAXPATHLEN: */
|
||||||
|
#include <sys/param.h>
|
||||||
#define LFS_MAXPATHLEN MAXPATHLEN
|
#define LFS_MAXPATHLEN MAXPATHLEN
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@@ -114,7 +116,7 @@ typedef struct dir_data {
|
|||||||
#else
|
#else
|
||||||
#define _O_TEXT 0
|
#define _O_TEXT 0
|
||||||
#define _O_BINARY 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_STRUCT struct stat
|
||||||
#define STAT_FUNC stat
|
#define STAT_FUNC stat
|
||||||
#define LSTAT_FUNC lstat
|
#define LSTAT_FUNC lstat
|
||||||
@@ -166,7 +168,7 @@ static int change_dir (lua_State *L) {
|
|||||||
*/
|
*/
|
||||||
static int get_dir (lua_State *L) {
|
static int get_dir (lua_State *L) {
|
||||||
char *path;
|
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];
|
char buf[LFS_MAXPATHLEN];
|
||||||
if ((path = getcwd(buf, LFS_MAXPATHLEN)) == NULL) {
|
if ((path = getcwd(buf, LFS_MAXPATHLEN)) == NULL) {
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
|
|||||||
Reference in New Issue
Block a user