The Gang Genocides Genocide s/_genocide/_destroy_family/g #1907

pull/1923/head
nick black 3 years ago committed by nick black
parent 7641f6b637
commit cf8b640064

@ -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

@ -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;

@ -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;

@ -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);
}

Loading…
Cancel
Save