[tabbed PoC] kill dead stores #1348

This commit is contained in:
nick black 2021-10-18 19:28:14 -04:00
parent b544364ab4
commit 5010911a08
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -83,12 +83,14 @@ int main(int argc, char** argv){
struct nctab* t_; // stupid unused result warnings
(void) t_;
ncplane_set_base(nctabbed_content_plane(nct), " ", 0, NCCHANNELS_INITIALIZER(255, 255, 255, 15, 60, 15));
t_ = nctabbed_add(nct, NULL, NULL, tabcbfn, "Tab #1", NULL);
t_ = nctabbed_add(nct, NULL, NULL, tabcbfn, "gamma", NULL);
t_ = nctabbed_add(nct, NULL, NULL, tabcbfn, "beta", NULL);
t_ = nctabbed_add(nct, NULL, NULL, tabcbfn, "alpha", NULL);
t_ = nctabbed_add(nct, NULL, NULL, tabcbfn, "Tab #3", NULL);
t_ = nctabbed_add(nct, NULL, NULL, tabcbfn, "Tab #2", NULL);
if(nctabbed_add(nct, NULL, NULL, tabcbfn, "Tab #1", NULL) == NULL
|| nctabbed_add(nct, NULL, NULL, tabcbfn, "gamma", NULL) == NULL
|| nctabbed_add(nct, NULL, NULL, tabcbfn, "beta", NULL) == NULL
|| nctabbed_add(nct, NULL, NULL, tabcbfn, "alpha", NULL) == NULL
|| nctabbed_add(nct, NULL, NULL, tabcbfn, "Tab #3", NULL) == NULL
|| nctabbed_add(nct, NULL, NULL, tabcbfn, "Tab #2", NULL) == NULL){
goto ded;
}
ncplane_puttext(stdp, 1, NCALIGN_CENTER,
"Use left/right arrow keys for navigation, "
"'[' and ']' to rotate tabs, "
@ -127,7 +129,9 @@ int main(int argc, char** argv){
nctab_move_right(nct, nctabbed_selected(nct));
break;
case 'a':
t_ = nctabbed_add(nct, NULL, NULL, tabcbfn, tabnames[tabnameind++], NULL);
if(nctabbed_add(nct, NULL, NULL, tabcbfn, tabnames[tabnameind++], NULL) == NULL){
goto ded;
}
tabnameind %= sizeof(tabnames) / sizeof(tabnames[0]);
break;
case 'r':