olsr: fix more static analysis warnings

This commit is contained in:
Tommaso Pecorella
2017-02-18 00:31:43 +01:00
parent 027525e350
commit 809b423dc8
2 changed files with 2 additions and 3 deletions

View File

@@ -53,7 +53,7 @@ SecondsToEmf (double seconds)
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)
for (b = 1; (seconds / OLSR_C) >= (1 << b); ++b)
{
}
NS_ASSERT ((seconds / OLSR_C) < (1 << b));

View File

@@ -1981,9 +1981,8 @@ RoutingProtocol::LinkSensing (const olsr::MessageHeader &msg,
case OLSR_LOST_LINK:
linkTypeName = "LOST_LINK";
break;
/* no default, since lt must be in 0..3, covered above
default: linkTypeName = "(invalid value!)";
*/
}
const char *neighborTypeName;