]> git.ozlabs.org Git - ccan/commitdiff
jacobson_karels: Add missing inline keyword
authorDavid Gibson <david@gibson.dropbear.id.au>
Wed, 4 Jun 2014 14:41:51 +0000 (00:41 +1000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Fri, 13 Jun 2014 02:52:39 +0000 (12:52 +1000)
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 <david@gibson.dropbear.id.au>
ccan/jacobson_karels/jacobson_karels.h
ccan/jacobson_karels/test/run-nouse.c [new file with mode: 0644]

index 0e9bc2dbbfc06d74a20cf1f719f8eaeec073a5e6..15d89036bda0b178ae8a90a6694a487f6a0f999e 100644 (file)
        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 (file)
index 0000000..ad708d1
--- /dev/null
@@ -0,0 +1,6 @@
+#include <ccan/jacobson_karels/jacobson_karels.h>
+
+int main(int argc, char *argv[])
+{
+       return 0;
+}