From b6e5b60374f1ba2eee138fc0569f817cf5dcc09b Mon Sep 17 00:00:00 2001 From: nick black Date: Mon, 23 Nov 2020 20:31:39 -0500 Subject: [PATCH] ncpile_create() not NCPLANE_OPTION_NEWPILE #1078 --- NEWS.md | 9 ++++----- USAGE.md | 1 + doc/man/man3/notcurses_plane.3.md | 6 ++++-- include/ncpp/Plane.hh | 3 --- include/notcurses/notcurses.h | 13 ++++++------- src/lib/direct.cpp | 1 - src/lib/notcurses.c | 27 +++++++++------------------ src/lib/visual.cpp | 1 - src/poc/reel.cpp | 1 - src/view/view.cpp | 2 +- tests/blit.cpp | 2 -- tests/cell.cpp | 5 ----- tests/fills.cpp | 9 --------- tests/geom.cpp | 2 -- tests/layout.cpp | 22 ---------------------- tests/ncplane.cpp | 27 +++++++++++++-------------- tests/notcurses.cpp | 1 - tests/reader.cpp | 1 - tests/reel.cpp | 1 - tests/resize.cpp | 4 ++-- tests/rotate.cpp | 5 ----- tests/scrolling.cpp | 14 +++++++------- tests/selector.cpp | 18 +++++++++--------- tests/wide.cpp | 7 ------- tests/zaxis.cpp | 12 ++++++------ 25 files changed, 62 insertions(+), 132 deletions(-) diff --git a/NEWS.md b/NEWS.md index 4b66a2684..f36e2c64b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -10,11 +10,10 @@ rearrangements of Notcurses. or more `ncplane`s, with a bindtree and a z-axis. Different piles can be mutated or rendered concurrently. There is no new user-visible type: a `struct notcurses` can be treated as a single pile. - * To create a new pile, pass a `NULL` `n` argument to `ncplane_create()`. - The returned plane will be the top, bottom, and root of a new plane. - Alternatively, use `ncplane_reparent()` or `ncplane_reparent_family()` - with a `NULL` destination. - + * To create a new pile from a new plane, use the new function + `ncpile_create()`. The returned plane will be the top, bottom, and root + of a new plane. Alternatively, use `ncplane_reparent()` or + `ncplane_reparent_family()` with the source equal to the destination. * 2.0.7 (2020-11-21) * The `horiz` union of `ncplane_options` has been discarded; the `int x` diff --git a/USAGE.md b/USAGE.md index 0ed44dcc6..4263cf713 100644 --- a/USAGE.md +++ b/USAGE.md @@ -631,6 +631,7 @@ In addition to its framebuffer--a rectilinear matrix of cells * a configured user curry (a `void*`), * its position relative to the visible plane, * its z-index, and +* an optional resize callback, * a name (used only for debugging). If opaque, a `cell` on a higher `ncplane` completely obstructs a corresponding diff --git a/doc/man/man3/notcurses_plane.3.md b/doc/man/man3/notcurses_plane.3.md index 8e1c1cff2..0696bffcf 100644 --- a/doc/man/man3/notcurses_plane.3.md +++ b/doc/man/man3/notcurses_plane.3.md @@ -27,6 +27,8 @@ typedef struct ncplane_options { **struct ncplane* ncplane_create(struct ncplane* ***n***, const ncplane_options* ***nopts***);** +**struct ncplane* ncpile_create(struct notcurses* ***n***, const ncplane_options* ***nopts***);** + **struct ncplane* notcurses_top(struct notcurses* ***n***);** **struct ncplane* notcurses_bottom(struct notcurses* ***n***);** @@ -255,8 +257,8 @@ bound to themselves). Multiple threads can concurrently operate on distinct piles, even changing one while rendering another. Each plane is part of one and only one pile. By default, a plane is part of the -same pile containing that plane to which it is bound. If the **n** argument -provided to **ncplane_create** is **NULL**, the returned plane becomes the root +same pile containing that plane to which it is bound. If **ncpile_create** is +used in the place of **ncplane_create**, the returned plane becomes the root plane, top, and bottom of a new pile. As a root plane, it is bound to itself. A new pile can also be created by reparenting a plane to itself, though if the plane is already a root plane, this is a no-op. diff --git a/include/ncpp/Plane.hh b/include/ncpp/Plane.hh index 25fac6a7d..b46d2aea5 100644 --- a/include/ncpp/Plane.hh +++ b/include/ncpp/Plane.hh @@ -78,7 +78,6 @@ namespace ncpp .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; plane = ncplane_create ( notcurses_stdplane(get_notcurses ()), @@ -1204,7 +1203,6 @@ namespace ncpp .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; ncplane *ret = ncplane_create ( n.plane, @@ -1230,7 +1228,6 @@ namespace ncpp nullptr, nullptr, 0, - nullptr, }; ncplane *ret = ncplane_create ( n.plane, diff --git a/include/notcurses/notcurses.h b/include/notcurses/notcurses.h index dded3b6f0..faa271b5b 100644 --- a/include/notcurses/notcurses.h +++ b/include/notcurses/notcurses.h @@ -1026,11 +1026,6 @@ API char* notcurses_at_yx(struct notcurses* nc, int yoff, int xoff, // Horizontal alignment relative to the parent plane. Use 'align' instead of 'x'. #define NCPLANE_OPTION_HORALIGNED 0x0001ull -// Create a new pile with the newly-created plane at its root. The 'n' argument -// ought be NULL, though this is not enforced. When this flag is provided, the -// 'nc' field of the ncplane_options struct must be a valid notcurses context. -#define NCPLANE_OPTION_NEWPILE 0x0002ull - typedef struct ncplane_options { int y; // vertical placement relative to parent plane int x; // horizontal placement relative to parent plane @@ -1040,7 +1035,6 @@ typedef struct ncplane_options { const char* name; // name (used only for debugging), may be NULL int (*resizecb)(struct ncplane*); // callback when parent is resized uint64_t flags; // closure over NCPLANE_OPTION_* - struct notcurses* nc; // only needs to be set with NCPLANE_OPTION_NEWPILE } ncplane_options; // Create a new ncplane bound to plane 'n', at the offset 'y'x'x' (relative to @@ -1050,9 +1044,14 @@ typedef struct ncplane_options { // retrieved (and reset) later. A 'name' can be set, used in debugging. API struct ncplane* ncplane_create(struct ncplane* n, const ncplane_options* nopts); +// Same as ncplane_create(), but creates a new pile. The returned plane will +// be the top, bottom, and root of this new pile. +API struct ncplane* ncpile_create(struct notcurses* nc, const ncplane_options* nopts); + // This function will be removed in 3.0 in favor of ncplane_create(). // It persists in 2.0 only for backwards compatibility. -API struct ncplane* ncplane_new(struct ncplane* n, int rows, int cols, int y, int x, void* opaque, const char* name); +API struct ncplane* ncplane_new(struct ncplane* n, int rows, int cols, int y, int x, void* opaque, const char* name) + __attribute__ ((deprecated)); // Suitable for use as a 'resizecb'. This will realign the plane 'n' against its // parent, using the alignment specified at ncplane_create()-time. diff --git a/src/lib/direct.cpp b/src/lib/direct.cpp index 4194fe825..c4f43c417 100644 --- a/src/lib/direct.cpp +++ b/src/lib/direct.cpp @@ -451,7 +451,6 @@ int ncdirect_render_image(ncdirect* n, const char* file, ncalign_e align, .name = "direct", .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; struct ncplane* faken = ncplane_new_internal(nullptr, nullptr, &nopts); if(faken == nullptr){ diff --git a/src/lib/notcurses.c b/src/lib/notcurses.c index 3f974c9ca..84a433715 100644 --- a/src/lib/notcurses.c +++ b/src/lib/notcurses.c @@ -303,7 +303,7 @@ void free_plane(ncplane* p){ // create a new ncpile. only call with pilelock held. static ncpile* -ncpile_create(notcurses* nc){ +make_ncpile(notcurses* nc){ ncpile* ret = malloc(sizeof(*ret)); if(ret){ ret->nc = nc; @@ -362,7 +362,7 @@ ncplane* ncplane_new_internal(notcurses* nc, ncplane* n, p->blist = NULL; p->name = strdup(nopts->name ? nopts->name : ""); p->align = NCALIGN_UNALIGNED; - if(nopts->flags & NCPLANE_OPTION_NEWPILE){ + if(!n){ // new root/standard plane assert(!(nopts->flags & NCPLANE_OPTION_HORALIGNED)); p->absy = nopts->y; p->absx = nopts->x; @@ -370,7 +370,7 @@ ncplane* ncplane_new_internal(notcurses* nc, ncplane* n, p->bprev = NULL; p->boundto = p; p->align = NCALIGN_UNALIGNED; - }else{ // new root/standard plane + }else{ // bound to preexisting pile if(nopts->flags & NCPLANE_OPTION_HORALIGNED){ p->absx = ncplane_align(n, nopts->x, nopts->cols); p->align = nopts->x; @@ -409,7 +409,7 @@ ncplane* ncplane_new_internal(notcurses* nc, ncplane* n, nc->stats.fbbytes += fbsize; ++nc->stats.planes; }else{ // new pile - p->pile = ncpile_create(nc); + p->pile = make_ncpile(nc); p->pile->top = p; p->pile->bottom = p; p->below = NULL; @@ -432,7 +432,6 @@ create_initial_ncplane(notcurses* nc, int dimy, int dimx){ .rows = dimy - (nc->margin_t + nc->margin_b), .cols = dimx - (nc->margin_l + nc->margin_r), .name = "std", - .flags = NCPLANE_OPTION_NEWPILE, }; return nc->stdplane = ncplane_new_internal(nc, NULL, &nopts); } @@ -445,19 +444,12 @@ const ncplane* notcurses_stdplane_const(const notcurses* nc){ return nc->stdplane; } -// if n is NULL, nopts must supply nc together with NCPLANE_OPTIONS_NEWPILE ncplane* ncplane_create(ncplane* n, const ncplane_options* nopts){ - if(nopts->flags & NCPLANE_OPTION_NEWPILE){ - if(nopts->flags & NCPLANE_OPTION_HORALIGNED){ - logerror(ncplane_notcurses(n), "Can't align a root plane"); - return NULL; - } - }else{ - if(!n){ - return NULL; // can't log, no n nor nc :/ - } - } - return ncplane_new_internal(n ? ncplane_notcurses(n) : nopts->nc, n, nopts); + return ncplane_new_internal(ncplane_notcurses(n), n, nopts); +} + +ncplane* ncpile_create(notcurses* nc, const struct ncplane_options* nopts){ + return ncplane_new_internal(nc, NULL, nopts); } struct ncplane* ncplane_new(struct ncplane* n, int rows, int cols, int y, int x, void* opaque, const char* name){ @@ -470,7 +462,6 @@ struct ncplane* ncplane_new(struct ncplane* n, int rows, int cols, int y, int x, .name = name, .resizecb = NULL, .flags = 0, - .nc = NULL, }; return ncplane_create(n, &nopts); } diff --git a/src/lib/visual.cpp b/src/lib/visual.cpp index 53edbd590..edd35fe2e 100644 --- a/src/lib/visual.cpp +++ b/src/lib/visual.cpp @@ -427,7 +427,6 @@ auto ncvisual_render(notcurses* nc, ncvisual* ncv, .name = "vis", .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; if((n = ncplane_create(notcurses_stdplane(nc), &nopts)) == nullptr){ return nullptr; diff --git a/src/poc/reel.cpp b/src/poc/reel.cpp index 814494d52..c314ed543 100644 --- a/src/poc/reel.cpp +++ b/src/poc/reel.cpp @@ -220,7 +220,6 @@ int main(int argc, char** argv){ .name = "reel", .resizecb = resize_reel, .flags = NCPLANE_OPTION_HORALIGNED, - .nc = nullptr, }; n = ncplane_create(nstd, &nopts); if(!n){ diff --git a/src/view/view.cpp b/src/view/view.cpp index 00b0bb5e8..7bbe7a2ef 100644 --- a/src/view/view.cpp +++ b/src/view/view.cpp @@ -89,7 +89,7 @@ auto perframe(struct ncvisual* ncv, struct ncvisual_options* vopts, .x = 0, .rows = 1, .cols = dimx, - nullptr, "subt", nullptr, 0, nullptr, + nullptr, "subt", nullptr, 0, }; marsh->subtitle_plane = ncplane_create(notcurses_stdplane(nc), &nopts); uint64_t channels = 0; diff --git a/tests/blit.cpp b/tests/blit.cpp index 5c7e4c255..e40d358a8 100644 --- a/tests/blit.cpp +++ b/tests/blit.cpp @@ -26,7 +26,6 @@ TEST_CASE("Blitting") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto ncp = ncplane_create(n_, &nopts); REQUIRE(nullptr != ncp); @@ -75,7 +74,6 @@ TEST_CASE("Blitting") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto ncp = ncplane_create(n_, &nopts); REQUIRE(nullptr != ncp); diff --git a/tests/cell.cpp b/tests/cell.cpp index 39bd7dfec..733b57e82 100644 --- a/tests/cell.cpp +++ b/tests/cell.cpp @@ -161,7 +161,6 @@ TEST_CASE("Cell") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto np = ncplane_create(n_, &nopts); REQUIRE(nullptr != np); @@ -201,7 +200,6 @@ TEST_CASE("Cell") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto np = ncplane_create(n_, &nopts); REQUIRE(nullptr != np); @@ -241,7 +239,6 @@ TEST_CASE("Cell") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto np = ncplane_create(n_, &nopts); REQUIRE(nullptr != np); @@ -281,7 +278,6 @@ TEST_CASE("Cell") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto np = ncplane_create(n_, &nopts); REQUIRE(nullptr != np); @@ -322,7 +318,6 @@ TEST_CASE("Cell") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto np = ncplane_create(n_, &nopts); REQUIRE(nullptr != np); diff --git a/tests/fills.cpp b/tests/fills.cpp index cb3eb1502..aa7e8ccfa 100644 --- a/tests/fills.cpp +++ b/tests/fills.cpp @@ -43,7 +43,6 @@ TEST_CASE("Fills") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; struct ncplane* pfn = ncplane_create(n_, &nopts); REQUIRE(nullptr != pfn); @@ -76,7 +75,6 @@ TEST_CASE("Fills") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; struct ncplane* pfn = ncplane_create(n_, &nopts); REQUIRE(nullptr != pfn); @@ -96,7 +94,6 @@ TEST_CASE("Fills") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; struct ncplane* pfn = ncplane_create(n_, &nopts); REQUIRE(nullptr != pfn); @@ -368,7 +365,6 @@ TEST_CASE("Fills") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; struct ncplane* p1 = ncplane_create(n_, &nopts); REQUIRE(p1); @@ -413,7 +409,6 @@ TEST_CASE("Fills") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto p1 = ncplane_create(n_, &nopts); REQUIRE(p1); @@ -468,7 +463,6 @@ TEST_CASE("Fills") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; struct ncplane* p1 = ncplane_create(n_, &nopts); REQUIRE(p1); @@ -487,7 +481,6 @@ TEST_CASE("Fills") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto p2 = ncplane_create(n_, &n2opts); REQUIRE(p2); @@ -529,7 +522,6 @@ TEST_CASE("Fills") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; struct ncplane* p1 = ncplane_create(n_, &nopts); REQUIRE(p1); @@ -548,7 +540,6 @@ TEST_CASE("Fills") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto p2 = ncplane_create(n_, &n2opts); REQUIRE(p2); diff --git a/tests/geom.cpp b/tests/geom.cpp index 5883bd50d..b88bac8fd 100644 --- a/tests/geom.cpp +++ b/tests/geom.cpp @@ -33,7 +33,6 @@ TEST_CASE("Geometry") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto n = ncplane_create(n_, &nopts); REQUIRE(n); @@ -80,7 +79,6 @@ TEST_CASE("Geometry") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto n = ncplane_create(n_, &nopts); REQUIRE(n); diff --git a/tests/layout.cpp b/tests/layout.cpp index 60d20cbc0..11f2ed15d 100644 --- a/tests/layout.cpp +++ b/tests/layout.cpp @@ -21,7 +21,6 @@ TEST_CASE("TextLayout") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto sp = ncplane_create(n_, &nopts); REQUIRE(sp); @@ -46,7 +45,6 @@ TEST_CASE("TextLayout") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto sp = ncplane_create(n_, &nopts); REQUIRE(sp); @@ -71,7 +69,6 @@ TEST_CASE("TextLayout") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto sp = ncplane_create(n_, &nopts); REQUIRE(sp); @@ -97,7 +94,6 @@ TEST_CASE("TextLayout") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto sp = ncplane_create(n_, &nopts); REQUIRE(sp); @@ -124,7 +120,6 @@ TEST_CASE("TextLayout") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto sp = ncplane_create(n_, &nopts); REQUIRE(sp); @@ -151,7 +146,6 @@ TEST_CASE("TextLayout") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto sp = ncplane_create(n_, &nopts); REQUIRE(sp); @@ -178,7 +172,6 @@ TEST_CASE("TextLayout") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto sp = ncplane_create(n_, &nopts); REQUIRE(sp); @@ -206,7 +199,6 @@ TEST_CASE("TextLayout") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto sp = ncplane_create(n_, &nopts); REQUIRE(sp); @@ -235,7 +227,6 @@ TEST_CASE("TextLayout") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto sp = ncplane_create(n_, &nopts); REQUIRE(sp); @@ -264,7 +255,6 @@ TEST_CASE("TextLayout") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto sp = ncplane_create(n_, &nopts); REQUIRE(sp); @@ -291,7 +281,6 @@ TEST_CASE("TextLayout") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto sp = ncplane_create(n_, &nopts); REQUIRE(sp); @@ -318,7 +307,6 @@ TEST_CASE("TextLayout") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto sp = ncplane_create(n_, &nopts); REQUIRE(sp); @@ -345,7 +333,6 @@ TEST_CASE("TextLayout") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto sp = ncplane_create(n_, &nopts); REQUIRE(sp); @@ -372,7 +359,6 @@ TEST_CASE("TextLayout") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto sp = ncplane_create(n_, &nopts); REQUIRE(sp); @@ -399,7 +385,6 @@ TEST_CASE("TextLayout") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto sp = ncplane_create(n_, &nopts); REQUIRE(sp); @@ -426,7 +411,6 @@ TEST_CASE("TextLayout") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto sp = ncplane_create(n_, &nopts); REQUIRE(sp); @@ -454,7 +438,6 @@ TEST_CASE("TextLayout") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto sp = ncplane_create(n_, &nopts); REQUIRE(sp); @@ -483,7 +466,6 @@ TEST_CASE("TextLayout") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto sp = ncplane_create(n_, &nopts); REQUIRE(sp); @@ -510,7 +492,6 @@ TEST_CASE("TextLayout") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto sp = ncplane_create(n_, &nopts); REQUIRE(sp); @@ -545,7 +526,6 @@ TEST_CASE("TextLayout") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto sp = ncplane_create(n_, &nopts); REQUIRE(sp); @@ -580,7 +560,6 @@ TEST_CASE("TextLayout") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto sp = ncplane_create(n_, &nopts); REQUIRE(sp); @@ -618,7 +597,6 @@ TEST_CASE("TextLayout") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto sp = ncplane_create(n_, &nopts); REQUIRE(sp); diff --git a/tests/ncplane.cpp b/tests/ncplane.cpp index 7d640d2ce..e2452a6a9 100644 --- a/tests/ncplane.cpp +++ b/tests/ncplane.cpp @@ -379,7 +379,7 @@ TEST_CASE("NCPlane") { .rows = y, .cols = x, .userptr = sentinel, - nullptr, nullptr, 0, nullptr, + nullptr, nullptr, 0, }; struct ncplane* ncp = ncplane_create(n_, &nopts); REQUIRE(ncp); @@ -402,7 +402,7 @@ TEST_CASE("NCPlane") { .x = 0, .rows = y, .cols = x, - nullptr, nullptr, nullptr, 0, nullptr, + nullptr, nullptr, nullptr, 0, }; struct ncplane* ncp = ncplane_create(n_, &nopts); REQUIRE(ncp); @@ -427,10 +427,9 @@ TEST_CASE("NCPlane") { .x = 0, .rows = y, .cols = x, - nullptr, nullptr, nullptr, - NCPLANE_OPTION_NEWPILE, nc_, + nullptr, nullptr, nullptr, 0, }; - struct ncplane* ncp = ncplane_create(nullptr, &nopts); + struct ncplane* ncp = ncpile_create(nc_, &nopts); REQUIRE(ncp); int px, py; ncplane_dim_yx(ncp, &py, &px); @@ -459,7 +458,7 @@ TEST_CASE("NCPlane") { .x = x, .rows = maxy, .cols = maxx, - nullptr, nullptr, nullptr, 0, nullptr, + nullptr, nullptr, nullptr, 0, }; struct ncplane* newp = ncplane_create(n_, &nopts); REQUIRE(newp); @@ -505,7 +504,7 @@ TEST_CASE("NCPlane") { .x = x, .rows = maxy, .cols = maxx, - nullptr, nullptr, nullptr, 0, nullptr, + nullptr, nullptr, nullptr, 0, }; struct ncplane* newp = ncplane_create(n_, &nopts); REQUIRE(newp); @@ -747,7 +746,7 @@ TEST_CASE("NCPlane") { .x = ncols - 3, .rows = 2, .cols = 2, - nullptr, nullptr, nullptr, 0, nullptr, + nullptr, nullptr, nullptr, 0, }; struct ncplane* ncp = ncplane_create(n_, &nopts); REQUIRE(ncp); @@ -769,7 +768,7 @@ TEST_CASE("NCPlane") { .x = x, .rows = 2, .cols = 2, - nullptr, nullptr, nullptr, 0, nullptr, + nullptr, nullptr, nullptr, 0, }; struct ncplane* ncp = ncplane_create(n_, &nopts); REQUIRE(ncp); @@ -823,7 +822,7 @@ TEST_CASE("NCPlane") { .x = 1, .rows = 2, .cols = 2, - nullptr, nullptr, nullptr, 0, nullptr, + nullptr, nullptr, nullptr, 0, }; struct ncplane* n = ncplane_create(n_, &nopts); REQUIRE(n); @@ -852,7 +851,7 @@ TEST_CASE("NCPlane") { .x = 1, .rows = 2, .cols = 2, - nullptr, nullptr, nullptr, 0, nullptr, + nullptr, nullptr, nullptr, 0, }; struct ncplane* ndom = ncplane_create(n_, &nopts); REQUIRE(ndom); @@ -875,7 +874,7 @@ TEST_CASE("NCPlane") { .x = 1, .rows = 2, .cols = 2, - nullptr, nullptr, nullptr, 0, nullptr, + nullptr, nullptr, nullptr, 0, }; struct ncplane* ndom = ncplane_create(n_, &nopts); REQUIRE(ndom); @@ -898,7 +897,7 @@ TEST_CASE("NCPlane") { .x = 1, .rows = 2, .cols = 2, - nullptr, nullptr, nullptr, 0, nullptr, + nullptr, nullptr, nullptr, 0, }; struct ncplane* ndom = ncplane_create(n_, &nopts); REQUIRE(ndom); @@ -925,7 +924,7 @@ TEST_CASE("NCPlane") { .x = 1, .rows = 2, .cols = 2, - nullptr, nullptr, nullptr, 0, nullptr, + nullptr, nullptr, nullptr, 0, }; struct ncplane* ndom = ncplane_create(n_, &nopts); REQUIRE(ndom); diff --git a/tests/notcurses.cpp b/tests/notcurses.cpp index 72b4c344e..b99e9bf0e 100644 --- a/tests/notcurses.cpp +++ b/tests/notcurses.cpp @@ -80,7 +80,6 @@ TEST_CASE("NotcursesBase") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; planes[idx] = ncplane_create(notcurses_stdplane(nc_), &nopts); REQUIRE(planes[idx]); diff --git a/tests/reader.cpp b/tests/reader.cpp index 7c56101ae..25d620a1a 100644 --- a/tests/reader.cpp +++ b/tests/reader.cpp @@ -23,7 +23,6 @@ TEST_CASE("Readers") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto ncp = ncplane_create(notcurses_stdplane(nc_), &nopts); uint64_t echannels = CHANNELS_RGB_INITIALIZER(0xff, 0x44, 0xff, 0, 0, 0); diff --git a/tests/reel.cpp b/tests/reel.cpp index bfa8deab4..24ae26941 100644 --- a/tests/reel.cpp +++ b/tests/reel.cpp @@ -299,7 +299,6 @@ TEST_CASE("Reels") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto ncp = ncplane_create(n_, &nopts); REQUIRE(nullptr != ncp); diff --git a/tests/resize.cpp b/tests/resize.cpp index 23036e37a..3f436b676 100644 --- a/tests/resize.cpp +++ b/tests/resize.cpp @@ -28,7 +28,7 @@ TEST_CASE("Resize") { .x = 0, .rows = y, .cols = x, - nullptr, nullptr, nullptr, 0, nullptr, + nullptr, nullptr, nullptr, 0, }; struct ncplane* testn = ncplane_create(n_, &nopts); REQUIRE(nullptr != testn); @@ -52,7 +52,7 @@ TEST_CASE("Resize") { .x = 0, .rows = y, .cols = x, - nullptr, nullptr, nullptr, 0, nullptr, + nullptr, nullptr, nullptr, 0, }; struct ncplane* testn = ncplane_create(n_, &nopts); REQUIRE(nullptr != testn); diff --git a/tests/rotate.cpp b/tests/rotate.cpp index 3399b6db5..098aed5bb 100644 --- a/tests/rotate.cpp +++ b/tests/rotate.cpp @@ -59,7 +59,6 @@ TEST_CASE("Rotate") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; struct ncplane* testn = ncplane_create(n_, &nopts); uint64_t channels = 0; @@ -94,7 +93,6 @@ TEST_CASE("Rotate") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; struct ncplane* testn = ncplane_create(n_, &nopts); REQUIRE(0 < ncplane_gradient_sized(testn, " ", 0, ul, ur, ll, lr, 8, 16)); @@ -113,7 +111,6 @@ TEST_CASE("Rotate") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; struct ncplane* testn = ncplane_create(n_, &nopts); REQUIRE(0 < ncplane_gradient_sized(testn, " ", 0, ul, ur, ll, lr, 8, 32)); @@ -132,7 +129,6 @@ TEST_CASE("Rotate") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; struct ncplane* testn = ncplane_create(n_, &nopts); REQUIRE(0 < ncplane_gradient_sized(testn, " ", 0, ul, ur, ll, lr, 8, 16)); @@ -151,7 +147,6 @@ TEST_CASE("Rotate") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; struct ncplane* testn = ncplane_create(n_, &nopts); REQUIRE(0 < ncplane_gradient_sized(testn, " ", 0, ul, ur, ll, lr, 8, 32)); diff --git a/tests/scrolling.cpp b/tests/scrolling.cpp index 7c36509f0..182b49eba 100644 --- a/tests/scrolling.cpp +++ b/tests/scrolling.cpp @@ -24,7 +24,7 @@ TEST_CASE("Scrolling") { .x = 1, .rows = 2, .cols = 20, - nullptr, nullptr, nullptr, 0, nullptr, + nullptr, nullptr, nullptr, 0, }; struct ncplane* n = ncplane_create(n_, &nopts); REQUIRE(n); @@ -53,7 +53,7 @@ TEST_CASE("Scrolling") { .x = 1, .rows = 2, .cols = 20, - nullptr, nullptr, nullptr, 0, nullptr, + nullptr, nullptr, nullptr, 0, }; struct ncplane* n = ncplane_create(n_, &nopts); REQUIRE(n); @@ -74,7 +74,7 @@ TEST_CASE("Scrolling") { .x = 1, .rows = 2, .cols = 20, - nullptr, nullptr, nullptr, 0, nullptr, + nullptr, nullptr, nullptr, 0, }; struct ncplane* n = ncplane_create(n_, &nopts); REQUIRE(n); @@ -101,7 +101,7 @@ TEST_CASE("Scrolling") { .x = 1, .rows = 2, .cols = 20, - nullptr, nullptr, nullptr, 0, nullptr, + nullptr, nullptr, nullptr, 0, }; struct ncplane* n = ncplane_create(n_, &nopts); REQUIRE(n); @@ -140,7 +140,7 @@ TEST_CASE("Scrolling") { .x = 1, .rows = 4, .cols = 20, - nullptr, nullptr, nullptr, 0, nullptr, + nullptr, nullptr, nullptr, 0, }; struct ncplane* n = ncplane_create(n_, &nopts); REQUIRE(n); @@ -164,7 +164,7 @@ TEST_CASE("Scrolling") { .x = 1, .rows = 2, .cols = 20, - nullptr, nullptr, nullptr, 0, nullptr, + nullptr, nullptr, nullptr, 0, }; struct ncplane* n = ncplane_create(n_, &nopts); REQUIRE(n); @@ -224,7 +224,7 @@ TEST_CASE("Scrolling") { .x = 1, .rows = 2, .cols = 20, - nullptr, nullptr, nullptr, 0, nullptr, + nullptr, nullptr, nullptr, 0, }; struct ncplane* n = ncplane_create(n_, &nopts); REQUIRE(n); diff --git a/tests/selector.cpp b/tests/selector.cpp index e89104c19..325082cc5 100644 --- a/tests/selector.cpp +++ b/tests/selector.cpp @@ -18,7 +18,7 @@ TEST_CASE("Selectors") { .x = 0, .rows = 1, .cols = 1, - nullptr, nullptr, nullptr, 0, nullptr, + nullptr, nullptr, nullptr, 0, }; struct ncplane* n = ncplane_create(n_, &nopts); struct ncselector* ncs = ncselector_create(n, &opts); @@ -42,7 +42,7 @@ TEST_CASE("Selectors") { .x = 0, .rows = 1, .cols = 1, - nullptr, nullptr, nullptr, 0, nullptr, + nullptr, nullptr, nullptr, 0, }; struct ncplane* n = ncplane_create(n_, &nopts); struct ncselector* ncs = ncselector_create(n, &opts); @@ -65,7 +65,7 @@ TEST_CASE("Selectors") { .x = 0, .rows = 1, .cols = 1, - nullptr, nullptr, nullptr, 0, nullptr, + nullptr, nullptr, nullptr, 0, }; struct ncplane* n = ncplane_create(n_, &nopts); struct ncselector* ncs = ncselector_create(n, &opts); @@ -88,7 +88,7 @@ TEST_CASE("Selectors") { .x = 0, .rows = 1, .cols = 1, - nullptr, nullptr, nullptr, 0, nullptr, + nullptr, nullptr, nullptr, 0, }; struct ncplane* n = ncplane_create(n_, &nopts); struct ncselector* ncs = ncselector_create(n, &opts); @@ -117,7 +117,7 @@ TEST_CASE("Selectors") { .x = 0, .rows = 1, .cols = 1, - nullptr, nullptr, nullptr, 0, nullptr, + nullptr, nullptr, nullptr, 0, }; struct ncplane* n = ncplane_create(n_, &nopts); struct ncselector* ncs = ncselector_create(n, &opts); @@ -139,7 +139,7 @@ TEST_CASE("Selectors") { .x = 0, .rows = 1, .cols = 1, - nullptr, nullptr, nullptr, 0, nullptr, + nullptr, nullptr, nullptr, 0, }; struct ncplane* n = ncplane_create(n_, &nopts); struct ncselector* ncs = ncselector_create(n, &opts); @@ -170,7 +170,7 @@ TEST_CASE("Selectors") { .x = 0, .rows = 1, .cols = 1, - nullptr, nullptr, nullptr, 0, nullptr, + nullptr, nullptr, nullptr, 0, }; struct ncplane* n = ncplane_create(n_, &nopts); struct ncselector* ncs = ncselector_create(n, &opts); @@ -216,7 +216,7 @@ TEST_CASE("Selectors") { .x = 0, .rows = 1, .cols = 1, - nullptr, nullptr, nullptr, 0, nullptr, + nullptr, nullptr, nullptr, 0, }; struct ncplane* n = ncplane_create(n_, &nopts); struct ncselector* ncs = ncselector_create(n, &opts); @@ -267,7 +267,7 @@ TEST_CASE("Selectors") { .x = 0, .rows = 1, .cols = 1, - nullptr, nullptr, nullptr, 0, nullptr, + nullptr, nullptr, nullptr, 0, }; struct ncplane* n = ncplane_create(n_, &nopts); struct ncselector* ncs = ncselector_create(n, &opts); diff --git a/tests/wide.cpp b/tests/wide.cpp index 8aad1b81d..6d99e3567 100644 --- a/tests/wide.cpp +++ b/tests/wide.cpp @@ -231,7 +231,6 @@ TEST_CASE("Wide") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; struct ncplane* ncp = ncplane_create(n_, &nopts); REQUIRE(ncp); @@ -356,7 +355,6 @@ TEST_CASE("Wide") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; struct ncplane* n = ncplane_create(n_, &nopts); REQUIRE(n); @@ -404,7 +402,6 @@ TEST_CASE("Wide") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; struct ncplane* p = ncplane_create(n_, &nopts); REQUIRE(nullptr != p); @@ -454,7 +451,6 @@ TEST_CASE("Wide") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; struct ncplane* topp = ncplane_create(n_, &nopts); REQUIRE(nullptr != topp); @@ -639,7 +635,6 @@ TEST_CASE("Wide") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; struct ncplane* topp = ncplane_create(n_, &nopts); REQUIRE(nullptr != topp); @@ -795,7 +790,6 @@ TEST_CASE("Wide") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; struct ncplane* topp = ncplane_create(n_, &nopts); REQUIRE(nullptr != topp); @@ -990,7 +984,6 @@ TEST_CASE("Wide") { .name = nullptr, .resizecb = nullptr, .flags = 0, - .nc = nullptr, }; auto high = ncplane_create(n_, &nopts); REQUIRE(nullptr != high); diff --git a/tests/zaxis.cpp b/tests/zaxis.cpp index 160daccf8..b1fc15a7e 100644 --- a/tests/zaxis.cpp +++ b/tests/zaxis.cpp @@ -31,7 +31,7 @@ TEST_CASE("ZAxis") { .x = 0, .rows = 2, .cols = 2, - nullptr, nullptr, nullptr, 0, nullptr, + nullptr, nullptr, nullptr, 0, }; struct ncplane* np = ncplane_create(n_, &nopts); REQUIRE(np); @@ -48,7 +48,7 @@ TEST_CASE("ZAxis") { .x = 0, .rows = 2, .cols = 2, - nullptr, nullptr, nullptr, 0, nullptr, + nullptr, nullptr, nullptr, 0, }; struct ncplane* np = ncplane_create(n_, &nopts); REQUIRE(np); @@ -65,7 +65,7 @@ TEST_CASE("ZAxis") { .x = 0, .rows = 2, .cols = 2, - nullptr, nullptr, nullptr, 0, nullptr, + nullptr, nullptr, nullptr, 0, }; struct ncplane* np = ncplane_create(n_, &nopts); REQUIRE(np); @@ -88,7 +88,7 @@ TEST_CASE("ZAxis") { .x = 0, .rows = 2, .cols = 2, - nullptr, nullptr, nullptr, 0, nullptr, + nullptr, nullptr, nullptr, 0, }; struct ncplane* np = ncplane_create(n_, &nopts); REQUIRE(np); @@ -120,7 +120,7 @@ TEST_CASE("ZAxis") { .x = 0, .rows = 2, .cols = 2, - nullptr, nullptr, nullptr, 0, nullptr, + nullptr, nullptr, nullptr, 0, }; struct ncplane* n2 = ncplane_create(n_, &nopts); REQUIRE(1 == cell_load(n2, &c, "y")); @@ -151,7 +151,7 @@ TEST_CASE("ZAxis") { .x = 1, .rows = 1, .cols = 1, - nullptr, nullptr, nullptr, 0, nullptr, + nullptr, nullptr, nullptr, 0, }; auto p = ncplane_create(n_, &nopts); REQUIRE(nullptr != p);