Browse Source

[2726] Suppress cppcheck

The variable is in larger scope because it is used as a constant, so
it's at the top of the function.
Michal 'vorner' Vaner 12 years ago
parent
commit
49305bca03
2 changed files with 4 additions and 2 deletions
  1. 2 1
      src/bin/dhcp4/dhcp4_srv.cc
  2. 2 1
      src/bin/dhcp6/dhcp6_srv.cc

+ 2 - 1
src/bin/dhcp4/dhcp4_srv.cc

@@ -126,7 +126,8 @@ bool
 Dhcpv4Srv::run() {
     while (!shutdown_) {
         /// @todo: calculate actual timeout once we have lease database
-        int timeout = 1000;
+        //cppcheck-suppress variableScope This is temporary anyway
+        const int timeout = 1000;
 
         // client's message and server's response
         Pkt4Ptr query;

+ 2 - 1
src/bin/dhcp6/dhcp6_srv.cc

@@ -134,7 +134,8 @@ bool Dhcpv6Srv::run() {
         /// For now, we are just calling select for 1000 seconds. There
         /// were some issues reported on some systems when calling select()
         /// with too large values. Unfortunately, I don't recall the details.
-        int timeout = 1000;
+        //cppcheck-suppress variableScope This is temporary anyway
+        const int timeout = 1000;
 
         // client's message and server's response
         Pkt6Ptr query;