Advertisement
PVS-StudioWarnings

PVS-Studio warning V629 for JUCE

Nov 26th, 2014
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. typedef __int64 ogg_int64_t;
  2.  
  3. ogg_int64_t pcm_offset;
  4.  
  5. int ov_pcm_seek(OggVorbis_File *vf,ogg_int64_t pos){
  6.   ....
  7.   int hs = ....;
  8.   long samples=....;
  9.   ....
  10.   vf->pcm_offset+=samples<<hs;
  11.   ....
  12. }
  13.  
  14. This suspicious code was found in JUCE project by PVS-Studio static code analyzer.
  15. Warning message is:
  16. V629 Consider inspecting the 'samples << hs' expression. Bit shifting of the 32-bit value with a subsequent expansion to the 64-bit type. vorbisfile.c 1676
  17.  
  18. 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