PVS-StudioWarnings

PVS-Studio warning V560 for OpenJPEG

Nov 20th, 2014
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.77 KB | None | 0 0
  1. typedef enum PROG_ORDER {
  2.   PROG_UNKNOWN = -1,
  3.   LRCP = 0,
  4.   RLCP = 1,
  5.   RPCL = 2,
  6.   PCRL = 3,
  7.   CPRL = 4
  8. } OPJ_PROG_ORDER;
  9.  
  10. OPJ_INT32 pi_check_next_level(....)
  11. {
  12.   ....
  13.   case 'P':
  14.     switch(tcp->prg)
  15.     {
  16.       case LRCP||RLCP:
  17.         if(tcp->prc_t == tcp->prcE){
  18.           l=pi_check_next_level(i-1,cp,tileno,pino,prog);
  19.   ....
  20. }
  21.  
  22. Most likely this is what should be written here: case LRCP: .... case RLCP: ....
  23.  
  24. This suspicious code was found in OpenJPEG project by PVS-Studio static code analyzer.
  25. Warning message is:
  26. V560 A part of conditional expression is always true: RLCP. pi.c 1708
  27.  
  28. 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