PVS/V1037: redundant switch-case branches #10519

Suppress the warning, the branches are semantically different.
This commit is contained in:
Ihor Antonov
2019-07-17 18:20:06 -04:00
committed by Justin M. Keyes
parent 4fc91fe365
commit 452ec4ed31

View File

@@ -1108,9 +1108,8 @@ static int current_tab_nr(tabpage_T *tab)
#define CURRENT_TAB_NR current_tab_nr(curtab) #define CURRENT_TAB_NR current_tab_nr(curtab)
#define LAST_TAB_NR current_tab_nr(NULL) #define LAST_TAB_NR current_tab_nr(NULL)
/*
* Figure out the address type for ":wincmd". /// Figure out the address type for ":wincmd".
*/
static void get_wincmd_addr_type(char_u *arg, exarg_T *eap) static void get_wincmd_addr_type(char_u *arg, exarg_T *eap)
{ {
switch (*arg) { switch (*arg) {
@@ -1156,13 +1155,13 @@ static void get_wincmd_addr_type(char_u *arg, exarg_T *eap)
case Ctrl_I: case Ctrl_I:
case 'd': case 'd':
case Ctrl_D: case Ctrl_D:
/* window size or any count */ // window size or any count
eap->addr_type = ADDR_LINES; eap->addr_type = ADDR_LINES; // -V1037
break; break;
case Ctrl_HAT: case Ctrl_HAT:
case '^': case '^':
/* buffer number */ // buffer number
eap->addr_type = ADDR_BUFFERS; eap->addr_type = ADDR_BUFFERS;
break; break;
@@ -1177,7 +1176,7 @@ static void get_wincmd_addr_type(char_u *arg, exarg_T *eap)
case 'W': case 'W':
case 'x': case 'x':
case Ctrl_X: case Ctrl_X:
/* window number */ // window number
eap->addr_type = ADDR_WINDOWS; eap->addr_type = ADDR_WINDOWS;
break; break;
@@ -1192,7 +1191,7 @@ static void get_wincmd_addr_type(char_u *arg, exarg_T *eap)
case Ctrl_P: case Ctrl_P:
case '=': case '=':
case CAR: case CAR:
/* no count */ // no count
eap->addr_type = 0; eap->addr_type = 0;
break; break;
} }