[sd_log] Fix compiler warning

This commit is contained in:
Michal Podhradsky
2017-02-10 17:33:50 -08:00
parent 316c45b501
commit 48fa641f15
@@ -76,9 +76,11 @@ int32_t msgqueue_send(MsgQueue *que, void *msg, const uint16_t msgLen,
int32_t msgqueue_send_timeout(MsgQueue *que, void *msg, const uint16_t msgLen,
const MsgQueueUrgency urgency, const systime_t timout)
{
const MsgPtrLen mpl = {.ptrOfst = (uint32_t) msg - (uint32_t) tlsf_get_heap_addr(&MSGQ_HEAP),
.len = msgLen
};
// this code prevents compiler warning about a missing initializer of mpl
MsgPtrLen m;
m.len = msgLen;
m.ptrOfst = (uint32_t) msg - (uint32_t) tlsf_get_heap_addr(&MSGQ_HEAP);
const MsgPtrLen mpl = m;
#if CH_DBG_ENABLE_CHECKS
if (((uint32_t) msg < (uint32_t) tlsf_get_heap_addr(&MSGQ_HEAP)) ||