mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
d26f1a07cf
commit
bc35aadc20
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue