From: Ruben Kerkhof Date: Sun, 11 Dec 2016 15:15:01 +0000 (+0100) Subject: utils_random.{c,h}: fix build warning X-Git-Tag: collectd-5.8.0~269 X-Git-Url: https://git.octo.it/?p=collectd.git;a=commitdiff_plain;h=7d8948f9d931d8acb3da197c5317a9f382657cd7 utils_random.{c,h}: fix build warning utils_random.c:53:8: warning: no previous prototype for function 'cdrand_d' [-Wmissing-prototypes] double cdrand_d() { ^ ./utils_random.h:32:8: note: this declaration is not a prototype; add 'void' to make it a prototype for a zero-parameter function double cdrand_d(); ^ void utils_random.c:64:10: warning: no previous prototype for function 'cdrand_u' [-Wmissing-prototypes] uint32_t cdrand_u() { ^ ./utils_random.h:40:10: note: this declaration is not a prototype; add 'void' to make it a prototype for a zero-parameter function uint32_t cdrand_u(); ^ void 2 warnings generated. --- diff --git a/src/daemon/utils_random.c b/src/daemon/utils_random.c index d490986d..77b500fb 100644 --- a/src/daemon/utils_random.c +++ b/src/daemon/utils_random.c @@ -50,7 +50,7 @@ static void cdrand_seed(void) { have_seed = 1; } -double cdrand_d() { +double cdrand_d(void) { double r; pthread_mutex_lock(&lock); @@ -61,7 +61,7 @@ double cdrand_d() { return (r); } -uint32_t cdrand_u() { +uint32_t cdrand_u(void) { long r; pthread_mutex_lock(&lock); diff --git a/src/daemon/utils_random.h b/src/daemon/utils_random.h index e25ae9b6..75bdc12e 100644 --- a/src/daemon/utils_random.h +++ b/src/daemon/utils_random.h @@ -29,7 +29,7 @@ * * This function is thread- and reentrant-safe. */ -double cdrand_d(); +double cdrand_d(void); /** * cdrand_u returns a random uint32_t value uniformly distributed in the range @@ -37,7 +37,7 @@ double cdrand_d(); * * This function is thread- and reentrant-safe. */ -uint32_t cdrand_u(); +uint32_t cdrand_u(void); /** * Returns a random long between min and max, inclusively.