Cleanp: fix compiler warnings
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Mon, 26 Aug 2019 09:20:52 +0000 (11:20 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Mon, 26 Aug 2019 09:27:04 +0000 (11:27 +0200)
extern/glew/CMakeLists.txt
extern/lzma/CMakeLists.txt
source/blender/alembic/intern/abc_mesh.h
source/blender/alembic/intern/alembic_capi.cc
source/blender/gpencil_modifiers/intern/MOD_gpencilthick.c

index e0773d828ecdfb9a42ac757e3ae73a5d1ee91c4b..18ca88e6fec58cb6550bcbb1942f07b9b508808b 100644 (file)
 # All rights reserved.
 # ***** END GPL LICENSE BLOCK *****
 
+# avoid noisy warnings
+if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
+  add_c_flag(
+    "-Wno-strict-prototypes"
+  )
+endif()
+
 set(INC
   include
 )
index 8bdddf0acede1d8a5f2b22121e548ade8eaa0a4f..d76b418fd7483baa60af2ab2db3f7e1e085792a0 100644 (file)
 # All rights reserved.
 # ***** END GPL LICENSE BLOCK *****
 
+# avoid noisy warnings
+if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
+  add_c_flag(
+    "-Wno-self-assign"
+  )
+endif()
+
 set(INC
   .
 )
index 77686a0204ea9a891d133e72d9ed8ec3c6ac251b..c15fb948e038fbb58d3e319ae4aeb1d714fdcf0a 100644 (file)
@@ -100,16 +100,16 @@ class AbcMeshReader : public AbcObjectReader {
  public:
   AbcMeshReader(const Alembic::Abc::IObject &object, ImportSettings &settings);
 
-  bool valid() const;
+  bool valid() const override;
   bool accepts_object_type(const Alembic::AbcCoreAbstract::ObjectHeader &alembic_header,
                            const Object *const ob,
-                           const char **err_str) const;
-  void readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel);
+                           const char **err_str) const override;
+  void readObjectData(Main *bmain, const Alembic::Abc::ISampleSelector &sample_sel) override;
 
   struct Mesh *read_mesh(struct Mesh *existing_mesh,
                          const Alembic::Abc::ISampleSelector &sample_sel,
                          int read_flag,
-                         const char **err_str);
+                         const char **err_str) override;
   bool topology_changed(Mesh *existing_mesh,
                         const Alembic::Abc::ISampleSelector &sample_sel) override;
 
index f7ba925530b5e7ffa22bb78896caca9523663a13..dc525e0c46c6c71c52ed8dc8b6441f6858b87834 100644 (file)
@@ -984,7 +984,7 @@ bool ABC_mesh_topology_changed(
 {
   AbcObjectReader *abc_reader = get_abc_reader(reader, ob, err_str);
   if (abc_reader == NULL) {
-    return NULL;
+    return false;
   }
 
   ISampleSelector sample_sel = sample_selector_for_time(time);
index 29e933e26df4fbdd57d6fdd54ad50d738a5f8701..e9e92f7a1e2cf64894c9915cc538895fd1a7fb37 100644 (file)
@@ -149,7 +149,7 @@ static void deformStroke(GpencilModifierData *md,
     if (mmd->flag & GP_THICK_NORMALIZE) {
       if (gps_has_unaffected_points) {
         /* Clamp value for very weird situations when stroke thickness can be zero. */
-        CLAMP_MIN(gps->thickness, 0.001f);
+        CLAMP_MIN(gps->thickness, 1);
         /* Calculate pressure value to match the width of strokes with reset thickness and 1.0
          * pressure. */
         pt->pressure = (float)mmd->thickness / (float)gps->thickness;