diff options
author | Ron Yorston <rmy@pobox.com> | 2014-03-13 22:02:12 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2014-03-13 22:02:12 +0000 |
commit | e8c9f63c8e618d85104369a4c588129b165851e2 (patch) | |
tree | 472f9a45e0cd789fee8d5b875a97d9877c169ff8 | |
parent | e15ec3837bfed8a05ff0e8c7edd658fbb41f5d7d (diff) | |
download | busybox-w32-e8c9f63c8e618d85104369a4c588129b165851e2.tar.gz busybox-w32-e8c9f63c8e618d85104369a4c588129b165851e2.tar.bz2 busybox-w32-e8c9f63c8e618d85104369a4c588129b165851e2.zip |
Fix some compiler warnings
-rw-r--r-- | include/mingw.h | 2 | ||||
-rw-r--r-- | win32/mempcpy.c | 1 | ||||
-rw-r--r-- | win32/mingw.c | 18 | ||||
-rw-r--r-- | win32/mntent.c | 5 | ||||
-rw-r--r-- | win32/process.c | 2 | ||||
-rw-r--r-- | win32/termios.c | 2 |
6 files changed, 16 insertions, 14 deletions
diff --git a/include/mingw.h b/include/mingw.h index 219712780..198ea911e 100644 --- a/include/mingw.h +++ b/include/mingw.h | |||
@@ -305,7 +305,7 @@ int waitpid(pid_t pid, int *status, unsigned options); | |||
305 | struct tm *gmtime_r(const time_t *timep, struct tm *result); | 305 | struct tm *gmtime_r(const time_t *timep, struct tm *result); |
306 | struct tm *localtime_r(const time_t *timep, struct tm *result); | 306 | struct tm *localtime_r(const time_t *timep, struct tm *result); |
307 | char *strptime(const char *s, const char *format, struct tm *tm); | 307 | char *strptime(const char *s, const char *format, struct tm *tm); |
308 | size_t mingw_strftime(const char *buf, size_t max, const char *format, const struct tm *tm); | 308 | size_t mingw_strftime(char *buf, size_t max, const char *format, const struct tm *tm); |
309 | int stime(time_t *t); | 309 | int stime(time_t *t); |
310 | 310 | ||
311 | #define strftime mingw_strftime | 311 | #define strftime mingw_strftime |
diff --git a/win32/mempcpy.c b/win32/mempcpy.c index 81fc88f61..732a6f4b2 100644 --- a/win32/mempcpy.c +++ b/win32/mempcpy.c | |||
@@ -14,6 +14,7 @@ | |||
14 | You should have received a copy of the GNU General Public License | 14 | You should have received a copy of the GNU General Public License |
15 | along with this program; if not, see <http://www.gnu.org/licenses/>. */ | 15 | along with this program; if not, see <http://www.gnu.org/licenses/>. */ |
16 | 16 | ||
17 | #include "libbb.h" | ||
17 | /* Specification. */ | 18 | /* Specification. */ |
18 | #include <string.h> | 19 | #include <string.h> |
19 | 20 | ||
diff --git a/win32/mingw.c b/win32/mingw.c index c52df4bb4..2645aadca 100644 --- a/win32/mingw.c +++ b/win32/mingw.c | |||
@@ -366,17 +366,17 @@ static inline void timeval_to_filetime(const struct timeval tv, FILETIME *ft) | |||
366 | ft->dwHighDateTime = winTime >> 32; | 366 | ft->dwHighDateTime = winTime >> 32; |
367 | } | 367 | } |
368 | 368 | ||
369 | int utimes(const char *file_name, const struct timeval times[2]) | 369 | int utimes(const char *file_name, const struct timeval tims[2]) |
370 | { | 370 | { |
371 | FILETIME mft, aft; | 371 | FILETIME mft, aft; |
372 | HANDLE fh; | 372 | HANDLE fh; |
373 | DWORD flags; | 373 | DWORD flags, attrs; |
374 | int rc; | 374 | int rc; |
375 | 375 | ||
376 | flags = FILE_ATTRIBUTE_NORMAL; | 376 | flags = FILE_ATTRIBUTE_NORMAL; |
377 | 377 | ||
378 | /* must have write permission */ | 378 | /* must have write permission */ |
379 | DWORD attrs = GetFileAttributes(file_name); | 379 | attrs = GetFileAttributes(file_name); |
380 | if ( attrs != INVALID_FILE_ATTRIBUTES ) { | 380 | if ( attrs != INVALID_FILE_ATTRIBUTES ) { |
381 | if ( attrs & FILE_ATTRIBUTE_READONLY ) { | 381 | if ( attrs & FILE_ATTRIBUTE_READONLY ) { |
382 | /* ignore errors here; open() will report them */ | 382 | /* ignore errors here; open() will report them */ |
@@ -397,9 +397,9 @@ int utimes(const char *file_name, const struct timeval times[2]) | |||
397 | goto revert_attrs; | 397 | goto revert_attrs; |
398 | } | 398 | } |
399 | 399 | ||
400 | if (times) { | 400 | if (tims) { |
401 | timeval_to_filetime(times[0], &aft); | 401 | timeval_to_filetime(tims[0], &aft); |
402 | timeval_to_filetime(times[1], &mft); | 402 | timeval_to_filetime(tims[1], &mft); |
403 | } | 403 | } |
404 | else { | 404 | else { |
405 | GetSystemTimeAsFileTime(&mft); | 405 | GetSystemTimeAsFileTime(&mft); |
@@ -566,7 +566,7 @@ struct passwd *getpwuid(int uid UNUSED_PARAM) | |||
566 | if (!GetUserName(user_name, &len)) | 566 | if (!GetUserName(user_name, &len)) |
567 | return NULL; | 567 | return NULL; |
568 | p.pw_name = user_name; | 568 | p.pw_name = user_name; |
569 | p.pw_gecos = "unknown"; | 569 | p.pw_gecos = (char *)"unknown"; |
570 | p.pw_dir = gethomedir(); | 570 | p.pw_dir = gethomedir(); |
571 | p.pw_shell = NULL; | 571 | p.pw_shell = NULL; |
572 | p.pw_uid = 1000; | 572 | p.pw_uid = 1000; |
@@ -811,7 +811,7 @@ int mingw_unlink(const char *pathname) | |||
811 | } | 811 | } |
812 | 812 | ||
813 | #undef strftime | 813 | #undef strftime |
814 | size_t mingw_strftime(const char *buf, size_t max, const char *format, const struct tm *tm) | 814 | size_t mingw_strftime(char *buf, size_t max, const char *format, const struct tm *tm) |
815 | { | 815 | { |
816 | size_t ret; | 816 | size_t ret; |
817 | char day[3]; | 817 | char day[3]; |
@@ -846,7 +846,7 @@ size_t mingw_strftime(const char *buf, size_t max, const char *format, const str | |||
846 | return ret; | 846 | return ret; |
847 | } | 847 | } |
848 | 848 | ||
849 | int stime(time_t *t) | 849 | int stime(time_t *t UNUSED_PARAM) |
850 | { | 850 | { |
851 | errno = EPERM; | 851 | errno = EPERM; |
852 | return -1; | 852 | return -1; |
diff --git a/win32/mntent.c b/win32/mntent.c index 22efbf1b7..53f098796 100644 --- a/win32/mntent.c +++ b/win32/mntent.c | |||
@@ -9,7 +9,7 @@ struct mntdata { | |||
9 | int index; | 9 | int index; |
10 | }; | 10 | }; |
11 | 11 | ||
12 | FILE *setmntent(const char *file, const char *mode) | 12 | FILE *setmntent(const char *file UNUSED_PARAM, const char *mode UNUSED_PARAM) |
13 | { | 13 | { |
14 | struct mntdata *data; | 14 | struct mntdata *data; |
15 | 15 | ||
@@ -28,7 +28,8 @@ struct mntent *getmntent(FILE *stream) | |||
28 | struct mntdata *data = (struct mntdata *)stream; | 28 | struct mntdata *data = (struct mntdata *)stream; |
29 | static char mnt_fsname[4]; | 29 | static char mnt_fsname[4]; |
30 | static char mnt_dir[4]; | 30 | static char mnt_dir[4]; |
31 | static struct mntent my_mount_entry = { mnt_fsname, mnt_dir, "", 0, 0 }; | 31 | static struct mntent my_mount_entry = |
32 | { mnt_fsname, mnt_dir, (char *)"", (char *)"", 0, 0 }; | ||
32 | static struct mntent *entry; | 33 | static struct mntent *entry; |
33 | 34 | ||
34 | entry = NULL; | 35 | entry = NULL; |
diff --git a/win32/process.c b/win32/process.c index 59bc5b4a0..ba6444fac 100644 --- a/win32/process.c +++ b/win32/process.c | |||
@@ -332,7 +332,7 @@ mingw_execv(const char *cmd, const char *const *argv) | |||
332 | } | 332 | } |
333 | 333 | ||
334 | /* POSIX version in libbb/procps.c */ | 334 | /* POSIX version in libbb/procps.c */ |
335 | procps_status_t* FAST_FUNC procps_scan(procps_status_t* sp, int flags) | 335 | procps_status_t* FAST_FUNC procps_scan(procps_status_t* sp, int flags UNUSED_PARAM) |
336 | { | 336 | { |
337 | PROCESSENTRY32 pe; | 337 | PROCESSENTRY32 pe; |
338 | 338 | ||
diff --git a/win32/termios.c b/win32/termios.c index 12db40133..ad6ab117f 100644 --- a/win32/termios.c +++ b/win32/termios.c | |||
@@ -10,7 +10,7 @@ int tcgetattr(int fd UNUSED_PARAM, struct termios *t UNUSED_PARAM) | |||
10 | return -1; | 10 | return -1; |
11 | } | 11 | } |
12 | 12 | ||
13 | int64_t FAST_FUNC read_key(int fd, char *buf, int timeout) | 13 | int64_t FAST_FUNC read_key(int fd, char *buf UNUSED_PARAM, int timeout) |
14 | { | 14 | { |
15 | HANDLE cin = GetStdHandle(STD_INPUT_HANDLE); | 15 | HANDLE cin = GetStdHandle(STD_INPUT_HANDLE); |
16 | INPUT_RECORD record; | 16 | INPUT_RECORD record; |