提交 bc9e12ea 编写于 作者: M Mark VanderVoord

- Trying a very verbose method of incrementing the pointers

    - casting to a (void*) was giving warnings to some compilers about double casting
    - casting from a u8 to u16/32/64 was giving warnings about changing alignment requirements
上级 08ffed33
......@@ -514,8 +514,8 @@ void UnityAssertEqualIntArray(UNITY_PTR_ATTRIBUTE const void* expected,
const UNITY_DISPLAY_STYLE_T style)
{
_UU32 elements = num_elements;
UNITY_PTR_ATTRIBUTE const _US8* ptr_exp = (UNITY_PTR_ATTRIBUTE const _US8*)expected;
UNITY_PTR_ATTRIBUTE const _US8* ptr_act = (UNITY_PTR_ATTRIBUTE const _US8*)actual;
UNITY_PTR_ATTRIBUTE const void* ptr_exp = (UNITY_PTR_ATTRIBUTE const void*)expected;
UNITY_PTR_ATTRIBUTE const void* ptr_act = (UNITY_PTR_ATTRIBUTE const void*)actual;
UNITY_SKIP_EXECUTION;
......@@ -540,20 +540,20 @@ void UnityAssertEqualIntArray(UNITY_PTR_ATTRIBUTE const void* expected,
case UNITY_DISPLAY_STYLE_UINT8:
while (elements--)
{
if (*ptr_exp != *ptr_act)
if (*(UNITY_PTR_ATTRIBUTE const _US8*)ptr_exp != *(UNITY_PTR_ATTRIBUTE const _US8*)ptr_act)
{
UnityTestResultsFailBegin(lineNumber);
UnityPrint(UnityStrElement);
UnityPrintNumberByStyle((num_elements - elements - 1), UNITY_DISPLAY_STYLE_UINT);
UnityPrint(UnityStrExpected);
UnityPrintNumberByStyle(*ptr_exp, style);
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const _US8*)ptr_exp, style);
UnityPrint(UnityStrWas);
UnityPrintNumberByStyle(*ptr_act, style);
UnityPrintNumberByStyle(*(UNITY_PTR_ATTRIBUTE const _US8*)ptr_act, style);
UnityAddMsgIfSpecified(msg);
UNITY_FAIL_AND_BAIL;
}
ptr_exp += 1;
ptr_act += 1;
ptr_exp = (UNITY_PTR_ATTRIBUTE const void*)((_UP)ptr_exp + 1);
ptr_act = (UNITY_PTR_ATTRIBUTE const void*)((_UP)ptr_act + 1);
}
break;
case UNITY_DISPLAY_STYLE_HEX16:
......@@ -573,8 +573,8 @@ void UnityAssertEqualIntArray(UNITY_PTR_ATTRIBUTE const void* expected,
UnityAddMsgIfSpecified(msg);
UNITY_FAIL_AND_BAIL;
}
ptr_exp += 2;
ptr_act += 2;
ptr_exp = (UNITY_PTR_ATTRIBUTE const void*)((_UP)ptr_exp + 2);
ptr_act = (UNITY_PTR_ATTRIBUTE const void*)((_UP)ptr_act + 2);
}
break;
#ifdef UNITY_SUPPORT_64
......@@ -595,8 +595,8 @@ void UnityAssertEqualIntArray(UNITY_PTR_ATTRIBUTE const void* expected,
UnityAddMsgIfSpecified(msg);
UNITY_FAIL_AND_BAIL;
}
ptr_exp += 8;
ptr_act += 8;
ptr_exp = (UNITY_PTR_ATTRIBUTE const void*)((_UP)ptr_exp + 8);
ptr_act = (UNITY_PTR_ATTRIBUTE const void*)((_UP)ptr_act + 8);
}
break;
#endif
......@@ -615,8 +615,8 @@ void UnityAssertEqualIntArray(UNITY_PTR_ATTRIBUTE const void* expected,
UnityAddMsgIfSpecified(msg);
UNITY_FAIL_AND_BAIL;
}
ptr_exp += 4;
ptr_act += 4;
ptr_exp = (UNITY_PTR_ATTRIBUTE const void*)((_UP)ptr_exp + 4);
ptr_act = (UNITY_PTR_ATTRIBUTE const void*)((_UP)ptr_act + 4);
}
break;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册