mirror of
https://github.com/openharmony/third_party_unity.git
synced 2026-07-21 04:05:28 -04:00
Get the 2's compliment of the unsigned int number when printing results without relying on problematic recasting of a negated int. (see #439)
This commit is contained in:
+1
-1
@@ -327,7 +327,7 @@ void UnityPrintNumber(const UNITY_INT number_to_print)
|
||||
{
|
||||
/* A negative number, including MIN negative */
|
||||
UNITY_OUTPUT_CHAR('-');
|
||||
number = (UNITY_UINT)-number_to_print;
|
||||
number = (~number) + 1;
|
||||
}
|
||||
UnityPrintNumberUnsigned(number);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user