- revert r19825. Fix this in the kernel instead and read README.buildroot2

This commit is contained in:
Bernhard Reutner-Fischer 2007-09-12 07:05:52 +00:00
parent 0c1a521ce5
commit 9952cfa5c4
4 changed files with 20 additions and 20 deletions

View File

@ -44,7 +44,7 @@ static void strip(char *str)
while ((isspace(*p))) while ((isspace(*p)))
p++; p++;
l = strlen((char *)p); l = strlen(p);
if (p != str) if (p != str)
memmove(str, p, l + 1); memmove(str, p, l + 1);
if (!l) if (!l)
@ -101,7 +101,7 @@ static void conf_askvalue(struct symbol *sym, const char *def)
check_stdin(); check_stdin();
case ask_all: case ask_all:
fflush(stdout); fflush(stdout);
fgets((char *)line, 128, stdin); fgets(line, 128, stdin);
return; return;
case set_default: case set_default:
printf("%s\n", def); printf("%s\n", def);
@ -194,8 +194,8 @@ int conf_string(struct menu *menu)
break; break;
} }
default: default:
line[strlen((char *)line)-1] = 0; line[strlen(line)-1] = 0;
def = (char *)line; def = line;
} }
if (def && sym_set_string_value(sym, def)) if (def && sym_set_string_value(sym, def))
return 0; return 0;
@ -243,7 +243,7 @@ static int conf_sym(struct menu *menu)
case 'n': case 'n':
case 'N': case 'N':
newval = no; newval = no;
if (!line[1] || !strcmp((char *)&line[1], "o")) if (!line[1] || !strcmp(&line[1], "o"))
break; break;
continue; continue;
case 'm': case 'm':
@ -255,7 +255,7 @@ static int conf_sym(struct menu *menu)
case 'y': case 'y':
case 'Y': case 'Y':
newval = yes; newval = yes;
if (!line[1] || !strcmp((char *)&line[1], "es")) if (!line[1] || !strcmp(&line[1], "es"))
break; break;
continue; continue;
case 0: case 0:
@ -356,7 +356,7 @@ static int conf_choice(struct menu *menu)
check_stdin(); check_stdin();
case ask_all: case ask_all:
fflush(stdout); fflush(stdout);
fgets((char *)line, 128, stdin); fgets(line, 128, stdin);
strip(line); strip(line);
if (line[0] == '?') { if (line[0] == '?') {
printf("\n%s\n", menu->sym->help ? printf("\n%s\n", menu->sym->help ?
@ -366,7 +366,7 @@ static int conf_choice(struct menu *menu)
if (!line[0]) if (!line[0])
cnt = def; cnt = def;
else if (isdigit(line[0])) else if (isdigit(line[0]))
cnt = atoi((char *)line); cnt = atoi(line);
else else
continue; continue;
break; break;
@ -390,7 +390,7 @@ static int conf_choice(struct menu *menu)
} }
if (!child) if (!child)
continue; continue;
if (line[strlen((char *)line) - 1] == '?') { if (line[strlen(line) - 1] == '?') {
printf("\n%s\n", child->sym->help ? printf("\n%s\n", child->sym->help ?
child->sym->help : nohelp_text); child->sym->help : nohelp_text);
continue; continue;

View File

@ -51,8 +51,8 @@ static char *conf_expand_value(const char *in)
res_value[0] = 0; res_value[0] = 0;
dst = name; dst = name;
while ((src = (signed char *) strchr((const char *)in, '$'))) { while ((src = strchr(in, '$'))) {
strncat(res_value, (char *)in, src - in); strncat(res_value, in, src - in);
src++; src++;
dst = name; dst = name;
while (isalnum(*src) || *src == '_') while (isalnum(*src) || *src == '_')
@ -63,7 +63,7 @@ static char *conf_expand_value(const char *in)
strcat(res_value, sym_get_string_value(sym)); strcat(res_value, sym_get_string_value(sym));
in = src; in = src;
} }
strcat(res_value, (const char *)in); strcat(res_value, in);
return res_value; return res_value;
} }
@ -74,7 +74,7 @@ char *conf_get_default_confname(void)
static char fullname[PATH_MAX+1]; static char fullname[PATH_MAX+1];
char *env, *name; char *env, *name;
name = conf_expand_value((const signed char *)conf_defname); name = conf_expand_value(conf_defname);
env = getenv(SRCTREE); env = getenv(SRCTREE);
if (env) { if (env) {
sprintf(fullname, "%s/%s", env, name); sprintf(fullname, "%s/%s", env, name);

View File

@ -52,7 +52,7 @@ int dialog_inputbox(const char *title, const char *prompt, int height, int width
if (!init) if (!init)
instr[0] = '\0'; instr[0] = '\0';
else else
strcpy((char *)instr, init); strcpy(instr, init);
do_resize: do_resize:
if (getmaxy(stdscr) <= (height - 2)) if (getmaxy(stdscr) <= (height - 2))
@ -105,7 +105,7 @@ do_resize:
for (i = 0; i < box_width - 1; i++) for (i = 0; i < box_width - 1; i++)
waddch(dialog, instr[scroll + i]); waddch(dialog, instr[scroll + i]);
} else { } else {
waddstr(dialog, (char *)instr); waddstr(dialog, instr);
} }
wmove(dialog, box_y, box_x + input_x); wmove(dialog, box_y, box_x + input_x);
@ -136,7 +136,7 @@ do_resize:
waddch(dialog, waddch(dialog,
instr[scroll + input_x + i] ? instr[scroll + input_x + i] ?
instr[scroll + input_x + i] : ' '); instr[scroll + input_x + i] : ' ');
input_x = strlen((char *)instr) - scroll; input_x = strlen(instr) - scroll;
} else } else
input_x--; input_x--;
instr[scroll + input_x] = '\0'; instr[scroll + input_x] = '\0';

View File

@ -413,7 +413,7 @@ again:
return; return;
} }
sym_arr = sym_re_search((char *)dialog_input_result); sym_arr = sym_re_search(dialog_input_result);
res = get_relations_str(sym_arr); res = get_relations_str(sym_arr);
free(sym_arr); free(sym_arr);
show_textbox(_("Search Results"), str_get(&res), 0, 0); show_textbox(_("Search Results"), str_get(&res), 0, 0);
@ -789,7 +789,7 @@ static void conf_string(struct menu *menu)
sym_get_string_value(menu->sym)); sym_get_string_value(menu->sym));
switch (res) { switch (res) {
case 0: case 0:
if (sym_set_string_value(menu->sym, (char *)dialog_input_result)) if (sym_set_string_value(menu->sym, dialog_input_result))
return; return;
show_textbox(NULL, _("You have made an invalid entry."), 5, 43); show_textbox(NULL, _("You have made an invalid entry."), 5, 43);
break; break;
@ -814,7 +814,7 @@ static void conf_load(void)
case 0: case 0:
if (!dialog_input_result[0]) if (!dialog_input_result[0])
return; return;
if (!conf_read((char *)dialog_input_result)) if (!conf_read(dialog_input_result))
return; return;
show_textbox(NULL, _("File does not exist!"), 5, 38); show_textbox(NULL, _("File does not exist!"), 5, 38);
break; break;
@ -838,7 +838,7 @@ static void conf_save(void)
case 0: case 0:
if (!dialog_input_result[0]) if (!dialog_input_result[0])
return; return;
if (!conf_write((char *)dialog_input_result)) if (!conf_write(dialog_input_result))
return; return;
show_textbox(NULL, _("Can't create file! Probably a nonexistent directory."), 5, 60); show_textbox(NULL, _("Can't create file! Probably a nonexistent directory."), 5, 60);
break; break;