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 <[email protected]> Authored: Wed Feb 15 16:19:30 2017 -0500 Committer: Kim van der Riet <[email protected]> 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: [email protected] For additional commands, e-mail: [email protected]
