[Bf-blender-cvs] [947dc219795] master: Cleanup: Fix build warning with MSVC

Ray Molenkamp noreply at git.blender.org
Tue Jan 11 22:58:00 CET 2022


Commit: 947dc219795b0d0c8f172f49c803272ed079384a
Author: Ray Molenkamp
Date:   Tue Jan 11 14:57:54 2022 -0700
Branches: master
https://developer.blender.org/rB947dc219795b0d0c8f172f49c803272ed079384a

Cleanup: Fix build warning with MSVC

comparing a bool > 0 make MSVC emit
warning C4804: '>': unsafe use of type 'bool' in operation.

int does the job nicely.

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

M	source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc

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

diff --git a/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc b/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
index 0feca806f35..f9151bb97f8 100644
--- a/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
+++ b/source/blender/io/wavefront_obj/tests/obj_exporter_tests.cc
@@ -236,7 +236,7 @@ TEST(obj_exporter_writer, mtllib)
 static bool strings_equal_after_first_lines(const std::string &a, const std::string &b)
 {
   /* If `dbg_level > 0` then a failing test will print context around the first mismatch. */
-  const bool dbg_level = 0;
+  const int dbg_level = 0;
   const size_t a_len = a.size();
   const size_t b_len = b.size();
   const size_t a_next = a.find_first_of('\n');



More information about the Bf-blender-cvs mailing list