You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by jb...@apache.org on 2018/03/29 11:41:37 UTC
[geode-native] 11/15: PCH warning free
This is an automated email from the ASF dual-hosted git repository.
jbarrett pushed a commit to branch feature/GEODE-4946-msvc-warn
in repository https://gitbox.apache.org/repos/asf/geode-native.git
commit 21c27d4481481cc877a1c8b0b331fd0338bdd5ed
Author: Jacob Barrett <jb...@pivotal.io>
AuthorDate: Thu Mar 29 05:19:32 2018 +0000
PCH warning free
---
cppcache/CMakeLists.txt | 11 +++++++++++
cppcache/src/CacheTransactionManagerImpl.hpp | 9 +++------
cppcache/src/ExecutionImpl.cpp | 8 +++++---
cppcache/src/InternalCacheTransactionManager2PC.hpp | 2 +-
cppcache/src/InternalCacheTransactionManager2PCImpl.hpp | 4 ++--
cppcache/src/MapSegment.cpp | 2 +-
cppcache/src/ThinClientPoolDM.hpp | 6 +++---
cppcache/src/ThinClientRegion.cpp | 4 ++--
8 files changed, 28 insertions(+), 18 deletions(-)
diff --git a/cppcache/CMakeLists.txt b/cppcache/CMakeLists.txt
index 6be25d5..e429914 100644
--- a/cppcache/CMakeLists.txt
+++ b/cppcache/CMakeLists.txt
@@ -85,14 +85,25 @@ target_link_libraries(_apache-geode INTERFACE
boost
libxml2
)
+
target_compile_definitions(_apache-geode INTERFACE
# TODO replace BUILD_CPPCACHE with built-in _DLL
$<BUILD_INTERFACE:BUILD_CPPCACHE>
)
+
+if (USE_PCH)
+ # TODO figure out why PCH causes these warnings
+ # Ignore warnings resulting from using PCH
+ target_compile_options(_apache-geode INTERFACE
+ /wd4251 /wd4103 /wd4275 /wd4250
+ )
+endif()
+
target_include_directories(_apache-geode INTERFACE
$<BUILD_INTERFACE:${COMMON_INCLUDE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
)
+
add_dependencies(_apache-geode version-header)
install(DIRECTORY ${COMMON_INCLUDE_DIR} DESTINATION .)
diff --git a/cppcache/src/CacheTransactionManagerImpl.hpp b/cppcache/src/CacheTransactionManagerImpl.hpp
index 81999f9..562f761 100644
--- a/cppcache/src/CacheTransactionManagerImpl.hpp
+++ b/cppcache/src/CacheTransactionManagerImpl.hpp
@@ -33,8 +33,7 @@ namespace client {
enum status { STATUS_COMMITTED = 3, STATUS_ROLLEDBACK = 4 };
enum commitOp { BEFORE_COMMIT, AFTER_COMMIT };
-class CacheTransactionManagerImpl
- : public virtual apache::geode::client::CacheTransactionManager {
+class CacheTransactionManagerImpl : public virtual CacheTransactionManager {
public:
CacheTransactionManagerImpl(CacheImpl* cache);
virtual ~CacheTransactionManagerImpl();
@@ -45,11 +44,9 @@ class CacheTransactionManagerImpl
virtual bool exists() override;
virtual TransactionId& suspend() override;
virtual void resume(TransactionId& transactionId) override;
- virtual bool isSuspended(
- TransactionId& transactionId) override;
+ virtual bool isSuspended(TransactionId& transactionId) override;
virtual bool tryResume(TransactionId& transactionId) override;
- bool tryResume(TransactionId& transactionId,
- bool cancelExpiryTask);
+ bool tryResume(TransactionId& transactionId, bool cancelExpiryTask);
virtual bool tryResume(TransactionId& transactionId,
std::chrono::milliseconds waitTime) override;
virtual bool exists(TransactionId& transactionId) override;
diff --git a/cppcache/src/ExecutionImpl.cpp b/cppcache/src/ExecutionImpl.cpp
index f08de92..12c4956 100644
--- a/cppcache/src/ExecutionImpl.cpp
+++ b/cppcache/src/ExecutionImpl.cpp
@@ -184,7 +184,8 @@ std::shared_ptr<ResultCollector> ExecutionImpl::execute(
LOGDEBUG("ExecutionImpl::execute: m_routingObj is empty");
auto serverToBucketsMap = cms->groupByServerToAllBuckets(
m_region,
- /*serverOptimizeForWrite*/ (isHAHasResultOptimizeForWrite & 4));
+ /*serverOptimizeForWrite*/ (isHAHasResultOptimizeForWrite & 4) ==
+ 4);
if (!serverToBucketsMap || serverToBucketsMap->empty()) {
LOGDEBUG(
"ExecutionImpl::execute: m_routingObj is empty and locationMap "
@@ -250,7 +251,7 @@ std::shared_ptr<ResultCollector> ExecutionImpl::execute(
if (txState == nullptr) {
auto serverToKeysMap = cms->getServerToFilterMapFESHOP(
m_routingObj, m_region, /*serverOptimizeForWrite*/
- (isHAHasResultOptimizeForWrite & 4));
+ (isHAHasResultOptimizeForWrite & 4) == 4);
if (!serverToKeysMap || serverToKeysMap->empty()) {
LOGDEBUG(
"ExecutionImpl::execute: withFilter but locationMap is empty "
@@ -493,7 +494,8 @@ std::shared_ptr<CacheableVector> ExecutionImpl::executeOnPool(
funcName, m_args, getResult, tcrdm, timeout);
TcrMessageReply reply(true, tcrdm);
ChunkedFunctionExecutionResponse* resultCollector(
- new ChunkedFunctionExecutionResponse(reply, (getResult & 2), m_rc));
+ new ChunkedFunctionExecutionResponse(reply, (getResult & 2) == 2,
+ m_rc));
reply.setChunkedResultHandler(resultCollector);
reply.setTimeout(timeout);
diff --git a/cppcache/src/InternalCacheTransactionManager2PC.hpp b/cppcache/src/InternalCacheTransactionManager2PC.hpp
index 090c26a..7f5dc5c 100644
--- a/cppcache/src/InternalCacheTransactionManager2PC.hpp
+++ b/cppcache/src/InternalCacheTransactionManager2PC.hpp
@@ -49,7 +49,7 @@ namespace client {
*
*/
class _GEODE_EXPORT InternalCacheTransactionManager2PC
- : public virtual apache::geode::client::CacheTransactionManager {
+ : public virtual CacheTransactionManager {
public:
/**
* Performs prepare during 2 phase commit completion.
diff --git a/cppcache/src/InternalCacheTransactionManager2PCImpl.hpp b/cppcache/src/InternalCacheTransactionManager2PCImpl.hpp
index 732154a..fdb250f 100644
--- a/cppcache/src/InternalCacheTransactionManager2PCImpl.hpp
+++ b/cppcache/src/InternalCacheTransactionManager2PCImpl.hpp
@@ -28,8 +28,8 @@ namespace geode {
namespace client {
class InternalCacheTransactionManager2PCImpl
- : public apache::geode::client::CacheTransactionManagerImpl,
- public apache::geode::client::InternalCacheTransactionManager2PC {
+ : public CacheTransactionManagerImpl,
+ public InternalCacheTransactionManager2PC {
public:
InternalCacheTransactionManager2PCImpl(CacheImpl* cache);
virtual ~InternalCacheTransactionManager2PCImpl();
diff --git a/cppcache/src/MapSegment.cpp b/cppcache/src/MapSegment.cpp
index 61cf044..b0801ce 100644
--- a/cppcache/src/MapSegment.cpp
+++ b/cppcache/src/MapSegment.cpp
@@ -710,7 +710,7 @@ GfErrType MapSegment::putForTrackedEntry(
}
if (m_concurrencyChecksEnabled) {
// erase if the entry is in tombstone
- m_tombstoneList->eraseEntryFromTombstoneList(key, m_region);
+ m_tombstoneList->eraseEntryFromTombstoneList(key, true);
entryImpl->getVersionStamp().setVersions(versionStamp);
}
(void)incrementUpdateCount(key, entry);
diff --git a/cppcache/src/ThinClientPoolDM.hpp b/cppcache/src/ThinClientPoolDM.hpp
index 956e3ff..dc72b88 100644
--- a/cppcache/src/ThinClientPoolDM.hpp
+++ b/cppcache/src/ThinClientPoolDM.hpp
@@ -500,8 +500,8 @@ class FunctionExecution : public PooledWork<GfErrType> {
m_timeout);
TcrMessageReply reply(true, m_poolDM);
ChunkedFunctionExecutionResponse* resultProcessor(
- new ChunkedFunctionExecutionResponse(reply, (m_getResult & 2), *m_rc,
- m_resultCollectorLock));
+ new ChunkedFunctionExecutionResponse(reply, (m_getResult & 2) == 2,
+ *m_rc, m_resultCollectorLock));
reply.setChunkedResultHandler(resultProcessor);
reply.setTimeout(m_timeout);
reply.setDM(m_poolDM);
@@ -593,7 +593,7 @@ class OnRegionFunctionExecution : public PooledWork<GfErrType> {
m_allBuckets, timeout, m_poolDM);
m_reply = new TcrMessageReply(true, m_poolDM);
m_resultCollector = new ChunkedFunctionExecutionResponse(
- *m_reply, (m_getResult & 2), m_rc, m_resultCollectorLock);
+ *m_reply, (m_getResult & 2) == 2, m_rc, m_resultCollectorLock);
m_reply->setChunkedResultHandler(m_resultCollector);
m_reply->setTimeout(m_timeout);
m_reply->setDM(m_poolDM);
diff --git a/cppcache/src/ThinClientRegion.cpp b/cppcache/src/ThinClientRegion.cpp
index 73adc7d..91ccb7d 100644
--- a/cppcache/src/ThinClientRegion.cpp
+++ b/cppcache/src/ThinClientRegion.cpp
@@ -3002,7 +3002,7 @@ void ThinClientRegion::executeFunction(
TcrMessageReply reply(true, m_tcrdm);
// need to check
ChunkedFunctionExecutionResponse* resultCollector(
- new ChunkedFunctionExecutionResponse(reply, (getResult & 2), rc));
+ new ChunkedFunctionExecutionResponse(reply, (getResult & 2) == 2, rc));
reply.setChunkedResultHandler(resultCollector);
reply.setTimeout(timeout);
GfErrType err = GF_NOERR;
@@ -3096,7 +3096,7 @@ std::shared_ptr<CacheableVector> ThinClientRegion::reExecuteFunction(
TcrMessageReply reply(true, m_tcrdm);
// need to check
ChunkedFunctionExecutionResponse* resultCollector(
- new ChunkedFunctionExecutionResponse(reply, (getResult & 2), rc));
+ new ChunkedFunctionExecutionResponse(reply, (getResult & 2) == 2, rc));
reply.setChunkedResultHandler(resultCollector);
reply.setTimeout(timeout);
--
To stop receiving notification emails like this one, please contact
jbarrett@apache.org.