mirror of
https://git.proxmox.com/git/efi-boot-shim
synced 2025-05-29 21:25:05 +00:00
Use CHAR8 not UINT8 for character work.
This gets rid of a lot of type casting that we don't need, and helps reduce warnings when I switch a bunch of gnu-efi stuff to taking const arguments. Signed-off-by: Peter Jones <pjones@redhat.com>
This commit is contained in:
parent
aed556c4ab
commit
cb89c25aeb
22
netboot.c
22
netboot.c
@ -52,7 +52,7 @@ static inline unsigned short int __swap16(unsigned short int x)
|
||||
|
||||
static EFI_PXE_BASE_CODE *pxe;
|
||||
static EFI_IP_ADDRESS tftp_addr;
|
||||
static UINT8 *full_path;
|
||||
static CHAR8 *full_path;
|
||||
|
||||
|
||||
typedef struct {
|
||||
@ -188,10 +188,10 @@ static CHAR8 *get_v6_bootfile_url(EFI_PXE_BASE_CODE_DHCPV6_PACKET *pkt)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static UINT16 str2ns(UINT8 *str)
|
||||
static CHAR16 str2ns(CHAR8 *str)
|
||||
{
|
||||
UINT16 ret = 0;
|
||||
UINT8 v;
|
||||
CHAR16 ret = 0;
|
||||
CHAR8 v;
|
||||
for(;*str;str++) {
|
||||
if ('0' <= *str && *str <= '9')
|
||||
v = *str - '0';
|
||||
@ -206,18 +206,18 @@ static UINT16 str2ns(UINT8 *str)
|
||||
return htons(ret);
|
||||
}
|
||||
|
||||
static UINT8 *str2ip6(char *str)
|
||||
static CHAR8 *str2ip6(CHAR8 *str)
|
||||
{
|
||||
UINT8 i, j, p;
|
||||
size_t len;
|
||||
UINT8 *a, *b, t;
|
||||
CHAR8 *a, *b, t;
|
||||
static UINT16 ip[8];
|
||||
|
||||
for(i=0; i < 8; i++) {
|
||||
ip[i] = 0;
|
||||
}
|
||||
len = strlen((UINT8 *)str);
|
||||
a = b = (UINT8 *)str;
|
||||
len = strlen(str);
|
||||
a = b = str;
|
||||
for(i=p=0; i < len; i++, b++) {
|
||||
if (*b != ':')
|
||||
continue;
|
||||
@ -228,7 +228,7 @@ static UINT8 *str2ip6(char *str)
|
||||
if ( *(b+1) == ':' )
|
||||
break;
|
||||
}
|
||||
a = b = (UINT8 *)(str + len);
|
||||
a = b = (str + len);
|
||||
for(j=len, p=7; j > i; j--, a--) {
|
||||
if (*a != ':')
|
||||
continue;
|
||||
@ -238,13 +238,13 @@ static UINT8 *str2ip6(char *str)
|
||||
*b = t;
|
||||
b = a;
|
||||
}
|
||||
return (UINT8 *)ip;
|
||||
return (CHAR8 *)ip;
|
||||
}
|
||||
|
||||
static BOOLEAN extract_tftp_info(CHAR8 *url)
|
||||
{
|
||||
CHAR8 *start, *end;
|
||||
char ip6str[40];
|
||||
CHAR8 ip6str[40];
|
||||
CHAR8 *template = (CHAR8 *)translate_slashes(DEFAULT_LOADER_CHAR);
|
||||
|
||||
if (strncmp((UINT8 *)url, (UINT8 *)"tftp://", 7)) {
|
||||
|
Loading…
Reference in New Issue
Block a user