Add exit call to silence compiler warnings.
This commit is contained in:
parent
8913822c2c
commit
d5ce9bff72
|
@ -5,6 +5,7 @@
|
||||||
#include "efi/efi.h"
|
#include "efi/efi.h"
|
||||||
|
|
||||||
#define EOF -4
|
#define EOF -4
|
||||||
|
#define EXIT_FAILURE 1
|
||||||
#define TRUE 1
|
#define TRUE 1
|
||||||
#define FALSE 0
|
#define FALSE 0
|
||||||
#define max_string 4096
|
#define max_string 4096
|
||||||
|
@ -25,6 +26,7 @@ int Base_Address;
|
||||||
int ip;
|
int ip;
|
||||||
char* scratch;
|
char* scratch;
|
||||||
struct efi_boot_table *boot;
|
struct efi_boot_table *boot;
|
||||||
|
efi_handle_t efi_image_handle;
|
||||||
struct efi_simple_text_output_protocol *stdout;
|
struct efi_simple_text_output_protocol *stdout;
|
||||||
char c;
|
char c;
|
||||||
|
|
||||||
|
@ -40,6 +42,12 @@ char fgetc(FILE* fin)
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__attribute__((noreturn)) void exit(efi_status_t exit_code)
|
||||||
|
{
|
||||||
|
boot->exit(efi_image_handle, exit_code, 0);
|
||||||
|
__builtin_unreachable();
|
||||||
|
}
|
||||||
|
|
||||||
void* memset(void* ptr, int value, int num)
|
void* memset(void* ptr, int value, int num)
|
||||||
{
|
{
|
||||||
char* s;
|
char* s;
|
||||||
|
@ -171,10 +179,7 @@ unsigned GetTarget(char* c)
|
||||||
return i->target;
|
return i->target;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// fputs("Target label ", stderr);
|
exit(EXIT_FAILURE);
|
||||||
// fputs(c, stderr);
|
|
||||||
// fputs(" is not valid\n", stderr);
|
|
||||||
// exit(EXIT_FAILURE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int storeLabel(FILE* source_file, int ip)
|
int storeLabel(FILE* source_file, int ip)
|
||||||
|
@ -216,7 +221,7 @@ void Update_Pointer(char ch)
|
||||||
if(in_set(ch, "%&")) ip = ip + 4; /* Deal with % and & */
|
if(in_set(ch, "%&")) ip = ip + 4; /* Deal with % and & */
|
||||||
else if(in_set(ch, "@$")) ip = ip + 2; /* Deal with @ and $ */
|
else if(in_set(ch, "@$")) ip = ip + 2; /* Deal with @ and $ */
|
||||||
else if('!' == ch) ip = ip + 1; /* Deal with ! */
|
else if('!' == ch) ip = ip + 1; /* Deal with ! */
|
||||||
// else exit(EXIT_FAILURE);
|
else exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void storePointer(char ch, FILE* source_file)
|
void storePointer(char ch, FILE* source_file)
|
||||||
|
@ -238,14 +243,9 @@ void storePointer(char ch, FILE* source_file)
|
||||||
Clear_Scratch(scratch);
|
Clear_Scratch(scratch);
|
||||||
consume_token (source_file);
|
consume_token (source_file);
|
||||||
base = GetTarget (scratch);
|
base = GetTarget (scratch);
|
||||||
|
}
|
||||||
|
|
||||||
/* Force universality of behavior */
|
displacement = target - base;
|
||||||
displacement = (target - base);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
displacement = target - base;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* output calculated difference */
|
/* output calculated difference */
|
||||||
if('!' == ch) outputPointer(displacement, 1); /* Deal with ! */
|
if('!' == ch) outputPointer(displacement, 1); /* Deal with ! */
|
||||||
|
@ -253,7 +253,7 @@ void storePointer(char ch, FILE* source_file)
|
||||||
else if('@' == ch) outputPointer(displacement, 2); /* Deal with @ */
|
else if('@' == ch) outputPointer(displacement, 2); /* Deal with @ */
|
||||||
else if('&' == ch) outputPointer(target, 4); /* Deal with & */
|
else if('&' == ch) outputPointer(target, 4); /* Deal with & */
|
||||||
else if('%' == ch) outputPointer(displacement, 4); /* Deal with % */
|
else if('%' == ch) outputPointer(displacement, 4); /* Deal with % */
|
||||||
// else exit(EXIT_FAILURE);
|
else exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void line_Comment(FILE* source_file)
|
void line_Comment(FILE* source_file)
|
||||||
|
@ -349,6 +349,7 @@ efi_status_t efi_main(efi_handle_t image_handle, struct efi_system_table *system
|
||||||
struct efi_guid guid1 = EFI_LOADED_IMAGE_PROTOCOL_GUID;
|
struct efi_guid guid1 = EFI_LOADED_IMAGE_PROTOCOL_GUID;
|
||||||
struct efi_guid guid2 = EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID;
|
struct efi_guid guid2 = EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID;
|
||||||
boot = system->boot;
|
boot = system->boot;
|
||||||
|
efi_image_handle = image_handle;
|
||||||
stdout = system->out;
|
stdout = system->out;
|
||||||
|
|
||||||
/* Open Loaded Image protocol */
|
/* Open Loaded Image protocol */
|
||||||
|
|
Loading…
Reference in New Issue