mirror of
https://github.com/espressif/openthread.git
synced 2026-09-08 02:00:12 +00:00
[clang-tidy] fix bugprone-too-small-loop-variable warnings (#9321)
This commit is contained in:
@@ -132,7 +132,7 @@ void test_packed_alignment(void)
|
||||
packedStruct.mByte = 0xfe;
|
||||
packedStruct.mUint16 = 0xabcd;
|
||||
|
||||
for (uint16_t start = 0; start < sizeof(PackedStruct); start++)
|
||||
for (size_t start = 0; start < sizeof(PackedStruct); start++)
|
||||
{
|
||||
uint8_t *ptr = &buffer[start];
|
||||
|
||||
@@ -140,14 +140,14 @@ void test_packed_alignment(void)
|
||||
|
||||
*reinterpret_cast<PackedStruct *>(ptr) = packedStruct;
|
||||
|
||||
for (uint16_t i = 0; i < start; i++)
|
||||
for (size_t i = 0; i < start; i++)
|
||||
{
|
||||
VerifyOrQuit(buffer[i] == 0, "OT_TOOL_PACKED alignment failed - pre-size write");
|
||||
}
|
||||
|
||||
VerifyOrQuit(memcmp(ptr, packedStructBytes, sizeof(PackedStruct)) == 0, "OT_TOOL_PACKED alignment failed");
|
||||
|
||||
for (uint16_t i = start + sizeof(packedStruct); i < sizeof(buffer); i++)
|
||||
for (size_t i = start + sizeof(packedStruct); i < sizeof(buffer); i++)
|
||||
{
|
||||
VerifyOrQuit(buffer[i] == 0, "OT_TOOL_PACKED alignment failed - post-size write");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user