diff options
| author | mascarenhas <mascarenhas> | 2008-02-18 03:13:50 +0000 |
|---|---|---|
| committer | mascarenhas <mascarenhas> | 2008-02-18 03:13:50 +0000 |
| commit | 640265aee71ad1d22c4a43823869184441d4bf82 (patch) | |
| tree | d84fba58fa091eacffd7661ee0b7e179f260b745 /src | |
| parent | 8f943857e8060757f1395df192a61563c32e0884 (diff) | |
| download | luafilesystem-640265aee71ad1d22c4a43823869184441d4bf82.tar.gz luafilesystem-640265aee71ad1d22c4a43823869184441d4bf82.tar.bz2 luafilesystem-640265aee71ad1d22c4a43823869184441d4bf82.zip | |
removed warnings
Diffstat (limited to 'src')
| -rw-r--r-- | src/lfs.c | 9 |
1 files changed, 6 insertions, 3 deletions
| @@ -16,12 +16,13 @@ | |||
| 16 | ** lfs.touch (filepath [, atime [, mtime]]) | 16 | ** lfs.touch (filepath [, atime [, mtime]]) |
| 17 | ** lfs.unlock (fh) | 17 | ** lfs.unlock (fh) |
| 18 | ** | 18 | ** |
| 19 | ** $Id: lfs.c,v 1.47 2008/02/11 22:42:21 carregal Exp $ | 19 | ** $Id: lfs.c,v 1.48 2008/02/18 03:13:50 mascarenhas Exp $ |
| 20 | */ | 20 | */ |
| 21 | 21 | ||
| 22 | #include <errno.h> | 22 | #include <errno.h> |
| 23 | #include <stdio.h> | 23 | #include <stdio.h> |
| 24 | #include <string.h> | 24 | #include <string.h> |
| 25 | #include <stdlib.h> | ||
| 25 | #include <time.h> | 26 | #include <time.h> |
| 26 | #include <sys/stat.h> | 27 | #include <sys/stat.h> |
| 27 | 28 | ||
| @@ -176,7 +177,7 @@ static int _file_lock (lua_State *L, FILE *fh, const char *mode, const long star | |||
| 176 | return (code != -1); | 177 | return (code != -1); |
| 177 | } | 178 | } |
| 178 | 179 | ||
| 179 | 180 | #ifdef _WIN32 | |
| 180 | static int lfs_g_setmode (lua_State *L, FILE *f, int arg) { | 181 | static int lfs_g_setmode (lua_State *L, FILE *f, int arg) { |
| 181 | static const int mode[] = {_O_TEXT, _O_BINARY}; | 182 | static const int mode[] = {_O_TEXT, _O_BINARY}; |
| 182 | static const char *const modenames[] = {"text", "binary", NULL}; | 183 | static const char *const modenames[] = {"text", "binary", NULL}; |
| @@ -206,6 +207,7 @@ static int lfs_g_setmode (lua_State *L, FILE *f, int arg) { | |||
| 206 | static int lfs_f_setmode(lua_State *L) { | 207 | static int lfs_f_setmode(lua_State *L) { |
| 207 | return lfs_g_setmode(L, check_file(L, 1, "setmode"), 2); | 208 | return lfs_g_setmode(L, check_file(L, 1, "setmode"), 2); |
| 208 | } | 209 | } |
| 210 | #endif | ||
| 209 | 211 | ||
| 210 | /* | 212 | /* |
| 211 | ** Locks a file. | 213 | ** Locks a file. |
| @@ -528,6 +530,7 @@ static void push_st_blksize (lua_State *L, struct stat *info) { | |||
| 528 | #endif | 530 | #endif |
| 529 | static void push_invalid (lua_State *L, struct stat *info) { | 531 | static void push_invalid (lua_State *L, struct stat *info) { |
| 530 | luaL_error(L, "invalid attribute name"); | 532 | luaL_error(L, "invalid attribute name"); |
| 533 | info->st_blksize = 0; /* never reached */ | ||
| 531 | } | 534 | } |
| 532 | 535 | ||
| 533 | typedef void (*_push_function) (lua_State *L, struct stat *info); | 536 | typedef void (*_push_function) (lua_State *L, struct stat *info); |
| @@ -642,7 +645,7 @@ static const struct luaL_reg fslib[] = { | |||
| 642 | #ifndef _WIN32 | 645 | #ifndef _WIN32 |
| 643 | {"symlinkattributes", link_info}, | 646 | {"symlinkattributes", link_info}, |
| 644 | #else | 647 | #else |
| 645 | {"setmode", lfs_f_setmode}, | 648 | {"setmode", lfs_f_setmode}, |
| 646 | #endif | 649 | #endif |
| 647 | {"touch", file_utime}, | 650 | {"touch", file_utime}, |
| 648 | {"unlock", file_unlock}, | 651 | {"unlock", file_unlock}, |
