Advertisement
PVS-StudioWarnings

PVS-Studio warning V640 for Geant4

Nov 20th, 2014
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.91 KB | None | 0 0
  1. void
  2. G4JpegCoder::ForwardDCT(int* picData)
  3. {
  4.   for( int v=0; v<8; v++ ){
  5.     double cv = v ? 1.0 : DisSqrt2;
  6.     for( int u=0; u<8; u++ ){
  7.       double cu = u ? 1.0 : DisSqrt2;
  8.       double sum = 0;
  9.  
  10.       for( int y=0; y<8; y++ )
  11.         for( int x=0; x<8; x++ )
  12.           sum += picData[ y * 8 + x ] *
  13.                  mCosT[u][x] * mCosT[v][y];
  14.           mDCTData[ v * 8 + u ] = int( sum * cu * cv / 4 );
  15.         }
  16.     }
  17. }
  18.  
  19. This suspicious code was found in Geant4 project by PVS-Studio static code analyzer.
  20. Warning message is:
  21. V640 The code's operational logic does not correspond with its formatting. The statement is indented to the right, but it is always executed. It is possible that curly brackets are missing. g4rtjpegcoder.cc 270
  22.  
  23. 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