From ba90c70a479d208341c6ae7a0016c978b45a20b0 Mon Sep 17 00:00:00 2001 From: nick black Date: Sat, 14 Mar 2020 21:15:19 -0400 Subject: [PATCH] ncplane_cursor_yx() takes const first argument --- README.md | 2 +- doc/man/man3/notcurses_ncplane.3.md | 4 +--- doc/man/man3/notcurses_output.3.md | 3 --- include/notcurses/notcurses.h | 2 +- src/lib/notcurses.c | 2 +- 5 files changed, 4 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 1e443d440..bb8ea7ede 100644 --- a/README.md +++ b/README.md @@ -800,7 +800,7 @@ memory. int ncplane_cursor_move_yx(struct ncplane* n, int y, int x); // Get the current position of the cursor within n. y and/or x may be NULL. -void ncplane_cursor_yx(struct ncplane* n, int* restrict y, int* restrict x); +void ncplane_cursor_yx(const struct ncplane* n, int* restrict y, int* restrict x); // Replace the cell at the specified coordinates with the provided cell 'c', // and advance the cursor by the width of the cell (but not past the end of the diff --git a/doc/man/man3/notcurses_ncplane.3.md b/doc/man/man3/notcurses_ncplane.3.md index a98d00674..54586a92c 100644 --- a/doc/man/man3/notcurses_ncplane.3.md +++ b/doc/man/man3/notcurses_ncplane.3.md @@ -52,9 +52,7 @@ notcurses_ncplane - operations on notcurses planes **static inline int ncplane_dim_x(const struct ncplane* n);** -**int ncplane_cursor_move_yx(struct ncplane* n, int y, int x);** - -**void ncplane_cursor_yx(struct ncplane* n, int* restrict y, int* restrict x);** +**void ncplane_cursor_yx(const struct ncplane* n, int* restrict y, int* restrict x);** **void ncplane_translate(const struct ncplane* src, const struct ncplane* dst, int* restrict y, int* restrict x);** diff --git a/doc/man/man3/notcurses_output.3.md b/doc/man/man3/notcurses_output.3.md index 4de78e26d..a954067a9 100644 --- a/doc/man/man3/notcurses_output.3.md +++ b/doc/man/man3/notcurses_output.3.md @@ -79,9 +79,6 @@ ncplane_printf_aligned(struct ncplane* n, int y, ncalign_e align, const char* fo **int ncplane_cursor_move_yx(struct ncplane* n, int y, int x);** -**void ncplane_cursor_yx(const struct ncplane* n, int* restrict y, - int* restrict x);** - # DESCRIPTION These functions write EGCs (Extended Grapheme Clusters) to the specified diff --git a/include/notcurses/notcurses.h b/include/notcurses/notcurses.h index 04f4680c0..42fb110d3 100644 --- a/include/notcurses/notcurses.h +++ b/include/notcurses/notcurses.h @@ -604,7 +604,7 @@ ncplane_align(const struct ncplane* n, ncalign_e align, int c){ API int ncplane_cursor_move_yx(struct ncplane* n, int y, int x); // Get the current position of the cursor within n. y and/or x may be NULL. -API void ncplane_cursor_yx(struct ncplane* n, int* RESTRICT y, int* RESTRICT x); +API void ncplane_cursor_yx(const struct ncplane* n, int* RESTRICT y, int* RESTRICT x); // Replace the cell at the specified coordinates with the provided cell 'c', // and advance the cursor by the width of the cell (but not past the end of the diff --git a/src/lib/notcurses.c b/src/lib/notcurses.c index 6f7ec36db..5aa9bb2b6 100644 --- a/src/lib/notcurses.c +++ b/src/lib/notcurses.c @@ -1311,7 +1311,7 @@ int ncplane_cursor_move_yx(ncplane* n, int y, int x){ return ncplane_cursor_move_yx_locked(n, y, x); } -void ncplane_cursor_yx(ncplane* n, int* y, int* x){ +void ncplane_cursor_yx(const ncplane* n, int* y, int* x){ if(y){ *y = n->y; }