Fix printf format mismatches

Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Ed Maste 2014-04-04 13:35:36 +00:00
parent 5055c92801
commit 7de2785827
3 changed files with 8 additions and 6 deletions

View File

@ -51,8 +51,8 @@ x86_efi_copy_init(void)
status = BS->AllocatePages(AllocateAnyPages, EfiLoaderData,
STAGE_PAGES, &staging);
if (EFI_ERROR(status)) {
printf("failed to allocate staging area: %d\n",
status & EFI_ERROR_MASK);
printf("failed to allocate staging area: %lu\n",
(unsigned long)(status & EFI_ERROR_MASK));
return (status);
}

View File

@ -101,7 +101,7 @@ elf64_exec(struct preloaded_file *fp)
rsdp = efi_get_table(&acpi_guid);
}
if (rsdp != NULL) {
sprintf(buf, "0x%016llx", rsdp);
sprintf(buf, "0x%016llx", (unsigned long long)rsdp);
setenv("hint.acpi.0.rsdp", buf, 1);
revision = rsdp->Revision;
if (revision == 0)
@ -115,7 +115,8 @@ elf64_exec(struct preloaded_file *fp)
setenv("hint.acpi.0.rsdt", buf, 1);
if (revision >= 2) {
/* XXX extended checksum? */
sprintf(buf, "0x%016llx", rsdp->XsdtPhysicalAddress);
sprintf(buf, "0x%016llx",
(unsigned long long)rsdp->XsdtPhysicalAddress);
setenv("hint.acpi.0.xsdt", buf, 1);
sprintf(buf, "%d", rsdp->Length);
setenv("hint.acpi.0.xsdt_length", buf, 1);

View File

@ -304,7 +304,7 @@ command_mode(int argc, char *argv[])
printf("couldn't set mode %d\n", mode);
return (CMD_ERROR);
}
sprintf(rowenv, "%d", rows);
sprintf(rowenv, "%u", (unsigned)rows);
setenv("LINES", rowenv, 1);
return (CMD_OK);
@ -314,7 +314,8 @@ command_mode(int argc, char *argv[])
status = conout->QueryMode(conout, i, &cols, &rows);
if (EFI_ERROR(status))
break;
printf("Mode %d: %d columns, %d rows\n", i, cols, rows);
printf("Mode %d: %u columns, %u rows\n", i, (unsigned)cols,
(unsigned)rows);
}
if (i != 0)