From 5f80381cc8d2875d27d14288b6f11c31a72fb3cf Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Tue, 4 Feb 2025 20:57:49 -0500 Subject: log: Specify explicit index for level strings Signed-off-by: Andrew Opalach --- src/log.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/log.c b/src/log.c index ea39b98..55dcad5 100644 --- a/src/log.c +++ b/src/log.c @@ -17,7 +17,12 @@ void al_set_print(s32 (*print_func)(void *, u8, char *), void *userdata) _al_log_userdata = userdata; } -static const char *levels[] = { "info", "warn", "error", "debug" }; +static const char *levels[] = { + [AL_LOG_INFO] = "info", + [AL_LOG_WARN] = "warn", + [AL_LOG_ERROR] = "error", + [AL_LOG_DEBUG] = "debug" +}; #ifndef AL_LOG_SKIP static __thread char messagebuf[AL_LOG_MESSAGE_SIZE]; -- cgit v1.2.3-101-g0448