From 61314db79d19a255ca2f735b7f1faf85eb72deca Mon Sep 17 00:00:00 2001 From: Paul Fd Date: Sun, 15 Mar 2020 10:43:42 +0100 Subject: [PATCH] do while trick on debug --- src/sfizz/Curve.cpp | 5 ++--- src/sfizz/Debug.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/sfizz/Curve.cpp b/src/sfizz/Curve.cpp index b54807ec..ee9c5af2 100644 --- a/src/sfizz/Curve.cpp +++ b/src/sfizz/Curve.cpp @@ -223,11 +223,10 @@ void CurveSet::addCurveFromHeader(absl::Span members) Curve::Interpolator itp = Curve::Interpolator::Linear; if (const Opcode* opc = findOpcode(hash("curve_index"))) { - if (auto opt = readOpcode(opc->value, {0, 255})) { + if (auto opt = readOpcode(opc->value, {0, 255})) curveIndex = *opt; - } else { + else DBG("Invalid value for curve index: " << opc->value); - } } #if 0 // potential sfizz extension diff --git a/src/sfizz/Debug.h b/src/sfizz/Debug.h index 6ef5a8b7..72d239bc 100644 --- a/src/sfizz/Debug.h +++ b/src/sfizz/Debug.h @@ -45,7 +45,7 @@ ASSERTFALSE // Debug message -#define DBG(ostream) std::cerr << ostream << '\n' +#define DBG(ostream) do { std::cerr << ostream << '\n'; } while (0) #else // NDEBUG