Mesa (master): egl: drop unneeded sentinel from level_strings[]
Emil Velikov
evelikov at kemper.freedesktop.org
Mon May 8 14:40:52 UTC 2017
Module: Mesa
Branch: master
Commit: 54f619fb9b558609d433cba6c619c3136eede57d
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=54f619fb9b558609d433cba6c619c3136eede57d
Author: Emil Velikov <emil.velikov at collabora.com>
Date: Thu May 4 19:34:43 2017 +0100
egl: drop unneeded sentinel from level_strings[]
The array is local so we already know its size.
v2: Correct loop condition (Bartosz)
Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
Reviewed-by: Eric Engestrom <eric at engestrom.ch>
Reviewed-by: Chad Versace <chadversary at chromium.org>
---
src/egl/main/egllog.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/egl/main/egllog.c b/src/egl/main/egllog.c
index 6f0c0cda6c..7af381830e 100644
--- a/src/egl/main/egllog.c
+++ b/src/egl/main/egllog.c
@@ -41,6 +41,7 @@
#include <string.h>
#include <strings.h>
#include "c11/threads.h"
+#include "util/macros.h"
#include "egllog.h"
@@ -82,7 +83,6 @@ static const char *level_strings[] = {
"warning",
"info",
"debug",
- NULL
};
@@ -129,7 +129,7 @@ _eglInitLogger(void)
log_env = getenv("EGL_LOG_LEVEL");
if (log_env) {
- for (i = 0; level_strings[i]; i++) {
+ for (i = 0; i < ARRAY_SIZE(level_strings); i++) {
if (strcasecmp(log_env, level_strings[i]) == 0) {
level = i;
break;
More information about the mesa-commit
mailing list