# HG changeset patch # User jodogne # Date 1354290531 -3600 # Node ID 2766fac53c81f9c25e2e592e6562636f09c05194 # Parent 30887f3593dd5ab7822569268a43b9b6ced15586 fix diff -r 30887f3593dd -r 2766fac53c81 OrthancServer/ServerIndex.cpp --- a/OrthancServer/ServerIndex.cpp Fri Nov 30 16:10:06 2012 +0100 +++ b/OrthancServer/ServerIndex.cpp Fri Nov 30 16:48:51 2012 +0100 @@ -352,6 +352,8 @@ void ServerIndex::ComputeStatistics(Json::Value& target) { + static const uint64_t MB = 1024 * 1024; + boost::mutex::scoped_lock lock(mutex_); target = Json::objectValue; @@ -359,8 +361,8 @@ uint64_t us = db_->GetTotalUncompressedSize(); target["TotalDiskSpace"] = boost::lexical_cast(cs); target["TotalUncompressedSize"] = boost::lexical_cast(us); - target["TotalDiskSpaceMB"] = boost::lexical_cast(cs / (1024llu * 1024llu)); - target["TotalUncompressedSizeMB"] = boost::lexical_cast(us / (1024llu * 1024llu)); + target["TotalDiskSpaceMB"] = boost::lexical_cast(cs / MB); + target["TotalUncompressedSizeMB"] = boost::lexical_cast(us / MB); target["CountPatients"] = static_cast(db_->GetResourceCount(ResourceType_Patient)); target["CountStudies"] = static_cast(db_->GetResourceCount(ResourceType_Study));