From 2471945185d2e7a66b9615575ecf179ea7adf0a3 Mon Sep 17 00:00:00 2001 From: Kaoru Takeda Date: Sat, 31 Jul 2021 10:49:09 +0900 Subject: [PATCH] Merge pull request #175 from tetengo/compilation_errors Correct compilation errors #174 (cherry picked from commit adce02e272ac077ffe7dc5f1184dfad7795c6fab) --- library/property/test/src/usage_tetengo.property.saveLoad_c.c | 2 ++ library/trie/test/src/usage_tetengo.trie.search_c.c | 2 ++ library/trie/test/src/usage_tetengo.trie.search_cpp.cpp | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/library/property/test/src/usage_tetengo.property.saveLoad_c.c b/library/property/test/src/usage_tetengo.property.saveLoad_c.c index c97cc1a8..8388fa8b 100644 --- a/library/property/test/src/usage_tetengo.property.saveLoad_c.c +++ b/library/property/test/src/usage_tetengo.property.saveLoad_c.c @@ -50,6 +50,7 @@ void usage_tetengo_property_saveLoad() { /* The value cannot be yet obtained from the property set for getting. */ const size_t value_length1 = tetengo_property_propertySet_getString(p_props_for_getting, "foo", NULL, 0); + (void)value_length1; assert(value_length1 == (size_t)-1); } @@ -60,6 +61,7 @@ void usage_tetengo_property_saveLoad() { /* The value cannot be yet obtained from the property set for getting. */ const size_t value_length2 = tetengo_property_propertySet_getString(p_props_for_getting, "foo", NULL, 0); + (void)value_length2; assert(value_length2 == (size_t)-1); } diff --git a/library/trie/test/src/usage_tetengo.trie.search_c.c b/library/trie/test/src/usage_tetengo.trie.search_c.c index 884cb9b4..3b542fdf 100644 --- a/library/trie/test/src/usage_tetengo.trie.search_c.c +++ b/library/trie/test/src/usage_tetengo.trie.search_c.c @@ -80,12 +80,14 @@ void usage_tetengo_trie_search() { /* If a perfect-matching key is found, its value is returned. */ const int* const p_found_for_gionbashi = (const int*)tetengo_trie_trie_find(p_trie, "gionbashi"); + (void)p_found_for_gionbashi; assert(p_found_for_gionbashi); assert(*p_found_for_gionbashi == 5); } { /* If not found, NULL is returned. */ const int* const p_found_for_hanabatachou = (const int*)tetengo_trie_trie_find(p_trie, "hanabatachou"); + (void)p_found_for_hanabatachou; assert(!p_found_for_hanabatachou); } diff --git a/library/trie/test/src/usage_tetengo.trie.search_cpp.cpp b/library/trie/test/src/usage_tetengo.trie.search_cpp.cpp index 0afb5e41..ca64ae3a 100644 --- a/library/trie/test/src/usage_tetengo.trie.search_cpp.cpp +++ b/library/trie/test/src/usage_tetengo.trie.search_cpp.cpp @@ -65,12 +65,12 @@ namespace usage_tetengo::trie // Searches the trie. // If a perfect-matching key is found, its value is returned. - const int* const p_found_for_gionbashi = trie_.find("gionbashi"); + [[maybe_unused]] const int* const p_found_for_gionbashi = trie_.find("gionbashi"); assert(p_found_for_gionbashi); assert(*p_found_for_gionbashi == 5); // If not found, nullptr is returned. - const int* const p_found_for_hanabatachou = trie_.find("hanabatachou"); + [[maybe_unused]] const int* const p_found_for_hanabatachou = trie_.find("hanabatachou"); assert(!p_found_for_hanabatachou); // Creates a subtrie consisting of the elements with the common key prefix.