Cleanup: avoid compiler warning when USE_BRUTE_FORCE_ASSERT is undefined

Avoid 'unused variable' compiler warning when `USE_BRUTE_FORCE_ASSERT` is
not defined, in release mode builds.

No functional changes.
This commit is contained in:
Sybren A. Stüvel
2024-02-19 17:14:49 +01:00
parent e3e1be21e5
commit 1ee414feb0

View File

@@ -232,6 +232,7 @@ int BLI_convexhull_2d(const float (*points)[2], const int points_num, int r_poin
/** \name Comupte AABB Fitting Angle (For Assertion)
* \{ */
#if defined(USE_BRUTE_FORCE_ASSERT) && !defined(NDEBUG)
static float convexhull_aabb_fit_hull_2d_brute_force(const float (*points_hull)[2],
int points_hull_num)
{
@@ -275,6 +276,7 @@ static float convexhull_aabb_fit_hull_2d_brute_force(const float (*points_hull)[
return (area_best != FLT_MAX) ? float(atan2(sincos_best[0], sincos_best[1])) : 0.0f;
}
#endif
/** \} */
@@ -401,16 +403,13 @@ static float convexhull_aabb_fit_hull_2d(const float (*points_hull)[2], int poin
const float angle = (area_best != FLT_MAX) ? float(atan2(sincos_best[0], sincos_best[1])) : 0.0f;
#ifdef USE_BRUTE_FORCE_ASSERT
if (true)
#else
if (false)
#endif
#if defined(USE_BRUTE_FORCE_ASSERT) && !defined(NDEBUG)
{
/* Ensure the optimized result matches the brute-force version. */
const float angle_test = convexhull_aabb_fit_hull_2d_brute_force(points_hull, points_hull_num);
BLI_assert(angle == angle_test);
}
#endif
return angle;
}