PVS-StudioWarnings

PVS-Studio warning V517 for TickerTape

Nov 12th, 2014
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.80 KB | None | 0 0
  1. void DXUTUpdateD3D10DeviceStats(....)
  2. {
  3.   ...
  4.   else if( DeviceType == D3D10_DRIVER_TYPE_SOFTWARE )  <<<---
  5.     wcscpy_s( pstrDeviceStats, 256, L"WARP" );
  6.   else if( DeviceType == D3D10_DRIVER_TYPE_HARDWARE )
  7.     wcscpy_s( pstrDeviceStats, 256, L"HARDWARE" );
  8.   else if( DeviceType == D3D10_DRIVER_TYPE_SOFTWARE )  <<<---
  9.     wcscpy_s( pstrDeviceStats, 256, L"SOFTWARE" );
  10.   ...
  11. }
  12.  
  13. This suspicious code was found in TickerTape project by PVS-Studio static code analyzer.
  14. Warning message is:
  15. V517 The use of 'if (A) {...} else if (A) {...}' pattern was detected. There is a probability of logical error presence. TickerTape dxut.cpp 6217
  16.  
  17. 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