Advertisement
PVS-StudioWarnings

PVS-Studio warning V571 for Micro-Manager

Nov 25th, 2014
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.70 KB | None | 0 0
  1. int XYStage::OnTriggerEndX(MM::PropertyBase* pProp,
  2.                            MM::ActionType eAct){
  3.   if (eAct == MM::BeforeGet)
  4.   {
  5.     int ret = GetCommandValue("trgse",xChannel_,chx_.trgse_);
  6.     if (ret!=DEVICE_OK)
  7.     if (ret!=DEVICE_OK)
  8.       return ret;
  9.   .....
  10. }
  11.  
  12. No trouble. Superfluous check.
  13.  
  14.  
  15. This suspicious code was found in Micro-Manager project by PVS-Studio static code analyzer.
  16. Warning message is:
  17. V571 Recurring check. The 'if (ret != 0)' condition was already verified in line 5806. Piezosystem_dDrive.cpp 5807
  18.  
  19. 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