From 8d228090de252f4b69df69ce86b4f7e7a4b6cd21 Mon Sep 17 00:00:00 2001 From: Benjamin Nauck Date: Thu, 27 Mar 2025 19:50:28 +0100 Subject: [PATCH] Web: Use std::numeric_limits and std::numbers instead of defines --- src/Mod/Web/App/AppWeb.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Mod/Web/App/AppWeb.cpp b/src/Mod/Web/App/AppWeb.cpp index d89e3ef568..54b2a9ebbc 100644 --- a/src/Mod/Web/App/AppWeb.cpp +++ b/src/Mod/Web/App/AppWeb.cpp @@ -89,7 +89,7 @@ private: if (!PyArg_ParseTuple(args.ptr(), "|si", &addr, &port)) { throw Py::Exception(); } - if (port > USHRT_MAX) { + if (port > std::numeric_limits::max()) { throw Py::OverflowError("port number is greater than maximum"); } else if (port < 0) { @@ -121,7 +121,7 @@ private: if (!PyArg_ParseTuple(args.ptr(), "|sii", &addr, &port, &timeout)) { throw Py::Exception(); } - if (port > USHRT_MAX) { + if (port > std::numeric_limits::max()) { throw Py::OverflowError("port number is greater than maximum"); } else if (port < 0) {