mirror of
https://github.com/espressif/openthread.git
synced 2026-09-15 21:50:08 +00:00
Fix compiler warnings in unit tests. (#488)
This commit is contained in:
@@ -83,7 +83,7 @@ void TestLowpanIphc(void)
|
||||
Message *message = NULL;
|
||||
|
||||
uint8_t result[1500];
|
||||
unsigned resultLength = 0;
|
||||
uint16_t resultLength = 0;
|
||||
|
||||
Mac::Address macSource;
|
||||
Mac::Address macDest;
|
||||
@@ -112,7 +112,7 @@ void TestLowpanIphc(void)
|
||||
|
||||
Mac::Frame frame;
|
||||
frame.mPsdu = iphcVector.data();
|
||||
frame.mLength = iphcVector.size();
|
||||
frame.mLength = static_cast<uint8_t>(iphcVector.size());
|
||||
frame.GetSrcAddr(macSource);
|
||||
frame.GetDstAddr(macDest);
|
||||
|
||||
@@ -126,7 +126,7 @@ void TestLowpanIphc(void)
|
||||
frame.GetPayloadLength(), 0);
|
||||
|
||||
uint16_t ip6PayloadLength = frame.GetPayloadLength() -
|
||||
decompressedBytes;
|
||||
static_cast<uint16_t>(decompressedBytes);
|
||||
SuccessOrQuit(message->Append(frame.GetPayload() + decompressedBytes,
|
||||
ip6PayloadLength),
|
||||
"6lo: Message::Append failed");
|
||||
@@ -150,7 +150,7 @@ void TestLowpanIphc(void)
|
||||
printf("Compressed OpenThread:\n");
|
||||
otTestPrintHex(result, compressBytes);
|
||||
|
||||
VerifyOrQuit(memcmp(frame.GetPayload(), result, compressBytes) == 0,
|
||||
VerifyOrQuit(memcmp(frame.GetPayload(), result, static_cast<size_t>(compressBytes)) == 0,
|
||||
"6lo: Lowpan::Compress failed");
|
||||
|
||||
SuccessOrQuit(Message::Free(*message), "6lo: Message:Free failed");
|
||||
|
||||
Reference in New Issue
Block a user