You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
see http://www.viva64.com/en/b/0271/#ID0EWAAG
typedef enum PROG_ORDER {
PROG_UNKNOWN = -1,
LRCP = 0,
RLCP = 1,
RPCL = 2,
PCRL = 3,
CPRL = 4
} OPJ_PROG_ORDER;
OPJ_INT32 pi_check_next_level(....)
{
....
case 'P':
switch(tcp->prg)
{
case LRCP||RLCP:
if(tcp->prc_t == tcp->prcE){
l=pi_check_next_level(i-1,cp,tileno,pino,prog);
....
}
PVS-Studio's diagnostic message: V560 A part of conditional expression is always true:
RLCP. pi.c 1708
The programmer forgot how to use the 'case' operator properly. The statement "case
LRCP||RLCP:" is equivalent to "case 1:". And this is obviously not what the programmer
intended.
The correct code should look as follows:
case LRCP:
case RLCP:
And that's exactly what is written in other places of the program. Well, I would also
add a comment – something like this:
case LRCP: // fall through
case RLCP:
Originally reported on Google Code with ID 381
Reported by detonin on 2014-08-24 20:59:20
The text was updated successfully, but these errors were encountered: