Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MP285
- {
- ....
- static int GetMotionMode() { return m_nMotionMode; }
- ....
- };
- int ZStage::_SetPositionSteps(....)
- {
- ....
- if (MP285::GetMotionMode == 0)
- {
- long lOldZPosSteps = (long)MP285::Instance()->GetPositionZ();
- dSec = (double)labs(lZPosSteps-lOldZPosSteps) / dVelocity;
- }
- else
- {
- dSec = (double)labs(lZPosSteps) / dVelocity;
- }
- ....
- }
- This is what should have been written here: if (MP285::GetMotionMode() == 0)
- This suspicious code was found in Micro-Manager project by PVS-Studio static code analyzer.
- Warning message is:
- V516 Consider inspecting an odd expression. Non-null function pointer is compared to null: 'MP285::GetMotionMode == 0'. MP285ZStage.cpp 558
- PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement