From: David Gibson Date: Wed, 4 Jun 2014 14:41:51 +0000 (+1000) Subject: jacobson_karels: Add missing inline keyword X-Git-Url: http://git.ozlabs.org/?p=ccan;a=commitdiff_plain;h=23636f5911d564fb3a74a49d122a5270d82aaa88 jacobson_karels: Add missing inline keyword Forgot the 'inline' in 'static inline' in the functions defined in the header, which means that lots of warnings will be generated, if you include the header but don't use the functions. Signed-off-by: David Gibson --- diff --git a/ccan/jacobson_karels/jacobson_karels.h b/ccan/jacobson_karels/jacobson_karels.h index 0e9bc2db..15d89036 100644 --- a/ccan/jacobson_karels/jacobson_karels.h +++ b/ccan/jacobson_karels/jacobson_karels.h @@ -10,13 +10,13 @@ struct _name##_state { \ _type rtt, variance; \ }; \ - static void _name##_init(struct _name##_state *s, \ + static inline void _name##_init(struct _name##_state *s, \ _type rtt0, _type var0) \ { \ s->rtt = rtt0; \ s->variance = var0; \ } \ - static void _name##_update(struct _name##_state *s, _type sample) \ + static inline void _name##_update(struct _name##_state *s, _type sample) \ { \ _type diff = sample - s->rtt; \ s->rtt += (_a2) * diff / ((_a1) + (_a2)); \ @@ -24,7 +24,7 @@ s->variance = ((_b1)*s->variance + (_b2) * diff) \ / ((_b1) + (_b2)); \ } \ - static _type _name##_timeout(struct _name##_state *s, \ + static inline _type _name##_timeout(struct _name##_state *s, \ _type tmin, _type tmax) \ { \ return clamp((_g) * s->rtt + (_k)*s->variance, tmin, tmax); \ diff --git a/ccan/jacobson_karels/test/run-nouse.c b/ccan/jacobson_karels/test/run-nouse.c new file mode 100644 index 00000000..ad708d17 --- /dev/null +++ b/ccan/jacobson_karels/test/run-nouse.c @@ -0,0 +1,6 @@ +#include + +int main(int argc, char *argv[]) +{ + return 0; +}