Commit 2b208fd0 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Make roughly work with unsigned values.

parent 200bed8c
...@@ -63,8 +63,8 @@ seqno_plus(unsigned short s, int plus) ...@@ -63,8 +63,8 @@ seqno_plus(unsigned short s, int plus)
return ((s + plus) & 0xFFFF); return ((s + plus) & 0xFFFF);
} }
int unsigned
roughly(int value) roughly(unsigned value)
{ {
return value * 3 / 4 + random() % (value / 2); return value * 3 / 4 + random() % (value / 2);
} }
......
...@@ -43,7 +43,7 @@ int seqno_minus(unsigned short s1, unsigned short s2) ...@@ -43,7 +43,7 @@ int seqno_minus(unsigned short s1, unsigned short s2)
ATTRIBUTE ((const)); ATTRIBUTE ((const));
unsigned short seqno_plus(unsigned short s, int plus) unsigned short seqno_plus(unsigned short s, int plus)
ATTRIBUTE ((const)); ATTRIBUTE ((const));
int roughly(int value); unsigned roughly(unsigned value);
void timeval_minus(struct timeval *d, void timeval_minus(struct timeval *d,
const struct timeval *s1, const struct timeval *s2); const struct timeval *s1, const struct timeval *s2);
int timeval_minus_msec(const struct timeval *s1, const struct timeval *s2) int timeval_minus_msec(const struct timeval *s1, const struct timeval *s2)
......
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