aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-06-07 12:38:24 +0200
committerDavid Robillard <d@drobilla.net>2020-06-13 17:18:22 +0200
commitabcff5b7f125a9e0d203025207fae07e58c40d8f (patch)
treef38a8c9c5dce388055582f1f995b605463d11d71 /examples
parentf036af07f7eb8ccb14fc3c4389f509367b9a3802 (diff)
downloadpugl-abcff5b7f125a9e0d203025207fae07e58c40d8f.tar.gz
pugl-abcff5b7f125a9e0d203025207fae07e58c40d8f.tar.bz2
pugl-abcff5b7f125a9e0d203025207fae07e58c40d8f.zip
Cleanup: Fix uninitialised variables
Diffstat (limited to 'examples')
-rw-r--r--examples/pugl_shader_demo.c2
-rw-r--r--examples/shader_utils.h8
2 files changed, 5 insertions, 5 deletions
diff --git a/examples/pugl_shader_demo.c b/examples/pugl_shader_demo.c
index 7c0df6a..15e1943 100644
--- a/examples/pugl_shader_demo.c
+++ b/examples/pugl_shader_demo.c
@@ -306,7 +306,7 @@ setupGl(PuglTestApp* app)
"UniformBufferObject");
// Generate/bind a uniform buffer for setting rectangle properties
- GLuint uboHandle;
+ GLuint uboHandle = 0;
glGenBuffers(1, &uboHandle);
glBindBuffer(GL_UNIFORM_BUFFER, uboHandle);
glBindBufferBase(GL_UNIFORM_BUFFER, globalsIndex, uboHandle);
diff --git a/examples/shader_utils.h b/examples/shader_utils.h
index 9cfc850..10a7ace 100644
--- a/examples/shader_utils.h
+++ b/examples/shader_utils.h
@@ -36,10 +36,10 @@ compileShader(const char* header, const char* source, const GLenum type)
glShaderSource(shader, 2, sources, lengths);
glCompileShader(shader);
- int status;
+ int status = 0;
glGetShaderiv(shader, GL_COMPILE_STATUS, &status);
if (status == GL_FALSE) {
- GLint length;
+ GLint length = 0;
glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &length);
char* log = (char*)calloc(1, (size_t)length);
@@ -83,10 +83,10 @@ compileProgram(const char* headerSource,
glAttachShader(program.program, program.fragmentShader);
glLinkProgram(program.program);
- GLint status;
+ GLint status = 0;
glGetProgramiv(program.program, GL_LINK_STATUS, &status);
if (status == GL_FALSE) {
- GLint length;
+ GLint length = 0;
glGetProgramiv(program.program, GL_INFO_LOG_LENGTH, &length);
char* log = (char*)calloc(1, (size_t)length);