mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
Fix many GCC -Wimplicit-fallthrough warnings (#243)
This commit adds '/* FALLTHROUGH */' comments to fix many GCC warnings when compiling with -Wimplicit-fallthrough. Additionally, the existing fallthrough comments have been changed for consistency.
This commit is contained in:
parent
f30da49564
commit
ed478ab7e3
73 changed files with 271 additions and 158 deletions
|
|
@ -836,6 +836,7 @@ static int cntlmode(Vi_t *vp)
|
|||
case BAD:
|
||||
/*** no match ***/
|
||||
ed_ringbell();
|
||||
/* FALLTHROUGH */
|
||||
|
||||
default:
|
||||
if( vp->u_column == INVALID )
|
||||
|
|
@ -956,6 +957,7 @@ static int cntlmode(Vi_t *vp)
|
|||
if(vp->repeat_set==0)
|
||||
goto vcommand;
|
||||
#endif /* KSHELL */
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case 'G': /** goto command repeat **/
|
||||
if(vp->repeat_set==0)
|
||||
|
|
@ -1014,11 +1016,13 @@ static int cntlmode(Vi_t *vp)
|
|||
}
|
||||
refresh(vp,INPUT);
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case '\n': /** send to shell **/
|
||||
#if SHOPT_EDPREDICT
|
||||
if(!vp->ed->hlist)
|
||||
return(ENTER);
|
||||
return(ENTER);
|
||||
/* FALLTHROUGH */
|
||||
case '\t': /** bring choice to edit **/
|
||||
if(vp->ed->hlist)
|
||||
{
|
||||
|
|
@ -1045,6 +1049,7 @@ static int cntlmode(Vi_t *vp)
|
|||
if(c=='[')
|
||||
continue;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
default:
|
||||
ringbell:
|
||||
ed_ringbell();
|
||||
|
|
@ -1519,6 +1524,7 @@ static void getline(register Vi_t* vp,register int mode)
|
|||
if( cur_virt != INVALID )
|
||||
continue;
|
||||
vp->addnl = 0;
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case '\n': /** newline or return **/
|
||||
if( mode != SEARCH )
|
||||
|
|
@ -1552,7 +1558,7 @@ static void getline(register Vi_t* vp,register int mode)
|
|||
}
|
||||
vp->ed->e_tabcount = 0;
|
||||
}
|
||||
/* FALL THRU*/
|
||||
/* FALLTHROUGH */
|
||||
default:
|
||||
if( mode == REPLACE )
|
||||
{
|
||||
|
|
@ -1610,7 +1616,7 @@ static int mvcursor(register Vi_t* vp,register int motion)
|
|||
tcur_virt = vp->repeat-1;
|
||||
if(tcur_virt <= last_virt)
|
||||
break;
|
||||
/* fall through */
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case '$': /** End of line **/
|
||||
tcur_virt = last_virt;
|
||||
|
|
@ -1748,6 +1754,7 @@ static int mvcursor(register Vi_t* vp,register int motion)
|
|||
case 'f': /** find new char forward **/
|
||||
bound = last_virt;
|
||||
incr = 1;
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case 'T': /** find up to new char backward **/
|
||||
case 'F': /** find new char backward **/
|
||||
|
|
@ -2444,10 +2451,12 @@ addin:
|
|||
if(vp->ed->e_tabcount!=1)
|
||||
return(BAD);
|
||||
c = '=';
|
||||
/* FALLTHROUGH */
|
||||
case '*': /** do file name expansion in place **/
|
||||
case '\\': /** do file name completion in place **/
|
||||
if( cur_virt == INVALID )
|
||||
return(BAD);
|
||||
/* FALLTHROUGH */
|
||||
case '=': /** list file name expansions **/
|
||||
save_v(vp);
|
||||
i = last_virt;
|
||||
|
|
@ -2528,10 +2537,12 @@ addin:
|
|||
while(i = *p++);
|
||||
return(APPEND);
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case 'A': /** append to end of line **/
|
||||
cur_virt = last_virt;
|
||||
sync_cursor(vp);
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case 'a': /** append **/
|
||||
if( fold(mode) == 'A' )
|
||||
|
|
@ -2551,6 +2562,7 @@ addin:
|
|||
case 'I': /** insert at beginning of line **/
|
||||
cur_virt = first_virt;
|
||||
sync_cursor(vp);
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case 'i': /** insert **/
|
||||
if( fold(mode) == 'I' )
|
||||
|
|
@ -2627,6 +2639,7 @@ deleol:
|
|||
vp->ocur_virt = INVALID;
|
||||
--cur_virt;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case 'p': /** print **/
|
||||
if( p[0] == '\0' )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue