diff options
Diffstat (limited to 'src/hci')
-rw-r--r-- | src/hci/tui/menu_ui.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/hci/tui/menu_ui.c b/src/hci/tui/menu_ui.c index 98f0f0ae..d5645b32 100644 --- a/src/hci/tui/menu_ui.c +++ b/src/hci/tui/menu_ui.c @@ -40,19 +40,19 @@ FILE_LICENCE ( GPL2_OR_LATER ); #define CPAIR_SEPARATOR 3 /* Screen layout */ -#define TITLE_ROW 1 -#define MENU_ROW 3 -#define MENU_COL 1 -#define MENU_ROWS 18 -#define MENU_COLS 78 -#define MENU_PAD 2 +#define TITLE_ROW 1U +#define MENU_ROW 3U +#define MENU_COL 1U +#define MENU_ROWS ( LINES - 2U - MENU_ROW ) +#define MENU_COLS ( COLS - 2U ) +#define MENU_PAD 2U /** A menu user interface */ struct menu_ui { /** Menu */ struct menu *menu; /** Number of menu items */ - int count; + unsigned int count; /** Currently selected item */ int selected; /** First visible item */ @@ -269,7 +269,7 @@ static int menu_loop ( struct menu_ui *ui, struct menu_item **selected ) { if ( ui->selected < 0 ) { ui->selected = 0; move = +1; - } else if ( ui->selected >= ui->count ) { + } else if ( ui->selected >= ( int ) ui->count ) { ui->selected = ( ui->count - 1 ); move = -1; } |