Hi, in version 2.5, on the following class method
void Scale(double scale) { int num_points = int(m_polygon.m_points.size()); for (int i = 0; i < num_points; ++i) { niPoint2d & p = m_polygon.m_points[i]; p *= scale; } }
I am getting the following error reported
unreadVariable - Variable 'p' is assigned a value that is never used.
Since p is a reference, the expression p *= scale is using p to refer to the value that will be scaled and p is not changed itself.
p *= scale
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/10531
Log in to post a comment.
Hi,
in version 2.5, on the following class method
I am getting the following error reported
Since p is a reference, the expression
p *= scale
is using p to refer to the value that will be scaled and p is not changed itself.Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/10531