Web: Use std::numeric_limits and std::numbers instead of defines
This commit is contained in:
@@ -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<unsigned short>::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<unsigned short>::max()) {
|
||||
throw Py::OverflowError("port number is greater than maximum");
|
||||
}
|
||||
else if (port < 0) {
|
||||
|
||||
Reference in New Issue
Block a user