summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2025-02-04 20:57:49 -0500
committerAndrew Opalach <andrew@akon.city> 2025-02-04 20:57:49 -0500
commit5f80381cc8d2875d27d14288b6f11c31a72fb3cf (patch)
tree228aa03fe1a01bf8a55e2dc4a824e97492a0477f /src
parente648d5ff284122b5a3dfcad506878ad6c4bccc34 (diff)
downloadlibalabaster-5f80381cc8d2875d27d14288b6f11c31a72fb3cf.tar.gz
libalabaster-5f80381cc8d2875d27d14288b6f11c31a72fb3cf.tar.bz2
libalabaster-5f80381cc8d2875d27d14288b6f11c31a72fb3cf.zip
log: Specify explicit index for level strings
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src')
-rw-r--r--src/log.c7
1 files changed, 6 insertions, 1 deletions
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];