PVS-StudioWarnings

PVS-Studio warning V532 for IPP Samples

Nov 19th, 2014
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.68 KB | None | 0 0
  1. static void
  2. sbrencConflictResolution (..., Ipp32s *nLeftBord)
  3. {
  4.   ...
  5.   *nLeftBord = nBordNext - 1;
  6.   ...
  7.   if (*lenBordNext > 1) {
  8.     ...
  9.     *nLeftBord--;
  10.   }
  11.   ...
  12. }
  13.  
  14. nLeftBord is used to return the value.
  15. This is what should have been written here: (*nLeftBord)--;
  16.  
  17. This suspicious code was found in IPP Samples project by PVS-Studio static code analyzer.
  18. Warning message is:
  19. V532 Consider inspecting  the statement of '*pointer--' pattern. Probably meant: '(*pointer)--'. aac_enc sbr_enc_frame_gen.c 428
  20.  
  21. 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