PVS-StudioWarnings

PVS-Studio warning V560 for ffdshow

Nov 11th, 2014
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.84 KB | None | 0 0
  1. #define ROTFLAGS_REGISTRATIONKEEPSALIVE 0x1
  2. #define ROTFLAGS_ALLOWANYCLIENT 0x2
  3.  
  4. virtual HRESULT STDMETHODCALLTYPE Register(DWORD grfFlags, ....);
  5.  
  6. LRESULT CALLBACK Tremote::remoteWndProc(
  7.   HWND hwnd, UINT msg, WPARAM wprm, LPARAM lprm)
  8. {
  9.   ....
  10.   pROT->Register(
  11.     ROTFLAGS_REGISTRATIONKEEPSALIVE && ROTFLAGS_ALLOWANYCLIENT,
  12.         (IUnknown*)pGraph, pMoniker, &pdwROT);
  13.   ....
  14. }
  15.  
  16. This is what should have been written here: ROTFLAGS_REGISTRATIONKEEPSALIVE & ROTFLAGS_ALLOWANYCLIENT
  17.  
  18. This suspicious code was found in ffdshow project by PVS-Studio static code analyzer.
  19. Warning message is:
  20. V560 A part of conditional expression is always true: 0x2. ffdshowremoteapi.cpp 314
  21.  
  22. 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