From b99f8293f92c00400b32504f46d7598575ac5891 Mon Sep 17 00:00:00 2001 From: Piotr Koziar <44554861+piotrkoziar@users.noreply.github.com> Date: Sat, 7 Mar 2020 05:06:09 +0100 Subject: [PATCH] [coap] enum type conversion to int in otCoapBlockSizeFromExponent (#4631) This commit fixes an "enumerated type mixed with another enumerated type" error during IAR compilation. --- src/core/api/coap_api.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/api/coap_api.cpp b/src/core/api/coap_api.cpp index a7809120b..3900b22b1 100644 --- a/src/core/api/coap_api.cpp +++ b/src/core/api/coap_api.cpp @@ -112,7 +112,8 @@ otError otCoapMessageAppendUriPathOptions(otMessage *aMessage, const char *aUriP uint16_t otCoapBlockSizeFromExponent(otCoapBlockSize aSize) { - return static_cast(1 << (aSize + Coap::Message::kBlockSzxBase)); + return static_cast( + 1 << (static_cast(aSize) + static_cast(Coap::Message::kBlockSzxBase))); } otError otCoapMessageAppendBlock2Option(otMessage *aMessage, uint32_t aNum, bool aMore, otCoapBlockSize aSize)