Bug 994

Summary: PointToPointGridHelper useless if clauses
Product: ns-3 Reporter: Quincy Tse <quincy.tse>
Component: helpersAssignee: ns-bugs <ns-bugs>
Status: RESOLVED FIXED    
Severity: trivial CC: jpelkey
Priority: P5    
Version: ns-3-dev   
Hardware: All   
OS: All   
Attachments: Proposed patch

Description Quincy Tse 2010-09-16 00:37:15 EDT
Created attachment 976 [details]
Proposed patch

../src/helper/point-to-point-grid-helper.cc:181:11: error: ]
      comparison of unsigned expression < 0 is always false
      [-Wtautological-compare]
  if (row < 0 || col < 0 || 
      ~~~ ^ ~

row and col in GetNode and GetIpv4Address are both uint32_t, thus can never be below 0 - if clause always false.
Comment 1 Josh Pelkey 2010-09-16 15:52:25 EDT
The proposed patch is for a different bug, but I went ahead and just fixed by removing those cases out of those two if statements (line 181 and 193).

BTW, the if clause is not *always* false, as these are logical ORs and there are other cases within that conditional that could evaluate to true.  I went ahead and removed them anyway, since they are simply unnecessary.