mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-09-02 00:10:00 +00:00
Fix warning with ubsan and -Wconversion
This fixes a compiler warning about a lossy conversion from long unsigned int to int when compiling unity with gcc 6.3.1 and the options -std=c89 -Wconversion -fsanitize=undefined
This commit is contained in:
+1
-1
@@ -194,7 +194,7 @@ void UnityPrintNumberHex(const UNITY_UINT number, const char nibbles_to_print)
|
|||||||
while (nibbles > 0)
|
while (nibbles > 0)
|
||||||
{
|
{
|
||||||
nibbles--;
|
nibbles--;
|
||||||
nibble = (number >> (nibbles * 4)) & 0x0F;
|
nibble = (int)(number >> (nibbles * 4)) & 0x0F;
|
||||||
if (nibble <= 9)
|
if (nibble <= 9)
|
||||||
{
|
{
|
||||||
UNITY_OUTPUT_CHAR((char)('0' + nibble));
|
UNITY_OUTPUT_CHAR((char)('0' + nibble));
|
||||||
|
|||||||
Reference in New Issue
Block a user