[Olsr-users] 0.5.6 Routes disappear after 4 mins of uptime, then all OK - suspect clock sync

Henning Rogge (spam-protected)
Fri Sep 5 07:49:33 CEST 2008

Am Freitag 05 September 2008 00:10:27 schrieb Bernd Petrovitsch:
> That was not your original version (and - with a somewhat sane C
> compiler - the ?: operator or the "const"s won't buy anything compared
> to the above if() sequence of course).
> Why it's different better?
I think because the source code is much more readable.

> At least gcc-4.1.2 produced other asm code for i386.

But maybe we can even do it better... we just define that our "comparator" 
function will return a value less than zero if the first parameter is smaller 
than the second one, 0 if they are both equal and more than zero if the first 
parameter is greater than the second one.

olsr_32_t time_cmp(const olsr_u32_t t1, const olsr_u32_t t2)
   return t1 - t2;

We just have to remember this definition when we use the function.

Diplom Informatiker Henning Rogge
Forschungsgesellschaft für
Angewandte Naturwissenschaften e. V. (FGAN) 
Neuenahrer Str. 20, 53343 Wachtberg, Germany
Tel.: 0049 (0)228 9435-961
Fax: 0049 (0)228 9435-685
E-Mail: (spam-protected)
Web: www.fgan.de
Sitz der Gesellschaft: Bonn
Registergericht: Amtsgericht Bonn VR 2530
Vorstand: Dr. rer. nat. Ralf Dornhaus (Vors.), Prof. Dr. Joachim Ender 

More information about the Olsr-users mailing list