ccmake: Use standard getmaxyx instead of non-standard getmax[xy]

Swap out getmax[xy]() calls for single call to getmaxyx(), to support
strict X/Open conformant curses implementations, e.g. HP-UX Xcurses.
This commit is contained in:
Ådne Hovda 2014-11-18 10:04:30 +01:00 committed by Brad King
parent ee3d06a41e
commit 44f02b42fb
3 changed files with 2 additions and 22 deletions

View File

@ -33,12 +33,6 @@
#include "mf_common.h" #include "mf_common.h"
#include "form.h" #include "form.h"
/* get around odd bug on aCC and itanium */
#if defined(__hpux)
#define getmaxx __getmaxx
#define getmaxy __getmaxy
#endif
/* form status values */ /* form status values */
#define _OVLMODE (0x04) /* Form is in overlay mode */ #define _OVLMODE (0x04) /* Form is in overlay mode */
#define _WINDOW_MODIFIED (0x10) /* Current field window has been modified */ #define _WINDOW_MODIFIED (0x10) /* Current field window has been modified */

View File

@ -357,12 +357,7 @@ static void Buffer_To_Window(const FIELD * field, WINDOW * win)
assert(win && field); assert(win && field);
#if defined(__LSB_VERSION__)
getmaxyx(win, height, width); getmaxyx(win, height, width);
#else
width = getmaxx(win);
height = getmaxy(win);
#endif
for(row=0, pBuffer=field->buf; for(row=0, pBuffer=field->buf;
row < height; row < height;
@ -394,17 +389,13 @@ static void Window_To_Buffer(WINDOW * win, FIELD * field)
int pad; int pad;
int len = 0; int len = 0;
char *p; char *p;
int row, height; int row, height, width;
assert(win && field && field->buf ); assert(win && field && field->buf );
pad = field->pad; pad = field->pad;
p = field->buf; p = field->buf;
#if defined(__LSB_VERSION__) getmaxyx(win, height, width);
{ int width; getmaxyx(win, height, width); }
#else
height = getmaxy(win);
#endif
for(row=0; (row < height) && (row < field->drows); row++ ) for(row=0; (row < height) && (row < field->drows); row++ )
{ {

View File

@ -63,12 +63,7 @@ int post_form(FORM * form)
RETURN(E_NOT_CONNECTED); RETURN(E_NOT_CONNECTED);
formwin = Get_Form_Window(form); formwin = Get_Form_Window(form);
#if defined(__LSB_VERSION__)
getmaxyx(formwin, height, width); getmaxyx(formwin, height, width);
#else
width = getmaxx(formwin);
height = getmaxy(formwin);
#endif
if ((form->cols > width) || (form->rows > height)) if ((form->cols > width) || (form->rows > height))
RETURN(E_NO_ROOM); RETURN(E_NO_ROOM);