From 2a8f3fe65a06b59681811370d9e20ecb7f9876fc Mon Sep 17 00:00:00 2001 From: Jonathan Reichelt Gjertsen Date: Fri, 3 Dec 2021 19:32:33 +0100 Subject: [PATCH] Try to fix C89 incompatibilities in UnityAssertGreaterOrLess(Double|Float) --- src/unity.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/unity.c b/src/unity.c index fab13a0..d9de692 100644 --- a/src/unity.c +++ b/src/unity.c @@ -1005,11 +1005,13 @@ void UnityAssertGreaterOrLessFloat(const UNITY_FLOAT threshold, const char* msg, const UNITY_LINE_TYPE lineNumber) { + int failed; + RETURN_IF_FAIL_OR_IGNORE; - int failed = 0; + failed = 0; - // Checking for "not success" rather than failure to get the right result for NaN + /* Checking for "not success" rather than failure to get the right result for NaN */ if (!(actual < threshold) && (compare & UNITY_SMALLER_THAN)) { failed = 1; } if (!(actual > threshold) && (compare & UNITY_GREATER_THAN)) { failed = 1; } @@ -1194,11 +1196,13 @@ void UnityAssertGreaterOrLessDouble(const UNITY_DOUBLE threshold, const char* msg, const UNITY_LINE_TYPE lineNumber) { + int failed; + RETURN_IF_FAIL_OR_IGNORE; - int failed = 0; + failed = 0; - // Checking for "not success" rather than failure to get the right result for NaN + /* Checking for "not success" rather than failure to get the right result for NaN */ if (!(actual < threshold) && (compare & UNITY_SMALLER_THAN)) { failed = 1; } if (!(actual > threshold) && (compare & UNITY_GREATER_THAN)) { failed = 1; }