[Bf-blender-cvs] [e12b1cf8cee] functions: fix some warnings

Jacques Lucke noreply at git.blender.org
Tue Aug 27 12:24:42 CEST 2019


Commit: e12b1cf8cee12abf9a1fc2de099bc04e32176a0a
Author: Jacques Lucke
Date:   Tue Aug 27 12:17:56 2019 +0200
Branches: functions
https://developer.blender.org/rBe12b1cf8cee12abf9a1fc2de099bc04e32176a0a

fix some warnings

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

M	source/blender/blenlib/BLI_task.hpp
M	source/blender/simulations/bparticles/c_wrapper.cpp
M	source/blender/simulations/bparticles/particle_function_builder.cpp
M	tests/gtests/blenlib/BLI_vector_test.cc

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

diff --git a/source/blender/blenlib/BLI_task.hpp b/source/blender/blenlib/BLI_task.hpp
index 88f4a03ee77..1385ad9cb5f 100644
--- a/source/blender/blenlib/BLI_task.hpp
+++ b/source/blender/blenlib/BLI_task.hpp
@@ -90,7 +90,7 @@ static void parallel_array_elements(ArrayRef<T> array,
     return;
   }
 
-  TaskParallelSettings settings = {0};
+  TaskParallelSettings settings;
   BLI_parallel_range_settings_defaults(&settings);
   settings.scheduling_mode = TASK_SCHEDULING_STATIC;
   settings.min_iter_per_thread = 1;
@@ -141,7 +141,7 @@ static void parallel_range(Range<uint> total_range,
     return;
   }
 
-  TaskParallelSettings settings = {0};
+  TaskParallelSettings settings;
   BLI_parallel_range_settings_defaults(&settings);
 
   struct ParallelData {
diff --git a/source/blender/simulations/bparticles/c_wrapper.cpp b/source/blender/simulations/bparticles/c_wrapper.cpp
index e32671b4502..5397db1d655 100644
--- a/source/blender/simulations/bparticles/c_wrapper.cpp
+++ b/source/blender/simulations/bparticles/c_wrapper.cpp
@@ -116,8 +116,10 @@ static void distribute_tetrahedons_range(Mesh *mesh,
     }
 
     rgba_f color_f = colors[instance];
-    MLoopCol color_b = {
-        (uchar)(color_f.r * 255.0f), (uchar)(color_f.g * 255.0f), (uchar)(color_f.b * 255.0f)};
+    MLoopCol color_b = {(uchar)(color_f.r * 255.0f),
+                        (uchar)(color_f.g * 255.0f),
+                        (uchar)(color_f.b * 255.0f),
+                        255};
     for (uint i = 0; i < ARRAY_SIZE(tetrahedon_loop_vertices); i++) {
       mesh->mloop[loop_offset + i].v = vertex_offset + tetrahedon_loop_vertices[i];
       mesh->mloop[loop_offset + i].e = edge_offset + tetrahedon_loop_edges[i];
@@ -266,7 +268,8 @@ void BParticles_modifier_cache_state(BParticlesModifierData *bpmd,
         containers.append(container);
       });
 
-  BParticlesFrameCache cached_frame = {0};
+  BParticlesFrameCache cached_frame;
+  memset(&cached_frame, 0, sizeof(BParticlesFrameCache));
   cached_frame.frame = frame;
   cached_frame.num_particle_types = containers.size();
   cached_frame.particle_types = (BParticlesTypeCache *)MEM_calloc_arrayN(
diff --git a/source/blender/simulations/bparticles/particle_function_builder.cpp b/source/blender/simulations/bparticles/particle_function_builder.cpp
index f7f918f92da..a4fbff71832 100644
--- a/source/blender/simulations/bparticles/particle_function_builder.cpp
+++ b/source/blender/simulations/bparticles/particle_function_builder.cpp
@@ -115,12 +115,13 @@ class AgeInputProvider : public ParticleFunctionInputProvider {
 class SurfaceImageInputProvider : public ParticleFunctionInputProvider {
  private:
   Image *m_image;
-  ImageUser m_image_user = {0};
+  ImageUser m_image_user;
   ImBuf *m_ibuf;
 
  public:
   SurfaceImageInputProvider(Image *image) : m_image(image)
   {
+    memset(&m_image_user, 0, sizeof(ImageUser));
     m_image_user.ok = true;
     m_ibuf = BKE_image_acquire_ibuf(image, &m_image_user, NULL);
     BLI_assert(m_ibuf);
diff --git a/tests/gtests/blenlib/BLI_vector_test.cc b/tests/gtests/blenlib/BLI_vector_test.cc
index 868d136e048..ba64959235e 100644
--- a/tests/gtests/blenlib/BLI_vector_test.cc
+++ b/tests/gtests/blenlib/BLI_vector_test.cc
@@ -53,7 +53,7 @@ TEST(vector, IntrusiveListBaseConstructor)
   TestListValue *value2 = new TestListValue{0, 0, 5};
   TestListValue *value3 = new TestListValue{0, 0, 6};
 
-  ListBase list = {0};
+  ListBase list = {NULL, NULL};
   BLI_addtail(&list, value1);
   BLI_addtail(&list, value2);
   BLI_addtail(&list, value3);



More information about the Bf-blender-cvs mailing list