diff --git a/curses.h b/curses.h index 54f3e9e7..10ffe884 100644 --- a/curses.h +++ b/curses.h @@ -1220,7 +1220,7 @@ PDCEX int draino(int); PDCEX int resetterm(void); PDCEX int fixterm(void); PDCEX int saveterm(void); -PDCEX int setsyx(int, int); +PDCEX void setsyx(int, int); PDCEX int mouse_set(unsigned long); PDCEX int mouse_on(unsigned long); diff --git a/pdcurses/getyx.c b/pdcurses/getyx.c index 3ea8c941..804f7e8e 100644 --- a/pdcurses/getyx.c +++ b/pdcurses/getyx.c @@ -15,7 +15,7 @@ getyx void getmaxyx(WINDOW *win, int y, int x); void getsyx(int y, int x); - int setsyx(int y, int x); + void setsyx(int y, int x); int getbegy(WINDOW *win); int getbegx(WINDOW *win); @@ -43,7 +43,7 @@ getyx values should only be used with setsyx(). setsyx() sets the virtual screen cursor to the y, x coordinates. - If y, x are -1, -1, leaveok() is set TRUE. + If either y or x is -1, leaveok() is set TRUE, else it's set FALSE. getsyx() and setsyx() are meant to be used by a library routine that manipulates curses windows without altering the position of @@ -128,23 +128,12 @@ int getmaxx(WINDOW *win) return win ? win->_maxx : ERR; } -int setsyx(int y, int x) +void setsyx(int y, int x) { PDC_LOG(("setsyx() - called\n")); - if (y == -1 && x == -1) - { - curscr->_leaveit = TRUE; - return OK; - } - else if (y == -1 || x == -1) - { - return OK; - } - else - { - curscr->_leaveit = FALSE; + curscr->_leaveit = y == -1 || x == -1; + + if (!curscr->_leaveit) wmove(curscr, y, x); - return OK; - } }