PVS-StudioWarnings

PVS-Studio warning V646 for Geant4

Nov 13th, 2014
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.87 KB | None | 0 0
  1. G4double
  2. G4EmBiasingManager::ApplySecondaryBiasing(....)
  3. {
  4.   ....
  5.   if(0 == nsplit) {
  6.     if(safety > fSafetyMin) {
  7.       ApplyRangeCut(vd, track, eloss, safety);
  8.     }
  9.   } if(1 == nsplit) {
  10.     weight = ApplyRussianRoulette(vd, index);
  11.   } else {
  12.     G4double tmpEnergy = ....;
  13.     G4ThreeVector tmpMomDir = ....;
  14.     weight = ....;
  15.     pPartChange->SetProposedKineticEnergy(tmpEnergy);
  16.     pPartChange->ProposeMomentumDirection(tmpMomDir);
  17.   }
  18.   ....
  19. }
  20.  
  21. This suspicious code was found in Geant4 project by PVS-Studio static code analyzer.
  22. Warning message is:
  23. V646 Consider inspecting the application's logic. It's possible that 'else' keyword is missing. _G4processes-archive g4embiasingmanager.cc 299
  24.  
  25. 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