Mercurial > hg > orthanc-education
changeset 77:80b663d5f8fe default tip
replaced boost::math::iround() by Orthanc::Math::llround()
| author | Sebastien Jodogne <s.jodogne@gmail.com> |
|---|---|
| date | Tue, 27 Jan 2026 17:05:03 +0100 |
| parents | e1670bd75c1c |
| children | |
| files | Sources/EducationRestApi.cpp Sources/Security/JWT.cpp |
| diffstat | 2 files changed, 5 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/Sources/EducationRestApi.cpp Tue Jan 06 16:59:46 2026 +0100 +++ b/Sources/EducationRestApi.cpp Tue Jan 27 17:05:03 2026 +0100 @@ -33,6 +33,7 @@ #include "ProjectPermissionContext.h" #include "RestApiRouter.h" +#include <CompatibilityMath.h> #include <Images/Image.h> #include <Images/ImageProcessing.h> #include <MultiThreading/Semaphore.h> @@ -41,7 +42,6 @@ #include <TemporaryFile.h> #include <boost/algorithm/string/predicate.hpp> -#include <boost/math/special_functions/round.hpp> #include <boost/regex.hpp> #include <cassert> @@ -596,8 +596,8 @@ const float ratio = std::min(static_cast<float>(target.GetWidth()) / static_cast<float>(thumbnail.GetWidth()), static_cast<float>(target.GetHeight()) / static_cast<float>(thumbnail.GetHeight())); - thumbnail.Resize(static_cast<unsigned int>(boost::math::llround(static_cast<float>(thumbnail.GetWidth()) * ratio)), - static_cast<unsigned int>(boost::math::llround(static_cast<float>(thumbnail.GetHeight()) * ratio)), + thumbnail.Resize(static_cast<unsigned int>(Orthanc::Math::llround(static_cast<float>(thumbnail.GetWidth()) * ratio)), + static_cast<unsigned int>(Orthanc::Math::llround(static_cast<float>(thumbnail.GetHeight()) * ratio)), true /* smooth by default */); unsigned int offsetX = (target.GetWidth() - thumbnail.GetWidth()) / 2;
--- a/Sources/Security/JWT.cpp Tue Jan 06 16:59:46 2026 +0100 +++ b/Sources/Security/JWT.cpp Tue Jan 27 17:05:03 2026 +0100 @@ -27,11 +27,10 @@ #include "../HttpToolbox.h" #include "SecurityConstants.h" +#include <CompatibilityMath.h> #include <SerializationToolbox.h> #include <Toolbox.h> -#include <boost/math/special_functions/round.hpp> - JWT::JWT(const std::string& jwt) { @@ -85,7 +84,7 @@ // The "exp" field can be either an integer or decimal, so we // deal with the worst case of a double const double doubleExp = payload_[FIELD_EXP].asDouble(); - const int64_t exp = static_cast<int64_t>(boost::math::llround(doubleExp)); + const int64_t exp = static_cast<int64_t>(Orthanc::Math::llround(doubleExp)); const int64_t now = time(NULL); return now < exp; }
