nvramcui: Cast u8 * values to char * to eliminate warnings

error: pointer targets of 'strcmp' differ in signedness
expected 'const char *' but argument is of type
'u8 * {aka unsigned char *}'

Change-Id: Id5cbb6fc2efd7c57abc59b08416047e10461436f
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://review.coreboot.org/14521
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
Martin Roth 2016-04-26 12:33:44 -06:00
parent 06a0b567ce
commit 0cf7acc688
1 changed files with 8 additions and 8 deletions

View File

@ -78,8 +78,8 @@ int main()
struct cb_cmos_entries *option = first_cmos_entry(opttbl);
while (option) {
if ((option->config != 'r') &&
(strcmp("check_sum", option->name) != 0)) {
maxlength = max(maxlength, strlen(option->name));
(strcmp("check_sum", (char *)option->name) != 0)) {
maxlength = max(maxlength, strlen((char *)option->name));
numopts++;
}
option = next_cmos_entry(option);
@ -95,19 +95,19 @@ int main()
option = first_cmos_entry(opttbl);
for (i = 0; i < numopts; i++) {
while ((option->config == 'r') ||
(strcmp("check_sum", option->name) == 0)) {
(strcmp("check_sum", (char *)option->name) == 0)) {
option = next_cmos_entry(option);
}
fields[2 * i] =
new_field(1, strlen(option->name), i * 2, 1, 0, 0);
set_field_buffer(fields[2 * i], 0, option->name);
new_field(1, strlen((char *)option->name), i * 2, 1, 0, 0);
set_field_buffer(fields[2 * i], 0, (char *)option->name);
field_opts_off(fields[2 * i], O_ACTIVE);
fields[2 * i + 1] =
new_field(1, 40, i * 2, maxlength + 2, 0, 0);
char *buf = NULL;
int fail =
get_option_as_string(use_nvram, opttbl, &buf, option->name);
get_option_as_string(use_nvram, opttbl, &buf, (char *)option->name);
switch (option->config) {
case 'h': {
set_field_type(fields[2 * i + 1], TYPE_INTEGER, 0, 0,
@ -127,7 +127,7 @@ int main()
/* if invalid data in CMOS, set buf to first enum */
if (fail && cmos_enum) {
buf = cmos_enum->text;
buf = (char *)cmos_enum->text;
}
while (cmos_enum) {
@ -142,7 +142,7 @@ int main()
cmos_enum =
first_cmos_enum_of_id(opttbl, option->config_id);
while (cmos_enum) {
values[cnt] = cmos_enum->text;
values[cnt] = (char *)cmos_enum->text;
cnt++;
cmos_enum = next_cmos_enum_of_id(
cmos_enum, option->config_id);