From fd4b8f4fe4abca0fac18a330dbeb9c5dea4fe1fa Mon Sep 17 00:00:00 2001 From: Tommaso Pecorella Date: Fri, 17 Feb 2017 00:24:44 +0100 Subject: [PATCH] olsr: fix static code analysys warnings (thanks to Natale Patriciello) --- src/olsr/model/olsr-header.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/olsr/model/olsr-header.cc b/src/olsr/model/olsr-header.cc index 30a2b09c0..70563dcae 100644 --- a/src/olsr/model/olsr-header.cc +++ b/src/olsr/model/olsr-header.cc @@ -50,6 +50,8 @@ SecondsToEmf (double seconds) { int a, b = 0; + NS_ASSERT_MSG (seconds >= OLSR_C, "SecondsToEmf - Can not convert a value less than OLSR_C"); + // find the largest integer 'b' such that: T/C >= 2^b for (b = 0; (seconds / OLSR_C) >= (1 << b); ++b) {