Advertisement
PVS-StudioWarnings

PVS-Studio warning V560 for QT

Nov 21st, 2014
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.93 KB | None | 0 0
  1. #define WAVE_FORMAT_1M08       0x00000001
  2. #define WAVE_FORMAT_1S08       0x00000002
  3. ...
  4.  
  5. void QAudioDeviceInfoInternal::updateLists()
  6. {
  7.   ...
  8.   DWORD fmt;
  9.   ...
  10.   if((fmt && WAVE_FORMAT_1M08)
  11.      || (fmt && WAVE_FORMAT_1S08)
  12.      || (fmt && WAVE_FORMAT_2M08)
  13.      || (fmt && WAVE_FORMAT_2S08)
  14.      || (fmt && WAVE_FORMAT_4M08)
  15.      || (fmt && WAVE_FORMAT_4S08)
  16.   #ifndef Q_OS_WINCE
  17.      || (fmt && WAVE_FORMAT_48M08)
  18.      || (fmt && WAVE_FORMAT_48S08)
  19.      || (fmt && WAVE_FORMAT_96M08)
  20.      || (fmt && WAVE_FORMAT_96S08)
  21.   #endif
  22.   )
  23.   ...
  24. }
  25.  
  26. This suspicious code was found in QT project by PVS-Studio static code analyzer.
  27. Warning message is:
  28. V560 A part of conditional expression is always true: 0x00000001. QtMultimedia qaudiodeviceinfo_win32_p.cpp 322
  29.  
  30. 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