提交 3588e5b6 编写于 作者: C Crt Mori

Aligning definition and declaration of UnityPrintFloat

There was a mismatch of definition and declaration of UnityPrintFloat
and this commit aligns both on const UNITY_DOUBLE, but then inside it
actually uses a positive version of the variable only.
上级 ff03e1c9
...@@ -269,12 +269,17 @@ static void UnityPrintDecimalAndNumberWithLeadingZeros(UNITY_INT32 fraction_part ...@@ -269,12 +269,17 @@ static void UnityPrintDecimalAndNumberWithLeadingZeros(UNITY_INT32 fraction_part
* else snprintf(buf, sizeof buf, "%.6f", number); * else snprintf(buf, sizeof buf, "%.6f", number);
* UnityPrint(buf); * UnityPrint(buf);
*/ */
void UnityPrintFloat(UNITY_DOUBLE number) void UnityPrintFloat(const UNITY_DOUBLE input_number)
{ {
if (number < 0) UNITY_DOUBLE number;
if (input_number < 0)
{ {
UNITY_OUTPUT_CHAR('-'); UNITY_OUTPUT_CHAR('-');
number = -number; number = -input_number;
} else
{
number = input_number;
} }
if (isnan(number)) UnityPrint(UnityStrNaN); if (isnan(number)) UnityPrint(UnityStrNaN);
......
...@@ -427,7 +427,7 @@ void UnityPrintNumberUnsigned(const UNITY_UINT number); ...@@ -427,7 +427,7 @@ void UnityPrintNumberUnsigned(const UNITY_UINT number);
void UnityPrintNumberHex(const UNITY_UINT number, const char nibbles); void UnityPrintNumberHex(const UNITY_UINT number, const char nibbles);
#ifndef UNITY_EXCLUDE_FLOAT_PRINT #ifndef UNITY_EXCLUDE_FLOAT_PRINT
void UnityPrintFloat(const UNITY_DOUBLE number); void UnityPrintFloat(const UNITY_DOUBLE input_number);
#endif #endif
/*------------------------------------------------------- /*-------------------------------------------------------
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册