[Bf-blender-cvs] [3f9f82f3c4] blender2.8: fix clang warning

Mike Erwin noreply at git.blender.org
Sat Feb 11 00:47:16 CET 2017


Commit: 3f9f82f3c45e9889ae00636ef41d9dc49cad4d83
Author: Mike Erwin
Date:   Tue Feb 7 13:49:50 2017 -0500
Branches: blender2.8
https://developer.blender.org/rB3f9f82f3c45e9889ae00636ef41d9dc49cad4d83

fix clang warning

uninitialized variable (glGen functions set the value)

===================================================================

M	source/blender/gpu/gawain/buffer_id.cpp

===================================================================

diff --git a/source/blender/gpu/gawain/buffer_id.cpp b/source/blender/gpu/gawain/buffer_id.cpp
index a7b8d7a394..450656c4eb 100644
--- a/source/blender/gpu/gawain/buffer_id.cpp
+++ b/source/blender/gpu/gawain/buffer_id.cpp
@@ -53,7 +53,7 @@ GLuint buffer_id_alloc()
 		}
 	orphan_mutex.unlock();
 
-	GLuint new_buffer_id;
+	GLuint new_buffer_id = 0;
 	glGenBuffers(1, &new_buffer_id);
 	return new_buffer_id;
 	}
@@ -80,8 +80,6 @@ GLuint vao_id_alloc()
 	assert(thread_is_main());
 #endif
 
-	GLuint new_vao_id;
-
 	// delete orphaned IDs
 	orphan_mutex.lock();
 	if (!orphaned_vao_ids.empty())
@@ -95,6 +93,7 @@ GLuint vao_id_alloc()
 		}
 	orphan_mutex.unlock();
 
+	GLuint new_vao_id = 0;
 	glGenVertexArrays(1, &new_vao_id);
 	return new_vao_id;
 	}




More information about the Bf-blender-cvs mailing list