[Bf-blender-cvs] [76d0ab9750b] blender2.8: Code cleanup: fix various compiler warnings.

Brecht Van Lommel noreply at git.blender.org
Sat Aug 12 14:11:02 CEST 2017


Commit: 76d0ab9750b04971fe7598011609faea2b4f7f62
Author: Brecht Van Lommel
Date:   Sat Aug 12 14:07:37 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB76d0ab9750b04971fe7598011609faea2b4f7f62

Code cleanup: fix various compiler warnings.

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

M	intern/ghost/intern/GHOST_ContextGLX.cpp
M	intern/ghost/intern/GHOST_ContextGLX.h
M	intern/ghost/intern/GHOST_WindowX11.cpp
M	intern/opensubdiv/opensubdiv_gpu_capi.cc
M	source/blender/draw/intern/draw_cache_impl_mesh.c
M	source/blender/gpu/GPU_uniformbuffer.h
M	source/blender/gpu/intern/gpu_uniformbuffer.c
M	source/blender/makesrna/intern/rna_wm_manipulator_api.c
M	source/blender/windowmanager/manipulators/WM_manipulator_types.h

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

diff --git a/intern/ghost/intern/GHOST_ContextGLX.cpp b/intern/ghost/intern/GHOST_ContextGLX.cpp
index 0a9dc900aed..061ac29945b 100644
--- a/intern/ghost/intern/GHOST_ContextGLX.cpp
+++ b/intern/ghost/intern/GHOST_ContextGLX.cpp
@@ -57,7 +57,6 @@ GHOST_ContextGLX::GHOST_ContextGLX(
         GHOST_TUns16 numOfAASamples,
         Window window,
         Display *display,
-        XVisualInfo *visualInfo,
         GLXFBConfig fbconfig,
         int contextProfileMask,
         int contextMajorVersion,
@@ -66,7 +65,6 @@ GHOST_ContextGLX::GHOST_ContextGLX(
         int contextResetNotificationStrategy)
     : GHOST_Context(stereoVisual, numOfAASamples),
       m_display(display),
-      m_visualInfo(visualInfo),
       m_fbconfig(fbconfig),
       m_window(window),
       m_contextProfileMask(contextProfileMask),
diff --git a/intern/ghost/intern/GHOST_ContextGLX.h b/intern/ghost/intern/GHOST_ContextGLX.h
index 6547a0bd00a..51fb1dd57dc 100644
--- a/intern/ghost/intern/GHOST_ContextGLX.h
+++ b/intern/ghost/intern/GHOST_ContextGLX.h
@@ -57,7 +57,6 @@ public:
 	        GHOST_TUns16 numOfAASamples,
 	        Window window,
 	        Display *display,
-	        XVisualInfo *visualInfo,
 	        GLXFBConfig fbconfig,
 	        int contextProfileMask,
 	        int contextMajorVersion,
@@ -113,7 +112,6 @@ private:
 	void initContextGLXEW();
 
 	Display *m_display;
-	XVisualInfo *m_visualInfo;
 	GLXFBConfig m_fbconfig;
 	Window   m_window;
 
diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp
index 450fe568814..12355cb6aab 100644
--- a/intern/ghost/intern/GHOST_WindowX11.cpp
+++ b/intern/ghost/intern/GHOST_WindowX11.cpp
@@ -1356,7 +1356,6 @@ GHOST_Context *GHOST_WindowX11::newDrawingContext(GHOST_TDrawingContextType type
 			        m_wantNumOfAASamples,
 			        m_window,
 			        m_display,
-			        m_visualInfo,
 			        (GLXFBConfig)m_fbconfig,
 			        profile_mask,
 			        4, minor,
@@ -1374,7 +1373,6 @@ GHOST_Context *GHOST_WindowX11::newDrawingContext(GHOST_TDrawingContextType type
 		        m_wantNumOfAASamples,
 		        m_window,
 		        m_display,
-		        m_visualInfo,
 		        (GLXFBConfig)m_fbconfig,
 		        profile_mask,
 		        3, 3,
diff --git a/intern/opensubdiv/opensubdiv_gpu_capi.cc b/intern/opensubdiv/opensubdiv_gpu_capi.cc
index 811cd18745e..7d8085c1ff5 100644
--- a/intern/opensubdiv/opensubdiv_gpu_capi.cc
+++ b/intern/opensubdiv/opensubdiv_gpu_capi.cc
@@ -616,7 +616,7 @@ static GLuint prepare_patchDraw(OpenSubdiv_GLMesh *gl_mesh,
 
 	if (fill_quads) {
 		int model;
-		GLboolean use_texture_2d, use_lighting;
+		GLboolean use_texture_2d;
 		glGetIntegerv(GL_SHADE_MODEL, &model);
 		glGetBooleanv(GL_TEXTURE_2D, &use_texture_2d);
 
diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c
index f48d739f11b..40ba86d99ff 100644
--- a/source/blender/draw/intern/draw_cache_impl_mesh.c
+++ b/source/blender/draw/intern/draw_cache_impl_mesh.c
@@ -245,7 +245,7 @@ static void mesh_cd_calc_used_gpu_layers(
         struct GPUMaterial **gpumat_array, int gpumat_array_len)
 {
 	/* See: DM_vertex_attributes_from_gpu for similar logic */
-	GPUVertexAttribs gattribs = {0};
+	GPUVertexAttribs gattribs = {{{0}}};
 
 	for (int i = 0; i < gpumat_array_len; i++) {
 		GPUMaterial *gpumat = gpumat_array[i];
diff --git a/source/blender/gpu/GPU_uniformbuffer.h b/source/blender/gpu/GPU_uniformbuffer.h
index e342078d8fd..57c4612c865 100644
--- a/source/blender/gpu/GPU_uniformbuffer.h
+++ b/source/blender/gpu/GPU_uniformbuffer.h
@@ -32,7 +32,6 @@
 #ifndef __GPU_UNIFORMBUFFER_H__
 #define __GPU_UNIFORMBUFFER_H__
 
-typedef enum GPUType GPUType;
 struct ListBase;
 
 typedef struct GPUUniformBuffer GPUUniformBuffer;
diff --git a/source/blender/gpu/intern/gpu_uniformbuffer.c b/source/blender/gpu/intern/gpu_uniformbuffer.c
index e3072d729c3..9e786844270 100644
--- a/source/blender/gpu/intern/gpu_uniformbuffer.c
+++ b/source/blender/gpu/intern/gpu_uniformbuffer.c
@@ -51,12 +51,12 @@ typedef enum GPUUniformBufferType {
 	GPU_UBO_DYNAMIC = 1,
 } GPUUniformBufferType;
 
-typedef struct GPUUniformBuffer {
+struct GPUUniformBuffer {
 	int size;           /* in bytes */
 	GLuint bindcode;    /* opengl identifier for UBO */
 	int bindpoint;      /* current binding point */
 	GPUUniformBufferType type;
-} GPUUniformBuffer;
+};
 
 #define GPUUniformBufferStatic GPUUniformBuffer
 
@@ -67,12 +67,12 @@ typedef struct GPUUniformBufferDynamic {
 	char flag;
 } GPUUniformBufferDynamic;
 
-typedef struct GPUUniformBufferDynamicItem {
+struct GPUUniformBufferDynamicItem {
 	struct GPUUniformBufferDynamicItem *next, *prev;
 	GPUType gputype;
 	float *data;
 	int size;
-} GPUUniformBufferDynamicItem;
+};
 
 
 /* Prototypes */
diff --git a/source/blender/makesrna/intern/rna_wm_manipulator_api.c b/source/blender/makesrna/intern/rna_wm_manipulator_api.c
index 7c805512e0b..f40a2208cf9 100644
--- a/source/blender/makesrna/intern/rna_wm_manipulator_api.c
+++ b/source/blender/makesrna/intern/rna_wm_manipulator_api.c
@@ -178,7 +178,7 @@ void RNA_api_manipulator(StructRNA *srna)
 	func = RNA_def_function(srna, "draw_preset_box", "rna_manipulator_draw_preset_box");
 	RNA_def_function_ui_description(func, "Draw a box");
 	parm = RNA_def_property(func, "matrix", PROP_FLOAT, PROP_MATRIX);
-	RNA_def_property_flag(parm, PARM_REQUIRED);
+	RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
 	RNA_def_property_multi_array(parm, 2, rna_matrix_dimsize_4x4);
 	RNA_def_property_ui_text(parm, "", "The matrix to transform");
 	RNA_def_int(func, "select_id", -1, -1, INT_MAX, "Zero when not selecting", "", -1, INT_MAX);
@@ -187,7 +187,7 @@ void RNA_api_manipulator(StructRNA *srna)
 	func = RNA_def_function(srna, "draw_preset_arrow", "rna_manipulator_draw_preset_arrow");
 	RNA_def_function_ui_description(func, "Draw a box");
 	parm = RNA_def_property(func, "matrix", PROP_FLOAT, PROP_MATRIX);
-	RNA_def_property_flag(parm, PARM_REQUIRED);
+	RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
 	RNA_def_property_multi_array(parm, 2, rna_matrix_dimsize_4x4);
 	RNA_def_property_ui_text(parm, "", "The matrix to transform");
 	RNA_def_enum(func, "axis", rna_enum_object_axis_items, 2, "", "Arrow Orientation");
@@ -196,7 +196,7 @@ void RNA_api_manipulator(StructRNA *srna)
 	func = RNA_def_function(srna, "draw_preset_circle", "rna_manipulator_draw_preset_circle");
 	RNA_def_function_ui_description(func, "Draw a box");
 	parm = RNA_def_property(func, "matrix", PROP_FLOAT, PROP_MATRIX);
-	RNA_def_property_flag(parm, PARM_REQUIRED);
+	RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
 	RNA_def_property_multi_array(parm, 2, rna_matrix_dimsize_4x4);
 	RNA_def_property_ui_text(parm, "", "The matrix to transform");
 	RNA_def_enum(func, "axis", rna_enum_object_axis_items, 2, "", "Arrow Orientation");
diff --git a/source/blender/windowmanager/manipulators/WM_manipulator_types.h b/source/blender/windowmanager/manipulators/WM_manipulator_types.h
index 8346bf24fd1..7bfc08c7caa 100644
--- a/source/blender/windowmanager/manipulators/WM_manipulator_types.h
+++ b/source/blender/windowmanager/manipulators/WM_manipulator_types.h
@@ -196,9 +196,6 @@ struct wmManipulator {
 	/* over alloc target_properties after 'wmManipulatorType.struct_size' */
 };
 
-typedef void (*wmManipulatorGroupFnInit)(
-        const struct bContext *, struct wmManipulatorGroup *);
-
 /* Similar to PropertyElemRNA, but has an identifier. */
 typedef struct wmManipulatorProperty {
 	const struct wmManipulatorPropertyType *type;




More information about the Bf-blender-cvs mailing list