From d662bd334d3c72acc1147efd0daa5e3ef51f98cb Mon Sep 17 00:00:00 2001 From: nick black Date: Mon, 23 Nov 2020 22:14:49 -0500 Subject: [PATCH] inline ncplane_cell_ref_yx() --- src/lib/internal.h | 7 ++++++- src/lib/notcurses.c | 7 ------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/lib/internal.h b/src/lib/internal.h index c941834be..b4e561a64 100644 --- a/src/lib/internal.h +++ b/src/lib/internal.h @@ -577,7 +577,12 @@ pool_extended_gcluster(const egcpool* pool, const cell* c){ return egcpool_extended_gcluster(pool, c); } -cell* ncplane_cell_ref_yx(ncplane* n, int y, int x); +static inline cell* +ncplane_cell_ref_yx(ncplane* n, int y, int x){ + assert(y < n->leny); + assert(x < n->lenx); + return &n->fb[nfbcellidx(n, y, x)]; +} static inline void cell_set_wide(cell* c){ diff --git a/src/lib/notcurses.c b/src/lib/notcurses.c index 84a433715..7d8f4cbae 100644 --- a/src/lib/notcurses.c +++ b/src/lib/notcurses.c @@ -229,12 +229,6 @@ char* ncplane_at_yx(const ncplane* n, int y, int x, uint16_t* stylemask, uint64_ return ret; } -cell* ncplane_cell_ref_yx(ncplane* n, int y, int x){ - assert(y < n->leny); - assert(x < n->lenx); - return &n->fb[nfbcellidx(n, y, x)]; -} - void ncplane_dim_yx(const ncplane* n, int* rows, int* cols){ if(rows){ *rows = n->leny; @@ -363,7 +357,6 @@ ncplane* ncplane_new_internal(notcurses* nc, ncplane* n, p->name = strdup(nopts->name ? nopts->name : ""); p->align = NCALIGN_UNALIGNED; if(!n){ // new root/standard plane - assert(!(nopts->flags & NCPLANE_OPTION_HORALIGNED)); p->absy = nopts->y; p->absx = nopts->x; p->bnext = NULL;