Skip to content

Commit

Permalink
db_text: Fix Coverity warning (bad 'switch' fallthrough)
Browse files Browse the repository at this point in the history
Thanks to Răzvan Crainea for the help!

(cherry picked from commit 6b56ca5)
(cherry picked from commit 8b9307f)
  • Loading branch information
liviuchircu committed Jul 17, 2020
1 parent 3b93b69 commit 9fa8785
Showing 1 changed file with 40 additions and 27 deletions.
67 changes: 40 additions & 27 deletions modules/db_text/dbt_lib.c
Expand Up @@ -537,34 +537,47 @@ int dbt_is_neq_type(db_type_t _t0, db_type_t _t1)
// LM_DBG("t0=%d t1=%d!\n", _t0, _t1);
if(_t0 == _t1)
return 0;
switch(_t1)
{
case DB_INT:
if(_t0==DB_DATETIME || _t0==DB_BITMAP || _t0==DB_BIGINT)
return 0;
case DB_DATETIME:
if(_t0==DB_INT||_t0==DB_BIGINT)
return 0;
if(_t0==DB_BITMAP)
return 0;
case DB_DOUBLE:
break;
case DB_STRING:
if(_t0==DB_STR)
return 0;
case DB_STR:
if(_t0==DB_STRING || _t0==DB_BLOB)
return 0;
case DB_BLOB:
if(_t0==DB_STR || _t0==DB_STRING)
return 0;
case DB_BITMAP:
if (_t0==DB_INT)
return 0;
case DB_BIGINT:
if (_t0==DB_INT || _t0==DB_DATETIME || _t0==DB_BITMAP)
return 0;

switch(_t1) {
case DB_INT:
if(_t0==DB_BIGINT || _t0==DB_DATETIME || _t0==DB_BITMAP)
return 0;
break;

case DB_STRING:
if(_t0==DB_STR || _t0 == DB_BLOB)
return 0;
break;

case DB_STR:
if(_t0==DB_STRING || _t0==DB_BLOB)
return 0;
break;

case DB_BIGINT:
if(_t0==DB_INT || _t0==DB_DATETIME || _t0==DB_BITMAP)
return 0;
break;

case DB_BLOB:
if(_t0==DB_STR || _t0==DB_STRING)
return 0;
break;

case DB_DATETIME:
if(_t0==DB_INT || _t0==DB_BIGINT || _t0==DB_BITMAP)
return 0;
break;

case DB_BITMAP:
if(_t0==DB_INT || _t0==DB_BIGINT || _t0==DB_DATETIME)
return 0;
break;

default:
break;
}

return 1;
}

0 comments on commit 9fa8785

Please sign in to comment.