You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kp...@apache.org on 2017/02/15 21:19:54 UTC

qpid-cpp git commit: QPID-7676: C++11 dependency for std::log2() fixed

Repository: qpid-cpp
Updated Branches:
  refs/heads/master 9158a4acb -> 59fd5fd75


QPID-7676: C++11 dependency for std::log2() fixed


Project: http://git-wip-us.apache.org/repos/asf/qpid-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-cpp/commit/59fd5fd7
Tree: http://git-wip-us.apache.org/repos/asf/qpid-cpp/tree/59fd5fd7
Diff: http://git-wip-us.apache.org/repos/asf/qpid-cpp/diff/59fd5fd7

Branch: refs/heads/master
Commit: 59fd5fd75eb305835edf02ec0f172eb1a36ebd05
Parents: 9158a4a
Author: Kim van der Riet <kp...@apache.org>
Authored: Wed Feb 15 16:19:30 2017 -0500
Committer: Kim van der Riet <kp...@apache.org>
Committed: Wed Feb 15 16:19:30 2017 -0500

----------------------------------------------------------------------
 src/qpid/linearstore/MessageStoreImpl.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-cpp/blob/59fd5fd7/src/qpid/linearstore/MessageStoreImpl.cpp
----------------------------------------------------------------------
diff --git a/src/qpid/linearstore/MessageStoreImpl.cpp b/src/qpid/linearstore/MessageStoreImpl.cpp
index 940c04a..76cf415 100644
--- a/src/qpid/linearstore/MessageStoreImpl.cpp
+++ b/src/qpid/linearstore/MessageStoreImpl.cpp
@@ -82,7 +82,9 @@ uint32_t MessageStoreImpl::chkJrnlWrPageCacheSize(const uint32_t param_, const s
     } else if ( p < 4 ) {
         p = 4;
     } else if (p & (p-1)) {
-        p = std::pow(2, std::floor(std::log2(p) + 0.5));
+        // When C++11 is enabled, use this:
+        // p = std::pow(2, std::round(std::log2(p)));
+        p = std::pow(2, std::floor((std::log(p)/std::log(2)) + 0.5));
         QLS_LOG(warning, "parameter " << paramName_ << " (" << param_ << ") must be a power of 2 between 4 and 128; changing this parameter to closest allowable value (" << p << ")");
     }
     return p;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org