[retro-gtk] glsl-shader: Initialize some variables
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [retro-gtk] glsl-shader: Initialize some variables
- Date: Sat, 31 Oct 2020 15:30:10 +0000 (UTC)
commit 24d2be0af072765b80d6fb241392b3b8913bd5d6
Author: Adrien Plazas <kekun plazas laposte net>
Date: Sat Oct 31 16:17:45 2020 +0100
glsl-shader: Initialize some variables
While they likely weren't causing any issue, this makes the code cleaner
and possibly safer.
retro-gtk/retro-glsl-shader.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/retro-gtk/retro-glsl-shader.c b/retro-gtk/retro-glsl-shader.c
index f03ca581..51eb1485 100644
--- a/retro-gtk/retro-glsl-shader.c
+++ b/retro-gtk/retro-glsl-shader.c
@@ -42,7 +42,7 @@ create_shader (GBytes *source_bytes,
glGetShaderiv (shader, GL_COMPILE_STATUS, &status);
if (status == GL_FALSE) {
g_autofree gchar *buffer = NULL;
- gint log_length;
+ gint log_length = 0;
glGetShaderiv (shader, GL_INFO_LOG_LENGTH, &log_length);
buffer = g_malloc (log_length + 1);
@@ -134,8 +134,8 @@ retro_glsl_shader_new (GBytes *vertex,
glGetProgramiv (self->program, GL_LINK_STATUS, &status);
if (status == GL_FALSE) {
+ g_autofree gchar *buffer = NULL;
gint log_length = 0;
- g_autofree gchar *buffer;
glGetProgramiv (self->program, GL_INFO_LOG_LENGTH, &log_length);
buffer = g_malloc (log_length + 1);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]