Skip to content

Commit b6b47d1

Browse files
committed
workaround -Werror=enum-conversion
1 parent f16a84b commit b6b47d1

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

boot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ int libboot_identify_memory(void *mem, boot_uintn_t sz, bootimg_context_t *conte
337337
return rc;
338338
}
339339

340-
void libboot_internal_register_error(libboot_error_group_t group, libboot_error_type_t type, const char *fmt)
340+
void _libboot_internal_register_error(libboot_error_group_t group, libboot_error_type_t type, const char *fmt)
341341
{
342342
libboot_error_format_t *format = libboot_alloc(sizeof(libboot_error_format_t));
343343
if (!format) return;

include_private/lib/boot/internal/boot_internal.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,15 @@ char *libboot_internal_error_stack_alloc(void);
120120
#define libboot_format_error(group, type, ...) do {\
121121
char* __macro__buf = libboot_internal_error_stack_alloc();\
122122
if(!__macro__buf) break; \
123-
libboot_error_format_t *__macro__format = libboot_internal_get_error_format(group, type); \
123+
libboot_error_format_t *__macro__format = libboot_internal_get_error_format(group, (libboot_error_type_t)type); \
124124
if(__macro__format) libboot_internal_format_errorstring(__macro__buf, 4096, __macro__format->fmt, ##__VA_ARGS__); \
125125
else libboot_internal_format_errorstring(__macro__buf, 4096, "unknown error %"LIBBOOT_FMT_INT" in group %"LIBBOOT_FMT_INT, group, type); \
126126
libboot_internal_error_directprint(__macro__buf); \
127127
} while(0)
128-
void libboot_internal_register_error(libboot_error_group_t group, libboot_error_type_t type, const char *fmt);
128+
129+
void _libboot_internal_register_error(libboot_error_group_t group, libboot_error_type_t type, const char *fmt);
130+
#define libboot_internal_register_error(group, type, fmt) \
131+
_libboot_internal_register_error((group), (libboot_error_type_t)(type), (fmt))
129132

130133
// crc
131134
unsigned long libboot_crc32(unsigned long crc, const unsigned char *buf, unsigned int len);

0 commit comments

Comments
 (0)