From cf8b6400643e3b9b8fe57d27d7d275851e108562 Mon Sep 17 00:00:00 2001 From: nick black Date: Fri, 9 Jul 2021 10:14:05 -0400 Subject: [PATCH] The Gang Genocides Genocide s/_genocide/_destroy_family/g #1907 --- src/lib/internal.h | 2 +- src/lib/notcurses.c | 4 ++-- src/lib/reel.c | 22 +++++++++++----------- src/lib/tabbed.c | 10 +++++----- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/lib/internal.h b/src/lib/internal.h index 1ad7afee0..2598d18ca 100644 --- a/src/lib/internal.h +++ b/src/lib/internal.h @@ -1252,7 +1252,7 @@ cell_set_blitquadrants(nccell* c, unsigned tl, unsigned tr, unsigned bl, unsigne } // Destroy a plane and all its bound descendants. -int ncplane_genocide(ncplane *ncp); +int ncplane_destroy_family(ncplane *ncp); // Extract the 32-bit background channel from a cell. static inline uint32_t diff --git a/src/lib/notcurses.c b/src/lib/notcurses.c index a68667185..a852de921 100644 --- a/src/lib/notcurses.c +++ b/src/lib/notcurses.c @@ -850,7 +850,7 @@ int ncplane_destroy(ncplane* ncp){ return ret; } -int ncplane_genocide(ncplane *ncp){ +int ncplane_destroy_family(ncplane *ncp){ if(ncp == NULL){ return 0; } @@ -860,7 +860,7 @@ int ncplane_genocide(ncplane *ncp){ } int ret = 0; while(ncp->blist){ - ret |= ncplane_genocide(ncp->blist); + ret |= ncplane_destroy_family(ncp->blist); } ret |= ncplane_destroy(ncp); return ret; diff --git a/src/lib/reel.c b/src/lib/reel.c index 638f4d7dd..a8374acce 100644 --- a/src/lib/reel.c +++ b/src/lib/reel.c @@ -307,7 +307,7 @@ ncreel_draw_tablet(const ncreel* nr, nctablet* t, int frontiertop, if(ll){ // must be smaller than the space we provided; add back bottom ncplane_resize_simple(t->cbp, ll, cblenx); }else{ - ncplane_genocide(t->cbp); + ncplane_destroy_family(t->cbp); t->cbp = NULL; } // resize the borderplane iff we got smaller @@ -419,7 +419,7 @@ trim_reel_overhang(ncreel* r, nctablet* top, nctablet* bottom){ //fprintf(stderr, "top: %dx%d @ %d, miny: %d\n", ylen, xlen, y, miny); if(boty < miny){ //fprintf(stderr, "NUKING top!\n"); - ncplane_genocide(top->p); + ncplane_destroy_family(top->p); top->p = NULL; top->cbp = NULL; top = top->next; @@ -427,7 +427,7 @@ trim_reel_overhang(ncreel* r, nctablet* top, nctablet* bottom){ }else if(y < miny){ int ynew = ylen - (miny - y); if(ynew <= 0){ - ncplane_genocide(top->p); + ncplane_destroy_family(top->p); top->p = NULL; top->cbp = NULL; }else{ @@ -436,7 +436,7 @@ trim_reel_overhang(ncreel* r, nctablet* top, nctablet* bottom){ } if(top->cbp){ if(ynew == !(r->ropts.tabletmask & NCBOXMASK_TOP)){ - ncplane_genocide(top->cbp); + ncplane_destroy_family(top->cbp); top->cbp = NULL; }else{ ncplane_dim_yx(top->cbp, &ylen, &xlen); @@ -458,7 +458,7 @@ trim_reel_overhang(ncreel* r, nctablet* top, nctablet* bottom){ //fprintf(stderr, "bot: %dx%d @ %d, maxy: %d\n", ylen, xlen, y, maxy); if(maxy < y){ //fprintf(stderr, "NUKING bottom!\n"); - ncplane_genocide(bottom->p); + ncplane_destroy_family(bottom->p); bottom->p = NULL; bottom->cbp = NULL; bottom = bottom->prev; @@ -466,7 +466,7 @@ trim_reel_overhang(ncreel* r, nctablet* top, nctablet* bottom){ }if(maxy < boty){ int ynew = ylen - (boty - maxy); if(ynew <= 0){ - ncplane_genocide(bottom->p); + ncplane_destroy_family(bottom->p); bottom->p = NULL; bottom->cbp = NULL; }else{ @@ -476,7 +476,7 @@ trim_reel_overhang(ncreel* r, nctablet* top, nctablet* bottom){ //fprintf(stderr, "TRIMMED bottom %p from %d to %d (%d)\n", bottom->p, ylen, ynew, maxy - boty); if(bottom->cbp){ if(ynew == !(r->ropts.tabletmask & NCBOXMASK_BOTTOM)){ - ncplane_genocide(bottom->cbp); + ncplane_destroy_family(bottom->cbp); bottom->cbp = NULL; }else{ ncplane_dim_yx(bottom->cbp, &ylen, &xlen); @@ -596,18 +596,18 @@ clean_reel(ncreel* r){ if(vft){ for(nctablet* n = vft->next ; n->p && n != vft ; n = n->next){ //fprintf(stderr, "CLEANING NEXT: %p (%p)\n", n, n->p); - ncplane_genocide(n->p); + ncplane_destroy_family(n->p); n->p = NULL; n->cbp = NULL; } for(nctablet* n = vft->prev ; n->p && n != vft ; n = n->prev){ //fprintf(stderr, "CLEANING PREV: %p (%p)\n", n, n->p); - ncplane_genocide(n->p); + ncplane_destroy_family(n->p); n->p = NULL; n->cbp = NULL; } //fprintf(stderr, "CLEANING VFT: %p (%p)\n", vft, vft->p); - ncplane_genocide(vft->p); + ncplane_destroy_family(vft->p); vft->p = NULL; vft->cbp = NULL; r->vft = NULL; @@ -840,7 +840,7 @@ int ncreel_del(ncreel* nr, struct nctablet* t){ } t->next->prev = t->prev; if(t->p){ - ncplane_genocide(t->p); + ncplane_destroy_family(t->p); } free(t); --nr->tabletcount; diff --git a/src/lib/tabbed.c b/src/lib/tabbed.c index 369539bb5..b3545654e 100644 --- a/src/lib/tabbed.c +++ b/src/lib/tabbed.c @@ -166,7 +166,7 @@ nctabbed* nctabbed_create(ncplane* n, const nctabbed_options* topts){ nopts.rows = nrows - 1; if((nt->p = ncplane_create(n, &nopts)) == NULL){ logerror("Couldn't create the tab content plane"); - ncplane_genocide(n); + ncplane_destroy_family(n); free(nt); return NULL; } @@ -174,7 +174,7 @@ nctabbed* nctabbed_create(ncplane* n, const nctabbed_options* topts){ nopts.rows = 1; if((nt->hp = ncplane_create(n, &nopts)) == NULL){ logerror("Couldn't create the tab headers plane"); - ncplane_genocide(n); + ncplane_destroy_family(n); free(nt); return NULL; } @@ -184,7 +184,7 @@ nctabbed* nctabbed_create(ncplane* n, const nctabbed_options* topts){ nopts.rows = 1; if((nt->hp = ncplane_create(n, &nopts)) == NULL){ logerror("Couldn't create the tab headers plane"); - ncplane_genocide(n); + ncplane_destroy_family(n); free(nt); return NULL; } @@ -192,7 +192,7 @@ nctabbed* nctabbed_create(ncplane* n, const nctabbed_options* topts){ nopts.rows = nrows - 1; if((nt->p = ncplane_create(n, &nopts)) == NULL){ logerror("Couldn't create the tab content plane"); - ncplane_genocide(n); + ncplane_destroy_family(n); free(nt); return NULL; } @@ -398,7 +398,7 @@ void nctabbed_destroy(nctabbed* nt){ free(t); t = tmp; } - ncplane_genocide(nt->ncp); + ncplane_destroy_family(nt->ncp); free(nt->opts.separator); free(nt); }