GOEDO-8534: fix xcode 12 build (#657)
* GEODE-8534: Fix build errors after upgrade to XCode 12
Co-authored-by: Blake Bender <bblake@vmware.com>
diff --git a/cppcache/integration-test/ThinClientPutGetAll.hpp b/cppcache/integration-test/ThinClientPutGetAll.hpp
index f1def7d..e69839d 100644
--- a/cppcache/integration-test/ThinClientPutGetAll.hpp
+++ b/cppcache/integration-test/ThinClientPutGetAll.hpp
@@ -89,20 +89,14 @@
auto valuesMap = region->getAll(keys1, callBack);
if (valuesMap.size() == keys1.size()) {
- char buf[2048];
for (const auto& iter : valuesMap) {
const auto key = std::dynamic_pointer_cast<CacheableKey>(iter.first);
- const auto actualKey = key->toString().c_str();
const auto& mVal = iter.second;
if (mVal != nullptr) {
- const auto expectedVal = expected[actualKey].c_str();
- const auto actualVal = mVal->toString().c_str();
- sprintf(buf, "value from map %s , expected value %s ", actualVal,
- expectedVal);
- LOG(buf);
- ASSERT(strcmp(actualVal, expectedVal) == 0, "value not matched");
+ LOG(std::string("Value from map ") + mVal->toString() + ", expected value " + expected[key->toString()]);
+ ASSERT(mVal->toString() == expected[key->toString()], "value not matched");
} else {
- ASSERT(strcmp(actualKey, "keyNotThere") == 0,
+ ASSERT(key->toString() == "keyNotThere",
"keyNotThere value is not null");
}
}
diff --git a/cppcache/src/ClientProxyMembershipIDFactory.cpp b/cppcache/src/ClientProxyMembershipIDFactory.cpp
index b4d653f..43f41cb 100644
--- a/cppcache/src/ClientProxyMembershipIDFactory.cpp
+++ b/cppcache/src/ClientProxyMembershipIDFactory.cpp
@@ -33,9 +33,9 @@
ClientProxyMembershipIDFactory::ClientProxyMembershipIDFactory(
std::string dsName)
: dsName_(std::move(dsName)) {
- static const auto alphabet =
- "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_";
- static const auto numChars = (sizeof(alphabet) / sizeof(char)) - 2;
+ static const auto alphabet = std::string(
+ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_");
+ static const auto numChars = static_cast<int>(alphabet.size()) - 2;
std::random_device rd;
std::default_random_engine rng(rd());