From fece1c57cab1d148e15775f3e10ba474dcfc1360 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Thu, 1 Apr 2021 11:16:19 +0200 Subject: Codechange: Suppress warnings when asserts are disabled (#8917) --- src/tgp.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/tgp.cpp') diff --git a/src/tgp.cpp b/src/tgp.cpp index d86617ee2..39fda6e6b 100644 --- a/src/tgp.cpp +++ b/src/tgp.cpp @@ -658,7 +658,9 @@ static void HeightMapCurves(uint level) for (uint t = 0; t < lengthof(curve_maps); t++) { if (!HasBit(corner_bits, t)) continue; +#ifndef NDEBUG bool found = false; +#endif const control_point_t *cm = curve_maps[t].list; for (uint i = 0; i < curve_maps[t].length - 1; i++) { const control_point_t &p1 = cm[i]; @@ -666,7 +668,9 @@ static void HeightMapCurves(uint level) if (*h >= p1.x && *h < p2.x) { ht[t] = p1.y + (*h - p1.x) * (p2.y - p1.y) / (p2.x - p1.x); +#ifndef NDEBUG found = true; +#endif break; } } -- cgit v1.2.3-54-g00ecf