diff --git a/src/audacious.c b/src/audacious.c index 53e9cf83..866d3c15 100644 --- a/src/audacious.c +++ b/src/audacious.c @@ -122,6 +122,7 @@ int destroy_audacious_thread(void) /* --------------------------------------------------- * Worker thread function for audacious data sampling. * --------------------------------------------------- */ +__attribute((noreturn)) void *audacious_thread_func(void *pvoid) { static audacious_t items; diff --git a/src/mpd.c b/src/mpd.c index 28e75489..cc507577 100644 --- a/src/mpd.c +++ b/src/mpd.c @@ -121,11 +121,13 @@ void clear_mpd_stats(struct mpd_s *mpd) void *update_mpd(void *arg) { + struct mpd_s *mpd; + if (arg == NULL) { CRIT_ERR("update_mpd called with a null argument!"); } - struct mpd_s *mpd = (struct mpd_s *) arg; + mpd = (struct mpd_s *) arg; while (1) { mpd_Status *status; diff --git a/src/prss.c b/src/prss.c index b2c02989..68b8dc1e 100644 --- a/src/prss.c +++ b/src/prss.c @@ -15,8 +15,8 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include "prss.h" #include "conky.h" +#include "prss.h" #include #include diff --git a/src/rss.c b/src/rss.c index c1aa0ac5..64222abd 100644 --- a/src/rss.c +++ b/src/rss.c @@ -63,7 +63,7 @@ size_t WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data) return realsize; } -int rss_delay(int *wait, int delay) +int rss_delay(int *wait_time, int delay) { time_t now = time(NULL); @@ -73,13 +73,13 @@ int rss_delay(int *wait, int delay) } delay *= 60; - if (!*wait) { - *wait = now + delay; + if (!*wait_time) { + *wait_time = now + delay; return 1; } - if (now >= *wait + delay) { - *wait = now + delay; + if (now >= *wait_time + delay) { + *wait_time = now + delay; return 1; } diff --git a/src/timed_thread.c b/src/timed_thread.c index a63d85c3..c2881389 100644 --- a/src/timed_thread.c +++ b/src/timed_thread.c @@ -60,6 +60,10 @@ static timed_thread_list *p_timed_thread_list_tail = NULL; static int now(struct timespec *abstime) { +#ifndef HAVE_CLOCK_GETTIME + struct timeval tv; +#endif + if (!abstime) { return -1; } @@ -68,8 +72,6 @@ static int now(struct timespec *abstime) return clock_gettime(CLOCK_REALTIME, abstime); #else /* fallback to gettimeofday () */ - struct timeval tv; - if (gettimeofday(&tv, NULL) != 0) { return -1; }