From b7026bf248948a6a30386ddbcc137f48f369a51e Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 19 Aug 2008 22:39:54 +0200 Subject: add a few more gcc warning flags and fix quite a few problems found by doing so --- src/daemon/cpulimit.c | 4 ++-- src/daemon/daemon-conf.c | 4 ++-- src/daemon/ltdl-bind-now.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/daemon') diff --git a/src/daemon/cpulimit.c b/src/daemon/cpulimit.c index b5ed71e0..c6e13d83 100644 --- a/src/daemon/cpulimit.c +++ b/src/daemon/cpulimit.c @@ -100,7 +100,7 @@ static void reset_cpu_time(int t) { n = ru.ru_utime.tv_sec + ru.ru_stime.tv_sec + t; pa_assert_se(getrlimit(RLIMIT_CPU, &rl) >= 0); - rl.rlim_cur = n; + rl.rlim_cur = (rlim_t) n; pa_assert_se(setrlimit(RLIMIT_CPU, &rl) >= 0); } @@ -130,7 +130,7 @@ static void signal_handler(int sig) { write_err(t); #endif - if (CPUTIME_INTERVAL_SOFT >= ((now-last_time)*(double)CPUTIME_PERCENT/100)) { + if ((double) CPUTIME_INTERVAL_SOFT >= ((double) (now-last_time)*(double)CPUTIME_PERCENT/100)) { static const char c = 'X'; write_err("Soft CPU time limit exhausted, terminating.\n"); diff --git a/src/daemon/daemon-conf.c b/src/daemon/daemon-conf.c index 4f7470ba..40e0a170 100644 --- a/src/daemon/daemon-conf.c +++ b/src/daemon/daemon-conf.c @@ -288,14 +288,14 @@ static int parse_sample_format(const char *filename, unsigned line, const char * static int parse_sample_rate(const char *filename, unsigned line, const char *lvalue, const char *rvalue, void *data, void *userdata) { pa_daemon_conf *c = data; - int32_t r; + uint32_t r; pa_assert(filename); pa_assert(lvalue); pa_assert(rvalue); pa_assert(data); - if (pa_atoi(rvalue, &r) < 0 || r > (int32_t) PA_RATE_MAX || r <= 0) { + if (pa_atou(rvalue, &r) < 0 || r > (uint32_t) PA_RATE_MAX || r <= 0) { pa_log(_("[%s:%u] Invalid sample rate '%s'."), filename, line, rvalue); return -1; } diff --git a/src/daemon/ltdl-bind-now.c b/src/daemon/ltdl-bind-now.c index 42c3b231..92e5d40d 100644 --- a/src/daemon/ltdl-bind-now.c +++ b/src/daemon/ltdl-bind-now.c @@ -24,11 +24,11 @@ #include #endif -#if HAVE_DLFCN_H +#ifdef HAVE_DLFCN_H #include #endif -#if HAVE_SYS_DL_H +#ifdef HAVE_SYS_DL_H #include #endif -- cgit