trivial: replace macro cube() by inline function/template

Avoids funky side effects. The old version would have failed
horribly for innocent invocations such as "cube(a+b)" or
"cube(++a)".

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-12-13 17:45:05 +01:00 committed by bstoeger
parent d26f1a07cf
commit bc35aadc20

View file

@ -28,7 +28,11 @@
#include "planner.h"
#include "qthelper.h"
#define cube(x) (x * x * x)
template <typename T>
T cube(T x)
{
return x * x * x;
}
// Subsurface until v4.6.2 appeared to produce marginally less conservative plans than our benchmarks.
// This factor was used to correct this. Since a fix for the saturation and desaturation rates