From 70a4a723c507efc4e1bcfa4d4685da0821bff6dc Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Wed, 15 Jul 2015 11:45:53 +0100 Subject: win32: silence some compiler warnings --- win32/mingw.c | 3 ++- win32/mntent.c | 14 ++++++++------ win32/process.c | 2 +- win32/uname.c | 6 +++--- 4 files changed, 14 insertions(+), 11 deletions(-) (limited to 'win32') diff --git a/win32/mingw.c b/win32/mingw.c index 824413586..6b63e2487 100644 --- a/win32/mingw.c +++ b/win32/mingw.c @@ -648,7 +648,8 @@ struct group *getgrgid(gid_t gid UNUSED_PARAM) return &g; } -int getgrouplist(const char *user, gid_t group, gid_t *groups, int *ngroups) +int getgrouplist(const char *user UNUSED_PARAM, gid_t group UNUSED_PARAM, + gid_t *groups, int *ngroups) { if ( *ngroups == 0 ) { *ngroups = 1; diff --git a/win32/mntent.c b/win32/mntent.c index d39ceb4a6..9b04a9c5e 100644 --- a/win32/mntent.c +++ b/win32/mntent.c @@ -28,10 +28,11 @@ struct mntent *getmntent(FILE *stream) struct mntdata *data = (struct mntdata *)stream; static char mnt_fsname[4]; static char mnt_dir[4]; + static char mnt_type[100]; + static char mnt_opts[4]; static struct mntent my_mount_entry = - { mnt_fsname, mnt_dir, (char *)"", (char *)"", 0, 0 }; + { mnt_fsname, mnt_dir, mnt_type, mnt_opts, 0, 0 }; struct mntent *entry; - static char fsname[100]; entry = NULL; while ( ++data->index < 26 ) { @@ -43,12 +44,13 @@ struct mntent *getmntent(FILE *stream) mnt_dir[1] = ':'; mnt_dir[2] = '\\'; mnt_dir[3] = '\0'; + mnt_type[0] = '\0'; + mnt_opts[0] = '\0'; if ( GetDriveType(mnt_dir) == DRIVE_FIXED ) { - my_mount_entry.mnt_type = ""; - if ( GetVolumeInformation(mnt_dir, NULL, 0, NULL, NULL, - NULL, fsname, 100) ) { - my_mount_entry.mnt_type = fsname; + if ( !GetVolumeInformation(mnt_dir, NULL, 0, NULL, NULL, + NULL, mnt_type, 100) ) { + mnt_type[0] = '\0'; } entry = &my_mount_entry; diff --git a/win32/process.c b/win32/process.c index e38792b5a..2206a0a5e 100644 --- a/win32/process.c +++ b/win32/process.c @@ -10,7 +10,7 @@ int waitpid(pid_t pid, int *status, int options) if (pid > 0 && options == 0) { if ( (proc=OpenProcess(SYNCHRONIZE|PROCESS_QUERY_INFORMATION, FALSE, pid)) != NULL ) { - ret = _cwait(status, proc, 0); + ret = _cwait(status, (intptr_t)proc, 0); CloseHandle(proc); return ret; } diff --git a/win32/uname.c b/win32/uname.c index 465ba1e28..3b3e21f8d 100644 --- a/win32/uname.c +++ b/win32/uname.c @@ -20,9 +20,9 @@ int uname(struct utsname *name) strcpy(name->release, unk); strcpy(name->version, unk); if (GetVersionEx(&os_info)) { - sprintf(name->release, "%d.%d", os_info.dwMajorVersion, - os_info.dwMinorVersion); - sprintf(name->version, "%d", os_info.dwBuildNumber); + sprintf(name->release, "%u.%u", (unsigned int)os_info.dwMajorVersion, + (unsigned int)os_info.dwMinorVersion); + sprintf(name->version, "%u", (unsigned int)os_info.dwBuildNumber); } strcpy(name->machine, unk); -- cgit v1.2.3-55-g6feb