summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2015-04-13 19:55:25 -0400
committerPeter Jones <pjones@redhat.com>2015-04-13 19:55:25 -0400
commit1f23ecc3000b14c02cbaf47a819ed89ac93ec12e (patch)
treeeb2616cc6b941d7d2688554d88e2fbe7e0447c13
parent0ea5b3e3b7a905aac7668029348d895509de20e6 (diff)
downloadefi-boot-shim-1f23ecc3000b14c02cbaf47a819ed89ac93ec12e.tar.gz
efi-boot-shim-1f23ecc3000b14c02cbaf47a819ed89ac93ec12e.zip
Make lib/ build right with the cflags it should be using...
... but isn't. Signed-off-by: Peter Jones <pjones@redhat.com>
-rw-r--r--include/console.h9
-rw-r--r--include/guid.h5
-rw-r--r--lib/configtable.c4
-rw-r--r--lib/console.c23
-rw-r--r--lib/execute.c2
-rw-r--r--lib/guid.c25
-rw-r--r--lib/shell.c2
7 files changed, 23 insertions, 47 deletions
diff --git a/include/console.h b/include/console.h
index 9c793ea5..ecaa73f5 100644
--- a/include/console.h
+++ b/include/console.h
@@ -4,13 +4,16 @@
EFI_STATUS
console_get_keystroke(EFI_INPUT_KEY *key);
void
-console_print_box_at(CHAR16 *str_arr[], int highlight, int start_col, int start_row, int size_cols, int size_rows, int offset, int lines);
+console_print_box_at(CHAR16 *str_arr[], unsigned int highlight,
+ unsigned int start_col, unsigned int start_row,
+ unsigned int size_cols, unsigned int size_rows,
+ int offset, unsigned int lines);
void
-console_print_box(CHAR16 *str_arr[], int highlight);
+console_print_box(CHAR16 *str_arr[], unsigned int highlight);
int
console_yes_no(CHAR16 *str_arr[]);
int
-console_select(CHAR16 *title[], CHAR16* selectors[], int start);
+console_select(CHAR16 *title[], CHAR16* selectors[], unsigned int start);
void
console_errorbox(CHAR16 *err);
void
diff --git a/include/guid.h b/include/guid.h
index 3c58be0b..86b709b8 100644
--- a/include/guid.h
+++ b/include/guid.h
@@ -1,10 +1,5 @@
#include <efi.h>
-#ifndef BUILD_EFI
-const char *guid_to_str(EFI_GUID *guid);
-void str_to_guid(const char *str, EFI_GUID *guid);
-#endif
-
extern EFI_GUID GV_GUID;
extern EFI_GUID SIG_DB;
extern EFI_GUID X509_GUID;
diff --git a/lib/configtable.c b/lib/configtable.c
index e2d92bf0..edf2ed74 100644
--- a/lib/configtable.c
+++ b/lib/configtable.c
@@ -14,7 +14,7 @@
void *
configtable_get_table(EFI_GUID *guid)
{
- int i;
+ unsigned int i;
for (i = 0; i < ST->NumberOfTableEntries; i++) {
EFI_CONFIGURATION_TABLE *CT = &ST->ConfigurationTable[i];
@@ -82,7 +82,7 @@ configtable_find_image(const EFI_DEVICE_PATH *DevicePath)
}
EFI_DEVICE_PATH *dp = (EFI_DEVICE_PATH *)(e->Data + skip), *dpn = dp;
if (dp->Type == 0 || dp->Type > 6 || dp->SubType == 0
- || (((dp->Length[1] << 8) + dp->Length[0]) > e->InfoSize)) {
+ || ((unsigned)((dp->Length[1] << 8) + dp->Length[0]) > e->InfoSize)) {
/* Parse error, table corrupt, bail */
Print(L"Image Execution Information table corrupt\n");
break;
diff --git a/lib/console.c b/lib/console.c
index fd8cc5c8..e70ab485 100644
--- a/lib/console.c
+++ b/lib/console.c
@@ -33,7 +33,7 @@ count_lines(CHAR16 *str_arr[])
static void
SetMem16(CHAR16 *dst, UINT32 n, CHAR16 c)
{
- int i;
+ unsigned int i;
for (i = 0; i < n/2; i++) {
dst[i] = c;
@@ -55,9 +55,12 @@ console_get_keystroke(EFI_INPUT_KEY *key)
}
void
-console_print_box_at(CHAR16 *str_arr[], int highlight, int start_col, int start_row, int size_cols, int size_rows, int offset, int lines)
+console_print_box_at(CHAR16 *str_arr[], unsigned int highlight,
+ unsigned int start_col, unsigned int start_row,
+ unsigned int size_cols, unsigned int size_rows,
+ int offset, unsigned int lines)
{
- int i;
+ unsigned int i;
SIMPLE_TEXT_OUTPUT_INTERFACE *co = ST->ConOut;
UINTN rows, cols;
CHAR16 *Line;
@@ -124,7 +127,7 @@ console_print_box_at(CHAR16 *str_arr[], int highlight, int start_col, int start_
for (i = start_row + 1; i < size_rows + start_row - 1; i++) {
- int line = i - start;
+ unsigned int line = i - start;
SetMem16 (Line, size_cols*2, L' ');
Line[0] = BOXDRAW_VERTICAL;
@@ -160,7 +163,7 @@ console_print_box_at(CHAR16 *str_arr[], int highlight, int start_col, int start_
}
void
-console_print_box(CHAR16 *str_arr[], int highlight)
+console_print_box(CHAR16 *str_arr[], unsigned int highlight)
{
SIMPLE_TEXT_OUTPUT_MODE SavedConsoleMode;
SIMPLE_TEXT_OUTPUT_INTERFACE *co = ST->ConOut;
@@ -181,17 +184,17 @@ console_print_box(CHAR16 *str_arr[], int highlight)
}
int
-console_select(CHAR16 *title[], CHAR16* selectors[], int start)
+console_select(CHAR16 *title[], CHAR16* selectors[], unsigned int start)
{
SIMPLE_TEXT_OUTPUT_MODE SavedConsoleMode;
SIMPLE_TEXT_OUTPUT_INTERFACE *co = ST->ConOut;
EFI_INPUT_KEY k;
EFI_STATUS status;
- int selector;
- int selector_lines = count_lines(selectors);
+ unsigned int selector;
+ unsigned int selector_lines = count_lines(selectors);
int selector_max_cols = 0;
- int i, offs_col, offs_row, size_cols, size_rows, lines;
- int selector_offset;
+ unsigned int i, offs_col, offs_row, size_cols, size_rows, lines;
+ unsigned int selector_offset;
UINTN cols, rows;
uefi_call_wrapper(co->QueryMode, 4, co, co->Mode->Mode, &cols, &rows);
diff --git a/lib/execute.c b/lib/execute.c
index 42d71c87..89328c68 100644
--- a/lib/execute.c
+++ b/lib/execute.c
@@ -51,7 +51,7 @@ generate_path(CHAR16* name, EFI_LOADED_IMAGE *li, EFI_DEVICE_PATH **path, CHAR16
EFI_STATUS efi_status = EFI_SUCCESS;
CHAR16 *devpathstr = DevicePathToStr(li->FilePath),
*found = NULL;
- int i;
+ unsigned int i;
for (i = 0; i < StrLen(devpathstr); i++) {
if (devpathstr[i] == '/')
diff --git a/lib/guid.c b/lib/guid.c
index c97a7ca8..5f5a03ff 100644
--- a/lib/guid.c
+++ b/lib/guid.c
@@ -6,31 +6,6 @@
#include <guid.h>
-#ifndef BUILD_EFI
-/* EFI has %g for this, so it's only needed in platform c */
-const char *guid_to_str(EFI_GUID *guid)
-{
- static char str[256];
-
- sprintf(str, "%08x-%04hx-%04hx-%02hhx%02hhx-%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx",
- guid->Data1, guid->Data2, guid->Data3,
- guid->Data4[0], guid->Data4[1], guid->Data4[2],
- guid->Data4[3], guid->Data4[4], guid->Data4[5],
- guid->Data4[6], guid->Data4[7]);
-
- return str;
-}
-
-void str_to_guid(const char *str, EFI_GUID *guid)
-{
- sscanf(str, "%8x-%4hx-%4hx-%2hhx%2hhx-%2hhx%2hhx%2hhx%2hhx%2hhx%2hhx",
- &guid->Data1, &guid->Data2, &guid->Data3,
- guid->Data4, guid->Data4 + 1, guid->Data4 + 2,
- guid->Data4 + 3, guid->Data4 + 4, guid->Data4 + 5,
- guid->Data4 + 6, guid->Data4 + 7);
-}
-#endif
-
/* all the necessary guids */
EFI_GUID GV_GUID = EFI_GLOBAL_VARIABLE;
EFI_GUID SIG_DB = { 0xd719b2cb, 0x3d3a, 0x4596, {0xa3, 0xbc, 0xda, 0xd0, 0xe, 0x67, 0x65, 0x6f }};
diff --git a/lib/shell.c b/lib/shell.c
index 7337834a..afd3952c 100644
--- a/lib/shell.c
+++ b/lib/shell.c
@@ -13,7 +13,7 @@
EFI_STATUS
argsplit(EFI_HANDLE image, int *argc, CHAR16*** ARGV)
{
- int i, count = 1;
+ unsigned int i, count = 1;
EFI_STATUS status;
EFI_LOADED_IMAGE *info;
CHAR16 *start;