From 546355a871ac102c2bf93ec385b810c99e487576 Mon Sep 17 00:00:00 2001 From: nick black Date: Thu, 9 Dec 2021 14:24:12 -0500 Subject: [PATCH] notcurses_cursor_yx ought be const --- USAGE.md | 2 +- doc/man/man3/notcurses_init.3.md | 2 +- include/notcurses/notcurses.h | 2 +- src/lib/render.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/USAGE.md b/USAGE.md index 9f14ce203..ccddd4223 100644 --- a/USAGE.md +++ b/USAGE.md @@ -300,7 +300,7 @@ int notcurses_refresh(struct notcurses* n, unsigned* restrict y, unsigned* restr int notcurses_cursor_enable(struct notcurses* nc, int y, int x); // Get the current location of the terminal's cursor, whether visible or not. -int notcurses_cursor_yx(struct notcurses* nc, int* y, int* x); +int notcurses_cursor_yx(const struct notcurses* nc, int* y, int* x); // Disable the hardware cursor. It is an error to call this while the // cursor is already disabled. diff --git a/doc/man/man3/notcurses_init.3.md b/doc/man/man3/notcurses_init.3.md index fa3c67631..1d8c6fbb5 100644 --- a/doc/man/man3/notcurses_init.3.md +++ b/doc/man/man3/notcurses_init.3.md @@ -49,7 +49,7 @@ typedef struct notcurses_options { **int notcurses_cursor_enable(struct notcurses* ***nc***, int ***y***, int ***x***);** -**int notcurses_cursor_yx(struct notcurses* ***nc***, int* ***y***, int* ***x***);** +**int notcurses_cursor_yx(const struct notcurses* ***nc***, int* ***y***, int* ***x***);** **int notcurses_cursor_disable(struct notcurses* ***nc***);** diff --git a/include/notcurses/notcurses.h b/include/notcurses/notcurses.h index cf475a856..357518713 100644 --- a/include/notcurses/notcurses.h +++ b/include/notcurses/notcurses.h @@ -3637,7 +3637,7 @@ API int notcurses_cursor_enable(struct notcurses* nc, int y, int x) __attribute__ ((nonnull (1))); // Get the current location of the terminal's cursor, whether visible or not. -API int notcurses_cursor_yx(struct notcurses* nc, int* y, int* x) +API int notcurses_cursor_yx(const struct notcurses* nc, int* y, int* x) __attribute__ ((nonnull (1))); // Disable the hardware cursor. It is an error to call this while the diff --git a/src/lib/render.c b/src/lib/render.c index 1c50c7307..fc40dd117 100644 --- a/src/lib/render.c +++ b/src/lib/render.c @@ -1726,7 +1726,7 @@ int ncdirect_set_fg_rgb(ncdirect* nc, unsigned rgb){ return 0; } -int notcurses_cursor_yx(notcurses* nc, int* y, int* x){ +int notcurses_cursor_yx(const notcurses* nc, int* y, int* x){ *y = nc->rstate.y; *x = nc->rstate.x; return 0;