From 876c5a91a1534849c93239a538f017810f8a77e0 Mon Sep 17 00:00:00 2001 From: nick black Date: Fri, 11 Dec 2020 19:44:40 -0500 Subject: [PATCH] notcurses: remove unused truecols field --- src/demo/hud.c | 2 +- src/lib/internal.h | 3 --- src/lib/notcurses.c | 1 - src/lib/render.c | 1 - 4 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/demo/hud.c b/src/demo/hud.c index 2efbb3b15..39ab1eda7 100644 --- a/src/demo/hud.c +++ b/src/demo/hud.c @@ -618,7 +618,7 @@ int fpsgraph_init(struct notcurses* nc){ .y = dimy - PLOTHEIGHT, .x = NCALIGN_CENTER, .rows = PLOTHEIGHT, - .cols = dimx, + .cols = dimx > 80 ? 80 : dimx, .userptr = NULL, .name = "fps", .resizecb = ncplane_resize_realign, diff --git a/src/lib/internal.h b/src/lib/internal.h index d16421592..bca664525 100644 --- a/src/lib/internal.h +++ b/src/lib/internal.h @@ -331,9 +331,6 @@ typedef struct notcurses { ncstats stats; // some statistics across the lifetime of the notcurses ctx ncstats stashstats; // cumulative stats, unaffected by notcurses_stats_reset() - int truecols; // true number of columns in the physical rendering area. - // used only to see if output motion takes us to the next - // line thanks to terminal action alone. FILE* ttyfp; // FILE* for writing rasterized data int ttyfd; // file descriptor for controlling tty ncinputlayer input; // input layer; we're in cbreak mode diff --git a/src/lib/notcurses.c b/src/lib/notcurses.c index f2427a291..97e6bf60f 100644 --- a/src/lib/notcurses.c +++ b/src/lib/notcurses.c @@ -1093,7 +1093,6 @@ notcurses* notcurses_init(const notcurses_options* opts, FILE* outfp){ shortname_term ? shortname_term : "?", longname_term ? longname_term : "?"); } - ret->truecols = dimx; if(interrogate_terminfo(&ret->tcache)){ goto err; } diff --git a/src/lib/render.c b/src/lib/render.c index 8692462c4..6ba9e6ab7 100644 --- a/src/lib/render.c +++ b/src/lib/render.c @@ -26,7 +26,6 @@ notcurses_resize_internal(ncplane* pp, int* restrict rows, int* restrict cols){ if(update_term_dimensions(n->ttyfd, rows, cols)){ return -1; } - n->truecols = *cols; *rows -= n->margin_t + n->margin_b; if(*rows <= 0){ *rows = 1;