From 45983e66e6472894772302c58e82c427cef4818d Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Thu, 19 Mar 2015 06:08:06 +0000 Subject: [PATCH] Fix a couple of MinGW warnings. --- daemon/daemon.c | 9 +++++++++ libtransmission/platform-quota.c | 5 +++++ libtransmission/torrent.c | 2 +- libtransmission/utils-test.c | 2 ++ libtransmission/web.c | 2 ++ 5 files changed, 19 insertions(+), 1 deletion(-) diff --git a/daemon/daemon.c b/daemon/daemon.c index 8f741a499..1457f7a41 100644 --- a/daemon/daemon.c +++ b/daemon/daemon.c @@ -67,7 +67,9 @@ #define SPEED_T_STR "TB/s" static bool paused = false; +#ifdef SIGHUP static bool seenHUP = false; +#endif static const char *logfileName = NULL; static tr_sys_file_t logfile = TR_BAD_SYS_FILE; static tr_session * mySession = NULL; @@ -262,7 +264,12 @@ tr_daemon (int nochdir, int noclose) return 0; #else /* USE_NO_DAEMON */ + + (void) nochdir; + (void) noclose; + return 0; + #endif } @@ -364,6 +371,8 @@ printMessage (tr_sys_file_t logfile, int level, const char * name, const char * else syslog (priority, "%s (%s:%d)", message, file, line); } +#else + (void) level; #endif } diff --git a/libtransmission/platform-quota.c b/libtransmission/platform-quota.c index 6bc6cd83a..e7d1f6d4f 100644 --- a/libtransmission/platform-quota.c +++ b/libtransmission/platform-quota.c @@ -359,6 +359,11 @@ tr_getQuotaFreeSpace (const struct tr_device_info * info) { ret = getquota (info->device); } + +#else /* _WIN32 */ + + (void) info; + #endif /* _WIN32 */ return ret; diff --git a/libtransmission/torrent.c b/libtransmission/torrent.c index 36b409d79..8b16738c7 100644 --- a/libtransmission/torrent.c +++ b/libtransmission/torrent.c @@ -2115,7 +2115,7 @@ torrentCallScript (const tr_torrent * tor, const char * script) tr_logAddTorInfo (tor, "Calling script \"%s\"", script); #ifdef _WIN32 - if (_spawnvpe (_P_NOWAIT, script, (const char*)cmd, env) == -1) + if (_spawnvpe (_P_NOWAIT, script, (const char* const*)cmd, (const char* const*)env) == -1) tr_logAddTorErr (tor, "error executing script \"%s\": %s", cmd[0], tr_strerror (errno)); #else signal (SIGCHLD, onSigCHLD); diff --git a/libtransmission/utils-test.c b/libtransmission/utils-test.c index aed1f818c..2100e30cc 100644 --- a/libtransmission/utils-test.c +++ b/libtransmission/utils-test.c @@ -388,6 +388,8 @@ test_truncd (void) /* FIXME: MSCVRT behaves differently in case of nan */ tr_snprintf (buf, sizeof (buf), "%.2f", tr_truncd (nan, 2)); check (strstr (buf, "nan") != NULL); +#else + (void) nan; #endif return 0; diff --git a/libtransmission/web.c b/libtransmission/web.c index 4d12dec19..6e6eca8d0 100644 --- a/libtransmission/web.c +++ b/libtransmission/web.c @@ -348,6 +348,8 @@ tr_select (int nfds, struct timeval * t) { #ifdef _WIN32 + (void) nfds; + if (!r_fd_set->fd_count && !w_fd_set->fd_count && !c_fd_set->fd_count) { const long int msec = t->tv_sec*1000 + t->tv_usec/1000; -- 2.40.0