change type of the bx_list_c::choice var to Bit32u to make in compatible with ask_uint function

This commit is contained in:
Stanislav Shwartsman 2012-01-21 20:54:55 +00:00
parent 2e32bf2d84
commit 795a21ec6d
2 changed files with 2 additions and 3 deletions

View File

@ -441,7 +441,7 @@ protected:
// for a menu, the value of choice before the call to "ask" is default.
// After ask, choice holds the value that the user chose. Choice defaults
// to 1 in the constructor.
int choice;
Bit32u choice; // type Bit32u is compatible with ask_uint
// title of the menu or series
char *title;
void init(const char *list_title);

View File

@ -999,10 +999,9 @@ int bx_list_c::text_ask(FILE *fpin, FILE *fpout)
}
}
fprintf(fpout, "\n");
Bit32u n = (Bit32u) choice;
int min = (options & SHOW_PARENT) ? 0 : 1;
int max = size;
int status = ask_uint("Please choose one: [%d] ", "", min, max, n, &n, 10);
int status = ask_uint("Please choose one: [%d] ", "", min, max, choice, &choice, 10);
if (status < 0) return status;
}
return 0;