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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user