add a few more gcc warning flags and fix quite a few problems found by doing so

This commit is contained in:
Lennart Poettering 2008-08-19 22:39:54 +02:00
parent 047eb52b52
commit b7026bf248
99 changed files with 810 additions and 776 deletions

View file

@ -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");

View file

@ -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;
}

View file

@ -24,11 +24,11 @@
#include <config.h>
#endif
#if HAVE_DLFCN_H
#ifdef HAVE_DLFCN_H
#include <dlfcn.h>
#endif
#if HAVE_SYS_DL_H
#ifdef HAVE_SYS_DL_H
#include <sys/dl.h>
#endif