Bugzilla – Full Text Bug Listing |
Summary: | PointToPointGridHelper useless if clauses | ||
---|---|---|---|
Product: | ns-3 | Reporter: | Quincy Tse <quincy.tse> |
Component: | helpers | Assignee: | ns-bugs <ns-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | trivial | CC: | jpelkey |
Priority: | P5 | ||
Version: | ns-3-dev | ||
Hardware: | All | ||
OS: | All | ||
Attachments: | Proposed patch |
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. |
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.