[Bf-blender-cvs] [008eb7af41e] soc-2020-io-performance: Fix build errors on MSVC.

Ankit Meel noreply at git.blender.org
Wed Sep 2 11:02:09 CEST 2020


Commit: 008eb7af41e740bd26461855e268057602d27cd6
Author: Ankit Meel
Date:   Wed Sep 2 14:30:01 2020 +0530
Branches: soc-2020-io-performance
https://developer.blender.org/rB008eb7af41e740bd26461855e268057602d27cd6

Fix build errors on MSVC.

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

M	source/blender/io/wavefront_obj/intern/obj_import_file_reader.cc
M	source/blender/io/wavefront_obj/intern/obj_import_mesh.cc

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

diff --git a/source/blender/io/wavefront_obj/intern/obj_import_file_reader.cc b/source/blender/io/wavefront_obj/intern/obj_import_file_reader.cc
index 67bf6ebf892..92a4f4625b5 100644
--- a/source/blender/io/wavefront_obj/intern/obj_import_file_reader.cc
+++ b/source/blender/io/wavefront_obj/intern/obj_import_file_reader.cc
@@ -135,7 +135,7 @@ static void split_by_char(StringRef in_string, const char delimiter, Vector<Stri
  * is set to the given fallback value in that case.
  */
 
-void copy_string_to_float(StringRef src, const float fallback_value, float &r_dst)
+static void copy_string_to_float(StringRef src, const float fallback_value, float &r_dst)
 {
   try {
     r_dst = std::stof(string(src));
@@ -158,7 +158,7 @@ void copy_string_to_float(StringRef src, const float fallback_value, float &r_ds
  * Catches exception if any string cannot be converted to a float. The destination
  * float is set to the given fallback value in that case.
  */
-BLI_INLINE void copy_string_to_float(Span<StringRef> src,
+static BLI_INLINE void copy_string_to_float(Span<StringRef> src,
                                      const float fallback_value,
                                      MutableSpan<float> r_dst)
 {
@@ -174,7 +174,7 @@ BLI_INLINE void copy_string_to_float(Span<StringRef> src,
  * Catches exception if the string cannot be converted to an integer. The destination
  * int is set to the given fallback value in that case.
  */
-BLI_INLINE void copy_string_to_int(StringRef src, const int fallback_value, int &r_dst)
+static BLI_INLINE void copy_string_to_int(StringRef src, const int fallback_value, int &r_dst)
 {
   try {
     r_dst = std::stoi(string(src));
@@ -196,7 +196,7 @@ BLI_INLINE void copy_string_to_int(StringRef src, const int fallback_value, int
  * Catches exception if any string cannot be converted to an integer. The destination
  * int is set to the given fallback value in that case.
  */
-BLI_INLINE void copy_string_to_int(Span<StringRef> src,
+static BLI_INLINE void copy_string_to_int(Span<StringRef> src,
                                    const int fallback_value,
                                    MutableSpan<int> r_dst)
 {
diff --git a/source/blender/io/wavefront_obj/intern/obj_import_mesh.cc b/source/blender/io/wavefront_obj/intern/obj_import_mesh.cc
index 4f0f362630f..881df8feb99 100644
--- a/source/blender/io/wavefront_obj/intern/obj_import_mesh.cc
+++ b/source/blender/io/wavefront_obj/intern/obj_import_mesh.cc
@@ -214,7 +214,8 @@ void MeshFromGeometry::create_vertices()
                  global_vertices_.vertices[mesh_geometry_.vertex_index(i)]);
       if (i >= mesh_geometry_.tot_normals()) {
         /* Silence debug warning in mesh validate. */
-        normal_float_to_short_v3(blender_mesh_->mvert[i].no, (float[3]){1.0f, 1.0f, 1.0f});
+        const float3 normals = {1.0f, 1.0f, 1.0f};
+        normal_float_to_short_v3(blender_mesh_->mvert[i].no, normals);
       }
     }
     else {



More information about the Bf-blender-cvs mailing list