Cleanup: Replace MIN/MAX macros with C++ functions

Use `std::min` and `std::max` instead. Though keep MIN2 and MAX2
just for C code that hasn't been moved to C++ yet.

Pull Request: https://projects.blender.org/blender/blender/pulls/117384
This commit is contained in:
Hans Goudey
2024-01-22 15:58:18 +01:00
committed by Hans Goudey
parent c478235985
commit 0618de49ad
138 changed files with 488 additions and 436 deletions

View File

@@ -6,6 +6,8 @@
* \ingroup pymathutils
*/
#include <algorithm>
#include <Python.h>
#include "mathutils.h"
@@ -517,7 +519,7 @@ static PyObject *Euler_slice(EulerObject *self, int begin, int end)
end = (EULER_SIZE + 1) + end;
}
CLAMP(end, 0, EULER_SIZE);
begin = MIN2(begin, end);
begin = std::min(begin, end);
tuple = PyTuple_New(end - begin);
for (count = begin; count < end; count++) {
@@ -542,7 +544,7 @@ static int Euler_ass_slice(EulerObject *self, int begin, int end, PyObject *seq)
end = (EULER_SIZE + 1) + end;
}
CLAMP(end, 0, EULER_SIZE);
begin = MIN2(begin, end);
begin = std::min(begin, end);
if ((size = mathutils_array_parse(eul, 0, EULER_SIZE, seq, "mathutils.Euler[begin:end] = []")) ==
-1)