mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2025-06-24 08:37:33 +08:00
Merge pull request #257 from Letme/master
Align definition and declaration of UnityPrintFloat
This commit is contained in:
11
src/unity.c
11
src/unity.c
@ -269,12 +269,17 @@ static void UnityPrintDecimalAndNumberWithLeadingZeros(UNITY_INT32 fraction_part
|
||||
* else snprintf(buf, sizeof buf, "%.6f", number);
|
||||
* 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('-');
|
||||
number = -number;
|
||||
number = -input_number;
|
||||
} else
|
||||
{
|
||||
number = input_number;
|
||||
}
|
||||
|
||||
if (isnan(number)) UnityPrint(UnityStrNaN);
|
||||
|
@ -427,7 +427,7 @@ void UnityPrintNumberUnsigned(const UNITY_UINT number);
|
||||
void UnityPrintNumberHex(const UNITY_UINT number, const char nibbles);
|
||||
|
||||
#ifndef UNITY_EXCLUDE_FLOAT_PRINT
|
||||
void UnityPrintFloat(const UNITY_DOUBLE number);
|
||||
void UnityPrintFloat(const UNITY_DOUBLE input_number);
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user