Change order of switch cases (1)

This commit is contained in:
Arun Prakash Jana 2018-12-16 19:45:16 +05:30
parent 55f1397cbb
commit b15867143c
No known key found for this signature in database
GPG key ID: A75979F35C080412

View file

@ -2913,6 +2913,13 @@ nochange:
if (ndents) if (ndents)
copycurname(); copycurname();
goto nochange; goto nochange;
case SEL_MFLTR: // fallthrough
case SEL_TOGGLEDOT: // fallthrough
case SEL_DETAIL: // fallthrough
case SEL_FSIZE: // fallthrough
case SEL_BSIZE: // fallthrough
case SEL_MTIME:
switch (sel) {
case SEL_MFLTR: case SEL_MFLTR:
cfg.filtermode ^= 1; cfg.filtermode ^= 1;
if (cfg.filtermode) { if (cfg.filtermode) {
@ -2920,22 +2927,49 @@ nochange:
goto nochange; goto nochange;
} }
/* Save current */
if (ndents)
copycurname();
dir_changed = TRUE;
/* Start watching the directory */ /* Start watching the directory */
goto begin; dir_changed = TRUE;
break;
case SEL_TOGGLEDOT: case SEL_TOGGLEDOT:
cfg.showhidden ^= 1; cfg.showhidden ^= 1;
/* Save current */ break;
if (ndents)
copycurname();
goto begin;
case SEL_DETAIL: case SEL_DETAIL:
cfg.showdetail ^= 1; cfg.showdetail ^= 1;
cfg.showdetail ? (printptr = &printent_long) : (printptr = &printent); cfg.showdetail ? (printptr = &printent_long) : (printptr = &printent);
break;
case SEL_FSIZE:
cfg.sizeorder ^= 1;
cfg.mtimeorder = 0;
cfg.apparentsz = 0;
cfg.blkorder = 0;
cfg.copymode = 0;
break;
case SEL_BSIZE:
if (sel == SEL_BSIZE) {
if (!cfg.apparentsz)
cfg.blkorder ^= 1;
nftw_fn = &sum_bsizes;
cfg.apparentsz = 0;
BLK_SHIFT = ffs(S_BLKSIZE) - 1;
}
if (cfg.blkorder) {
cfg.showdetail = 1;
printptr = &printent_long;
}
cfg.mtimeorder = 0;
cfg.sizeorder = 0;
cfg.copymode = 0;
break;
default: /* SEL_MTIME */
cfg.mtimeorder ^= 1;
cfg.sizeorder = 0;
cfg.apparentsz = 0;
cfg.blkorder = 0;
cfg.copymode = 0;
break;
}
/* Save current */ /* Save current */
if (ndents) if (ndents)
copycurname(); copycurname();
@ -3020,16 +3054,6 @@ nochange:
/* Repopulate as directory content may have changed */ /* Repopulate as directory content may have changed */
goto begin; goto begin;
} }
case SEL_FSIZE:
cfg.sizeorder ^= 1;
cfg.mtimeorder = 0;
cfg.apparentsz = 0;
cfg.blkorder = 0;
cfg.copymode = 0;
/* Save current */
if (ndents)
copycurname();
goto begin;
case SEL_ASIZE: case SEL_ASIZE:
cfg.apparentsz ^= 1; cfg.apparentsz ^= 1;
if (cfg.apparentsz) { if (cfg.apparentsz) {
@ -3038,36 +3062,6 @@ nochange:
BLK_SHIFT = 0; BLK_SHIFT = 0;
} else } else
cfg.blkorder = 0; // fallthrough cfg.blkorder = 0; // fallthrough
case SEL_BSIZE:
if (sel == SEL_BSIZE) {
if (!cfg.apparentsz)
cfg.blkorder ^= 1;
nftw_fn = &sum_bsizes;
cfg.apparentsz = 0;
BLK_SHIFT = ffs(S_BLKSIZE) - 1;
}
if (cfg.blkorder) {
cfg.showdetail = 1;
printptr = &printent_long;
}
cfg.mtimeorder = 0;
cfg.sizeorder = 0;
cfg.copymode = 0;
/* Save current */
if (ndents)
copycurname();
goto begin;
case SEL_MTIME:
cfg.mtimeorder ^= 1;
cfg.sizeorder = 0;
cfg.apparentsz = 0;
cfg.blkorder = 0;
cfg.copymode = 0;
/* Save current */
if (ndents)
copycurname();
goto begin;
case SEL_COPY: case SEL_COPY:
if (!ndents) if (!ndents)
goto nochange; goto nochange;