提交 437c474b 编写于 作者: J jsalling

Put back (char) casts, better formatting

上级 48033506
......@@ -190,7 +190,8 @@ void UnityPrintNumberHex(const UNITY_UINT number, const char nibbles_to_print)
{
int nibble;
char nibbles = nibbles_to_print;
if ((unsigned)nibbles > 2 * sizeof number) nibbles = 2 * sizeof number;
if ((unsigned)nibbles > (2 * sizeof(number)))
nibbles = 2 * sizeof(number);
while (nibbles > 0)
{
......@@ -198,11 +199,11 @@ void UnityPrintNumberHex(const UNITY_UINT number, const char nibbles_to_print)
nibble = (number >> (nibbles * 4)) & 0x0F;
if (nibble <= 9)
{
UNITY_OUTPUT_CHAR('0' + nibble);
UNITY_OUTPUT_CHAR((char)('0' + nibble));
}
else
{
UNITY_OUTPUT_CHAR('A' - 10 + nibble);
UNITY_OUTPUT_CHAR((char)('A' - 10 + nibble));
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册