mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-21 18:03:41 +03:00
boot: Remove unused memmem_safe
This commit is contained in:
parent
f7bc0fb35b
commit
986fd3ebc2
@ -505,20 +505,6 @@ EFI_STATUS log_oom(void) {
|
|||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *memmem_safe(const void *haystack, UINTN haystack_len, const void *needle, UINTN needle_len) {
|
|
||||||
assert(haystack || haystack_len == 0);
|
|
||||||
assert(needle || needle_len == 0);
|
|
||||||
|
|
||||||
if (needle_len == 0)
|
|
||||||
return (void*)haystack;
|
|
||||||
|
|
||||||
for (const CHAR8 *h = haystack, *n = needle; haystack_len >= needle_len; h++, haystack_len--)
|
|
||||||
if (*h == *n && CompareMem(h + 1, n + 1, needle_len - 1) == 0)
|
|
||||||
return (void*)h;
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void print_at(UINTN x, UINTN y, UINTN attr, const CHAR16 *str) {
|
void print_at(UINTN x, UINTN y, UINTN attr, const CHAR16 *str) {
|
||||||
assert(str);
|
assert(str);
|
||||||
ST->ConOut->SetCursorPosition(ST->ConOut, x, y);
|
ST->ConOut->SetCursorPosition(ST->ConOut, x, y);
|
||||||
|
@ -111,13 +111,6 @@ EFI_STATUS log_oom(void);
|
|||||||
err; \
|
err; \
|
||||||
})
|
})
|
||||||
|
|
||||||
void *memmem_safe(const void *haystack, UINTN haystack_len, const void *needle, UINTN needle_len);
|
|
||||||
|
|
||||||
static inline void *mempmem_safe(const void *haystack, UINTN haystack_len, const void *needle, UINTN needle_len) {
|
|
||||||
CHAR8 *p = memmem_safe(haystack, haystack_len, needle, needle_len);
|
|
||||||
return p ? p + needle_len : NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void print_at(UINTN x, UINTN y, UINTN attr, const CHAR16 *str);
|
void print_at(UINTN x, UINTN y, UINTN attr, const CHAR16 *str);
|
||||||
void clear_screen(UINTN attr);
|
void clear_screen(UINTN attr);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user