[coap] enum type conversion to int in otCoapBlockSizeFromExponent (#4631)

This commit fixes an "enumerated type mixed with another enumerated
type" error during IAR compilation.
This commit is contained in:
Piotr Koziar
2020-03-06 20:06:09 -08:00
committed by GitHub
parent f9ad60600e
commit b99f8293f9
+2 -1
View File
@@ -112,7 +112,8 @@ otError otCoapMessageAppendUriPathOptions(otMessage *aMessage, const char *aUriP
uint16_t otCoapBlockSizeFromExponent(otCoapBlockSize aSize)
{
return static_cast<uint16_t>(1 << (aSize + Coap::Message::kBlockSzxBase));
return static_cast<uint16_t>(
1 << (static_cast<uint8_t>(aSize) + static_cast<uint8_t>(Coap::Message::kBlockSzxBase)));
}
otError otCoapMessageAppendBlock2Option(otMessage *aMessage, uint32_t aNum, bool aMore, otCoapBlockSize aSize)