Commit 23636f59 authored by David Gibson's avatar David Gibson

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: default avatarDavid Gibson <david@gibson.dropbear.id.au>
parent adfa48b9
......@@ -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); \
......
#include <ccan/jacobson_karels/jacobson_karels.h>
int main(int argc, char *argv[])
{
return 0;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment