[Bf-blender-cvs] [7e4715a534a] functions: remove unused macro

Jacques Lucke noreply at git.blender.org
Sun Aug 25 14:34:56 CEST 2019


Commit: 7e4715a534aca8ba6f5c5133b7a1066ffc5b893d
Author: Jacques Lucke
Date:   Sun Aug 25 14:23:32 2019 +0200
Branches: functions
https://developer.blender.org/rB7e4715a534aca8ba6f5c5133b7a1066ffc5b893d

remove unused macro

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

M	source/blender/blenlib/BLI_string_ref.hpp
M	tests/gtests/blenlib/BLI_string_ref_test.cc

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

diff --git a/source/blender/blenlib/BLI_string_ref.hpp b/source/blender/blenlib/BLI_string_ref.hpp
index 41f0c80af30..03198af5ecf 100644
--- a/source/blender/blenlib/BLI_string_ref.hpp
+++ b/source/blender/blenlib/BLI_string_ref.hpp
@@ -234,18 +234,3 @@ inline bool StringRefBase::endswith(StringRef suffix) const
 }
 
 }  // namespace BLI
-
-#define BLI_STRINGREF_STACK_COMBINE(result, a, b) \
-  BLI::StringRefNull result; \
-  { \
-    BLI::StringRef a_ref(a); \
-    BLI::StringRef b_ref(b); \
-    uint characters = a_ref.size() + b_ref.size(); \
-    char *result##_ptr = (char *)BLI_array_alloca(result##_ptr, characters + 1); \
-    for (uint i = 0; i < a_ref.size(); i++) \
-      result##_ptr[i] = a_ref[i]; \
-    for (uint i = 0; i < b_ref.size(); i++) \
-      result##_ptr[i + a_ref.size()] = b_ref[i]; \
-    result##_ptr[characters] = '\0'; \
-    result = BLI::StringRefNull(result##_ptr, a_ref.size() + b_ref.size()); \
-  }
diff --git a/tests/gtests/blenlib/BLI_string_ref_test.cc b/tests/gtests/blenlib/BLI_string_ref_test.cc
index 00cb7023de6..2e53f1f2c01 100644
--- a/tests/gtests/blenlib/BLI_string_ref_test.cc
+++ b/tests/gtests/blenlib/BLI_string_ref_test.cc
@@ -218,23 +218,3 @@ TEST(string_ref, DropPrefix)
   EXPECT_EQ(ref2.size(), 1);
   EXPECT_EQ(ref2, "t");
 }
-
-TEST(string_ref, CombineOnStack1)
-{
-  StringRef ref1("hello ");
-  StringRef ref2("world");
-  BLI_STRINGREF_STACK_COMBINE(ref_combined, ref1, ref2);
-  EXPECT_EQ(ref_combined.size(), 11);
-  EXPECT_EQ(ref_combined, "hello world");
-}
-
-TEST(string_ref, CombineOnStack2)
-{
-  StringRef ref1("");
-  StringRef ref2("");
-  void *before = alloca(1);
-  BLI_STRINGREF_STACK_COMBINE(ref_combined, ref1, ref2);
-  void *after = alloca(1);
-
-  EXPECT_TRUE(IN_RANGE_INCL((void *)ref_combined.begin(), before, after));
-}



More information about the Bf-blender-cvs mailing list