Changes slightly the code in menu directory so that "conf"

and "mconf" build without issuing warnings
This commit is contained in:
Pierre Labastie 2012-02-10 09:39:11 +00:00
parent d7390a52cf
commit 743414bfa2
5 changed files with 12 additions and 13 deletions

View file

@ -179,7 +179,7 @@ int conf_string(struct menu *menu)
help = nohelp_text;
if (menu->sym->help)
help = menu->sym->help;
printf("\n%s\n", menu->sym->help);
printf("\n%s\n", help);
def = NULL;
break;
}
@ -195,7 +195,6 @@ int conf_string(struct menu *menu)
static int conf_sym(struct menu *menu)
{
struct symbol *sym = menu->sym;
int type;
tristate oldval, newval;
const char *help;
@ -203,7 +202,7 @@ static int conf_sym(struct menu *menu)
printf("%*s%s ", indent - 1, "", menu->prompt->text);
if (sym->name)
printf("(%s) ", sym->name);
type = sym_get_type(sym);
(void)sym_get_type(sym);
putchar('[');
oldval = sym_get_tristate_value(sym);
switch (oldval) {
@ -270,11 +269,10 @@ static int conf_choice(struct menu *menu)
{
struct symbol *sym, *def_sym;
struct menu *child;
int type;
bool is_new;
sym = menu->sym;
type = sym_get_type(sym);
(void)sym_get_type(sym);
is_new = !sym_has_value(sym);
if (sym_is_changable(sym)) {
conf_sym(menu);

View file

@ -3,6 +3,10 @@
#define YY_INT_ALIGNED short int
/* Define this so that no warnings are issued during
compilation of jhalfs */
#define YY_NO_INPUT 1
/* A lexical scanner generated by flex */
#define FLEX_SCANNER

View file

@ -174,7 +174,7 @@ int dialog_menu (const char *title, const char *prompt, int height, int width,
int dialog_checklist (const char *title, const char *prompt, int height,
int width, int list_height, int item_no,
struct dialog_list_item ** items, int flag);
extern unsigned char dialog_input_result[];
extern char dialog_input_result[];
int dialog_inputbox (const char *title, const char *prompt, int height,
int width, const char *init);

View file

@ -21,7 +21,7 @@
#include "dialog.h"
unsigned char dialog_input_result[MAX_LEN + 1];
char dialog_input_result[MAX_LEN + 1];
/*
* Print the termination buttons
@ -48,7 +48,7 @@ dialog_inputbox (const char *title, const char *prompt, int height, int width,
{
int i, x, y, box_y, box_x, box_width;
int input_x = 0, scroll = 0, key = 0, button = -1;
unsigned char *instr = dialog_input_result;
char *instr = dialog_input_result;
WINDOW *dialog;
/* center dialog box on screen */

View file

@ -39,11 +39,8 @@ dialog_textbox (const char *title, const char *file, int height, int width)
{
int i, x, y, cur_x, cur_y, fpos, key = 0;
int passed_end;
char search_term[MAX_LEN + 1];
WINDOW *dialog, *text;
search_term[0] = '\0'; /* no search term entered yet */
/* Open input file for reading */
if ((fd = open (file, O_RDONLY)) == -1) {
endwin ();
@ -459,7 +456,6 @@ print_page (WINDOW * win, int height, int width)
static void
print_line (WINDOW * win, int row, int width)
{
int y, x;
char *line;
line = get_line ();
@ -468,11 +464,12 @@ print_line (WINDOW * win, int row, int width)
waddch (win, ' ');
waddnstr (win, line, MIN (strlen (line), width - 2));
getyx (win, y, x);
/* Clear 'residue' of previous line */
#if OLD_NCURSES
{
int y, x;
int i;
getyx (win, y, x);
for (i = 0; i < width - x; i++)
waddch (win, ' ');
}