Commit 6eedef44 authored by Sean McBride's avatar Sean McBride

Fixed ‘clarifyCalculation’ cppcheck warnings

Just added some parens to clarify precedence.
parent 0ed90343
Pipeline #8245 passed with stage
......@@ -34,7 +34,6 @@ unpreciseMathCall
memsetClassFloat
// There are just too many of these to manage, so suppress them all. Can look again one day.
clarifyCalculation
cstyleCast
invalidscanf
noCopyConstructor
......
......@@ -532,9 +532,9 @@ bool vtkAMRCutPlane::PlaneIntersectsAMRBox( double plane[4], double bounds[6] )
for( int i=0; i < 8; ++i )
{
// Get box coordinates
double x = ( i&1 ? bounds[1] : bounds[0] );
double y = ( i&2 ? bounds[3] : bounds[2] );
double z = ( i&3 ? bounds[5] : bounds[4] );
double x = ( i&1 ) ? bounds[1] : bounds[0];
double y = ( i&2 ) ? bounds[3] : bounds[2];
double z = ( i&3 ) ? bounds[5] : bounds[4];
// Plug-in coordinates to the plane equation
double v = plane[3] - plane[0]*x - plane[1]*y - plane[2]*z;
......
......@@ -260,9 +260,9 @@ bool vtkAMRSliceFilter::PlaneIntersectsAMRBox(double plane[4],double bounds[6])
for( int i=0; i < 8; ++i )
{
// Get box coordinates
double x = ( i&1 ? bounds[1] : bounds[0] );
double y = ( i&2 ? bounds[3] : bounds[2] );
double z = ( i&3 ? bounds[5] : bounds[4] );
double x = ( i&1 ) ? bounds[1] : bounds[0];
double y = ( i&2 ) ? bounds[3] : bounds[2];
double z = ( i&3 ) ? bounds[5] : bounds[4];
// Plug-in coordinates to the plane equation
double v = plane[3] - plane[0]*x - plane[1]*y - plane[2]*z;
......
......@@ -1083,7 +1083,7 @@ int vtkXYPlotActor::RenderOpaqueGeometry( vtkViewport* viewport )
switch ( this->AdjustTitlePositionMode & ( AlignAxisTop | AlignAxisBottom | AlignAxisVCenter ) )
{
case AlignAxisTop:
titlePos[1] += this->AdjustTitlePositionMode & AlignTop ? this->Border : -this->Border;
titlePos[1] += (this->AdjustTitlePositionMode & AlignTop) ? this->Border : -this->Border;
break;
case AlignAxisBottom:
titlePos[1] -= stringSize[1];
......
......@@ -1395,8 +1395,8 @@ void vtkOpenGLContextDevice2D::DrawEllipseWedge(float x, float y, float outRx,
for (int i = 0; i < numTVerts; i++)
{
int index = i/6 + offset[i%6]/2;
double radiusX = offset[i%6]%2 ? outRx : inRx;
double radiusY = offset[i%6]%2 ? outRy : inRy;
double radiusX = (offset[i%6]%2) ? outRx : inRx;
double radiusY = (offset[i%6]%2) ? outRy : inRy;
double a=rstart+index*step;
tverts.push_back(radiusX * cos(a) + x);
tverts.push_back(radiusY * sin(a) + y);
......
......@@ -688,11 +688,11 @@ void vtkXRenderWindowInteractorCallback(Widget vtkNotUsed(w),
return;
}
int ctrl =
(reinterpret_cast<XButtonEvent *>(event))->state & ControlMask ? 1 : 0;
((reinterpret_cast<XButtonEvent *>(event))->state & ControlMask) ? 1 : 0;
int shift =
(reinterpret_cast<XButtonEvent *>(event))->state & ShiftMask ? 1 : 0;
((reinterpret_cast<XButtonEvent *>(event))->state & ShiftMask) ? 1 : 0;
int alt =
(reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask ? 1 : 0;
((reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask) ? 1 : 0;
xp = (reinterpret_cast<XButtonEvent*>(event))->x;
yp = (reinterpret_cast<XButtonEvent*>(event))->y;
......@@ -746,11 +746,11 @@ void vtkXRenderWindowInteractorCallback(Widget vtkNotUsed(w),
return;
}
int ctrl =
(reinterpret_cast<XButtonEvent *>(event))->state & ControlMask ? 1 : 0;
((reinterpret_cast<XButtonEvent *>(event))->state & ControlMask) ? 1 : 0;
int shift =
(reinterpret_cast<XButtonEvent *>(event))->state & ShiftMask ? 1 : 0;
((reinterpret_cast<XButtonEvent *>(event))->state & ShiftMask) ? 1 : 0;
int alt =
(reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask ? 1 : 0;
((reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask) ? 1 : 0;
xp = (reinterpret_cast<XButtonEvent*>(event))->x;
yp = (reinterpret_cast<XButtonEvent*>(event))->y;
me->SetEventInformationFlipY(xp,
......@@ -788,7 +788,7 @@ void vtkXRenderWindowInteractorCallback(Widget vtkNotUsed(w),
(e->state & ControlMask) != 0,
(e->state & ShiftMask) != 0);
me->SetAltKey(
(reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask ? 1 : 0);
((reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask) ? 1 : 0);
me->InvokeEvent(vtkCommand::EnterEvent, NULL);
}
}
......@@ -804,7 +804,7 @@ void vtkXRenderWindowInteractorCallback(Widget vtkNotUsed(w),
(e->state & ControlMask) != 0,
(e->state & ShiftMask) != 0);
me->SetAltKey(
(reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask ? 1 : 0);
((reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask) ? 1 : 0);
me->InvokeEvent(vtkCommand::LeaveEvent, NULL);
}
}
......@@ -817,11 +817,11 @@ void vtkXRenderWindowInteractorCallback(Widget vtkNotUsed(w),
return;
}
int ctrl =
(reinterpret_cast<XButtonEvent *>(event))->state & ControlMask ? 1 : 0;
((reinterpret_cast<XButtonEvent *>(event))->state & ControlMask) ? 1 : 0;
int shift =
(reinterpret_cast<XButtonEvent *>(event))->state & ShiftMask ? 1 : 0;
((reinterpret_cast<XButtonEvent *>(event))->state & ShiftMask) ? 1 : 0;
int alt =
(reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask ? 1 : 0;
((reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask) ? 1 : 0;
KeySym ks;
static char buffer[20];
buffer[0] = '\0';
......@@ -848,11 +848,11 @@ void vtkXRenderWindowInteractorCallback(Widget vtkNotUsed(w),
return;
}
int ctrl =
(reinterpret_cast<XButtonEvent *>(event))->state & ControlMask ? 1 : 0;
((reinterpret_cast<XButtonEvent *>(event))->state & ControlMask) ? 1 : 0;
int shift =
(reinterpret_cast<XButtonEvent *>(event))->state & ShiftMask ? 1 : 0;
((reinterpret_cast<XButtonEvent *>(event))->state & ShiftMask) ? 1 : 0;
int alt =
(reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask ? 1 : 0;
((reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask) ? 1 : 0;
KeySym ks;
static char buffer[20];
buffer[0] = '\0';
......@@ -878,11 +878,11 @@ void vtkXRenderWindowInteractorCallback(Widget vtkNotUsed(w),
return;
}
int ctrl =
(reinterpret_cast<XButtonEvent *>(event))->state & ControlMask ? 1 : 0;
((reinterpret_cast<XButtonEvent *>(event))->state & ControlMask) ? 1 : 0;
int shift =
(reinterpret_cast<XButtonEvent *>(event))->state & ShiftMask ? 1 : 0;
((reinterpret_cast<XButtonEvent *>(event))->state & ShiftMask) ? 1 : 0;
int alt =
(reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask ? 1 : 0;
((reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask) ? 1 : 0;
// Note that even though the (x,y) location of the pointer is event structure,
// we must call XQueryPointer for the hints (motion event compression) to
......
......@@ -644,11 +644,11 @@ void vtkXRenderWindowInteractorCallback(Widget vtkNotUsed(w),
return;
}
int ctrl =
(reinterpret_cast<XButtonEvent *>(event))->state & ControlMask ? 1 : 0;
((reinterpret_cast<XButtonEvent *>(event))->state & ControlMask) ? 1 : 0;
int shift =
(reinterpret_cast<XButtonEvent *>(event))->state & ShiftMask ? 1 : 0;
((reinterpret_cast<XButtonEvent *>(event))->state & ShiftMask) ? 1 : 0;
int alt =
(reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask ? 1 : 0;
((reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask) ? 1 : 0;
xp = (reinterpret_cast<XButtonEvent*>(event))->x;
yp = (reinterpret_cast<XButtonEvent*>(event))->y;
......@@ -702,11 +702,11 @@ void vtkXRenderWindowInteractorCallback(Widget vtkNotUsed(w),
return;
}
int ctrl =
(reinterpret_cast<XButtonEvent *>(event))->state & ControlMask ? 1 : 0;
((reinterpret_cast<XButtonEvent *>(event))->state & ControlMask) ? 1 : 0;
int shift =
(reinterpret_cast<XButtonEvent *>(event))->state & ShiftMask ? 1 : 0;
((reinterpret_cast<XButtonEvent *>(event))->state & ShiftMask) ? 1 : 0;
int alt =
(reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask ? 1 : 0;
((reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask) ? 1 : 0;
xp = (reinterpret_cast<XButtonEvent*>(event))->x;
yp = (reinterpret_cast<XButtonEvent*>(event))->y;
me->SetEventInformationFlipY(xp,
......@@ -744,7 +744,7 @@ void vtkXRenderWindowInteractorCallback(Widget vtkNotUsed(w),
(e->state & ControlMask) != 0,
(e->state & ShiftMask) != 0);
me->SetAltKey(
(reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask ? 1 : 0);
((reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask) ? 1 : 0);
me->InvokeEvent(vtkCommand::EnterEvent, NULL);
}
}
......@@ -760,7 +760,7 @@ void vtkXRenderWindowInteractorCallback(Widget vtkNotUsed(w),
(e->state & ControlMask) != 0,
(e->state & ShiftMask) != 0);
me->SetAltKey(
(reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask ? 1 : 0);
((reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask) ? 1 : 0);
me->InvokeEvent(vtkCommand::LeaveEvent, NULL);
}
}
......@@ -773,11 +773,11 @@ void vtkXRenderWindowInteractorCallback(Widget vtkNotUsed(w),
return;
}
int ctrl =
(reinterpret_cast<XButtonEvent *>(event))->state & ControlMask ? 1 : 0;
((reinterpret_cast<XButtonEvent *>(event))->state & ControlMask) ? 1 : 0;
int shift =
(reinterpret_cast<XButtonEvent *>(event))->state & ShiftMask ? 1 : 0;
((reinterpret_cast<XButtonEvent *>(event))->state & ShiftMask) ? 1 : 0;
int alt =
(reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask ? 1 : 0;
((reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask) ? 1 : 0;
KeySym ks;
static char buffer[20];
buffer[0] = '\0';
......@@ -804,11 +804,11 @@ void vtkXRenderWindowInteractorCallback(Widget vtkNotUsed(w),
return;
}
int ctrl =
(reinterpret_cast<XButtonEvent *>(event))->state & ControlMask ? 1 : 0;
((reinterpret_cast<XButtonEvent *>(event))->state & ControlMask) ? 1 : 0;
int shift =
(reinterpret_cast<XButtonEvent *>(event))->state & ShiftMask ? 1 : 0;
((reinterpret_cast<XButtonEvent *>(event))->state & ShiftMask) ? 1 : 0;
int alt =
(reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask ? 1 : 0;
((reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask) ? 1 : 0;
KeySym ks;
static char buffer[20];
buffer[0] = '\0';
......@@ -834,11 +834,11 @@ void vtkXRenderWindowInteractorCallback(Widget vtkNotUsed(w),
return;
}
int ctrl =
(reinterpret_cast<XButtonEvent *>(event))->state & ControlMask ? 1 : 0;
((reinterpret_cast<XButtonEvent *>(event))->state & ControlMask) ? 1 : 0;
int shift =
(reinterpret_cast<XButtonEvent *>(event))->state & ShiftMask ? 1 : 0;
((reinterpret_cast<XButtonEvent *>(event))->state & ShiftMask) ? 1 : 0;
int alt =
(reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask ? 1 : 0;
((reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask) ? 1 : 0;
// Note that even though the (x,y) location of the pointer is event structure,
// we must call XQueryPointer for the hints (motion event compression) to
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment