You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2019/01/02 08:22:06 UTC

[GitHub] ShannonDing closed pull request #47: fix warning while compiling rocketmq_static

ShannonDing closed pull request #47: fix warning while compiling rocketmq_static
URL: https://github.com/apache/rocketmq-client-cpp/pull/47
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/src/MQClientAPIImpl.cpp b/src/MQClientAPIImpl.cpp
index 62170862..244d674d 100644
--- a/src/MQClientAPIImpl.cpp
+++ b/src/MQClientAPIImpl.cpp
@@ -152,7 +152,7 @@ string MQClientAPIImpl::fetchNameServerAddr(const string& NSDomain) {
       // update the snapshot local file if nameSrv changes or
       // m_firstFetchNameSrv==true
       if (writeDataToFile(fileBak, addrs, true)) {
-        if (UtilAll::ReplaceFile(fileBak, file) == -1)
+        if (!UtilAll::ReplaceFile(fileBak, file))
           LOG_ERROR("could not rename bak file:%s", strerror(errno));
       }
     }
@@ -160,7 +160,7 @@ string MQClientAPIImpl::fetchNameServerAddr(const string& NSDomain) {
     if (!boost::filesystem::exists(snapshot_file)) {
       // the name server snapshot local file maybe deleted by force, create it
       if (writeDataToFile(fileBak, m_nameSrvAddr, true)) {
-        if (UtilAll::ReplaceFile(fileBak, file) == -1)
+        if (!UtilAll::ReplaceFile(fileBak, file))
           LOG_ERROR("could not rename bak file:%s", strerror(errno));
       }
     }
diff --git a/src/consumer/OffsetStore.cpp b/src/consumer/OffsetStore.cpp
index a7463a6c..25d1b320 100644
--- a/src/consumer/OffsetStore.cpp
+++ b/src/consumer/OffsetStore.cpp
@@ -214,7 +214,7 @@ void LocalFileOffsetStore::persistAll(const std::vector<MQMessageQueue>& mqs) {
                         "persistAll:open offset store file failed", -1);
     }
     s.close();
-    if (UtilAll::ReplaceFile(storefile_bak, m_storeFile) == -1)
+    if (!UtilAll::ReplaceFile(storefile_bak, m_storeFile))
       LOG_ERROR("could not rename bak file:%s", strerror(errno));
     m_offsetTable_tmp.clear();
   } else {
diff --git a/src/producer/DefaultMQProducer.cpp b/src/producer/DefaultMQProducer.cpp
index 4c39bd24..1411ebdf 100755
--- a/src/producer/DefaultMQProducer.cpp
+++ b/src/producer/DefaultMQProducer.cpp
@@ -244,7 +244,7 @@ void DefaultMQProducer::setMaxMessageSize(int maxMessageSize) {
 int DefaultMQProducer::getCompressLevel() const { return m_compressLevel; }
 
 void DefaultMQProducer::setCompressLevel(int compressLevel) {
-  assert(compressLevel >= 0 && compressLevel <= 9 || compressLevel == -1);
+  assert((compressLevel >= 0 && compressLevel <= 9) || compressLevel == -1);
 
   m_compressLevel = compressLevel;
 }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services