Merge pull request #4548 from deepikabhavnani/os_warn

Resolve Warnings for mbed-os-examples
pull/4736/head
Anna Bridge 2017-07-07 12:43:27 +01:00 committed by GitHub
commit 4890261c98
10 changed files with 30 additions and 26 deletions

View File

@ -26,7 +26,7 @@ static void donothing() {}
CAN::CAN(PinName rd, PinName td) : _can(), _irq() {
// No lock needed in constructor
for (int i = 0; i < sizeof _irq / sizeof _irq[0]; i++) {
for (size_t i = 0; i < sizeof _irq / sizeof _irq[0]; i++) {
_irq[i] = callback(donothing);
}
@ -37,7 +37,7 @@ CAN::CAN(PinName rd, PinName td) : _can(), _irq() {
CAN::CAN(PinName rd, PinName td, int hz) : _can(), _irq() {
// No lock needed in constructor
for (int i = 0; i < sizeof _irq / sizeof _irq[0]; i++) {
for (size_t i = 0; i < sizeof _irq / sizeof _irq[0]; i++) {
_irq[i].attach(donothing);
}

View File

@ -192,7 +192,7 @@ static void lpc_rxqueue_pbuf(struct lpc_enetdata *lpc_enetif, struct pbuf *p)
LPC_EMAC->RxConsumeIndex = idx;
LWIP_DEBUGF(UDP_LPC_EMAC | LWIP_DBG_TRACE,
("lpc_rxqueue_pbuf: pbuf packet queued: %p (free desc=%d)\n", p,
("lpc_rxqueue_pbuf: pbuf packet queued: %p (free desc=%"U32_F")\n", p,
lpc_enetif->rx_free_descs));
}
@ -215,7 +215,7 @@ s32_t lpc_rx_queue(struct netif *netif)
p = pbuf_alloc(PBUF_RAW, (u16_t) EMAC_ETH_MAX_FLEN, PBUF_RAM);
if (p == NULL) {
LWIP_DEBUGF(UDP_LPC_EMAC | LWIP_DBG_TRACE,
("lpc_rx_queue: could not allocate RX pbuf (free desc=%d)\n",
("lpc_rx_queue: could not allocate RX pbuf (free desc=%"U32_F")\n",
lpc_enetif->rx_free_descs));
return queued;
}
@ -341,7 +341,7 @@ static struct pbuf *lpc_low_level_input(struct netif *netif)
lpc_rxqueue_pbuf(lpc_enetif, p);
LWIP_DEBUGF(UDP_LPC_EMAC | LWIP_DBG_TRACE,
("lpc_low_level_input: Packet dropped with errors (0x%x)\n",
("lpc_low_level_input: Packet dropped with errors (%"X32_F")\n",
lpc_enetif->prxs[idx].statusinfo));
p = NULL;
@ -365,10 +365,10 @@ static struct pbuf *lpc_low_level_input(struct netif *netif)
/* Re-queue the pbuf for receive */
p->len = origLength;
lpc_rxqueue_pbuf(lpc_enetif, p);
lpc_rxqueue_pbuf(lpc_enetif, p);
LWIP_DEBUGF(UDP_LPC_EMAC | LWIP_DBG_TRACE,
("lpc_low_level_input: Packet index %d dropped for OOM\n",
("lpc_low_level_input: Packet index %"U32_F" dropped for OOM\n",
idx));
#ifdef LOCK_RX_THREAD
@ -381,7 +381,7 @@ static struct pbuf *lpc_low_level_input(struct netif *netif)
}
LWIP_DEBUGF(UDP_LPC_EMAC | LWIP_DBG_TRACE,
("lpc_low_level_input: Packet received: %p, size %d (index=%d)\n",
("lpc_low_level_input: Packet received: %p, size %"U32_F" (index=%"U32_F")\n",
p, length, idx));
/* Save size */
@ -479,7 +479,7 @@ static void lpc_tx_reclaim_st(struct lpc_enetdata *lpc_enetif, u32_t cidx)
while (cidx != lpc_enetif->lpc_last_tx_idx) {
if (lpc_enetif->txb[lpc_enetif->lpc_last_tx_idx] != NULL) {
LWIP_DEBUGF(UDP_LPC_EMAC | LWIP_DBG_TRACE,
("lpc_tx_reclaim_st: Freeing packet %p (index %d)\n",
("lpc_tx_reclaim_st: Freeing packet %p (index %"U32_F")\n",
lpc_enetif->txb[lpc_enetif->lpc_last_tx_idx],
lpc_enetif->lpc_last_tx_idx));
pbuf_free(lpc_enetif->txb[lpc_enetif->lpc_last_tx_idx]);
@ -646,8 +646,8 @@ static err_t lpc_low_level_output(struct netif *netif, struct pbuf *p)
}
LWIP_DEBUGF(UDP_LPC_EMAC | LWIP_DBG_TRACE,
("lpc_low_level_output: pbuf packet(%p) sent, chain#=%d,"
" size = %d (index=%d)\n", q->payload, dn, q->len, idx));
("lpc_low_level_output: pbuf packet(%p) sent, chain#=%"S32_F","
" size = %d (index=%"U32_F")\n", q->payload, dn, q->len, idx));
lpc_enetif->ptxd[idx].packet = (u32_t) q->payload;

View File

@ -2392,7 +2392,7 @@ static int32_t cfstore_delete_ex(cfstore_area_hkvt_t* hkvt)
memset(ctx->area_0_tail-kv_size, 0, kv_size);
/* The KV area has shrunk so a negative size_diff should be indicated to cfstore_file_update(). */
ret = cfstore_file_update(hkvt->head, -1 * kv_size);
ret = cfstore_file_update(hkvt->head, -1 *(int32_t)kv_size);
if(ret < ARM_DRIVER_OK){
CFSTORE_ERRLOG("%s:Error:file update failed\n", __func__);
goto out0;

View File

@ -105,7 +105,7 @@ time_t _rtc_mktime(const struct tm* time) {
}
if (result > INT32_MAX) {
return -1;
return (time_t) -1;
}
return result;

View File

@ -53,7 +53,7 @@ time_t time(time_t *timer)
}
}
time_t t = -1;
time_t t = (time_t)-1;
if (_rtc_read != NULL) {
t = _rtc_read();
}

View File

@ -402,7 +402,7 @@ static void (*callFlashCommonBitOperation)(FTFx_REG32_ACCESS_TYPE base,
* @endcode
* Note2: The binary code is generated by IAR 7.70.1
*/
const static uint16_t s_flashRunCommandFunctionCode[] = {
static const uint16_t s_flashRunCommandFunctionCode[] = {
0x2180, /* MOVS R1, #128 ; 0x80 */
0x7001, /* STRB R1, [R0] */
/* @4: */
@ -432,7 +432,7 @@ const static uint16_t s_flashRunCommandFunctionCode[] = {
* @endcode
* Note2: The binary code is generated by IAR 7.70.1
*/
const static uint16_t s_flashCommonBitOperationFunctionCode[] = {
static const uint16_t s_flashCommonBitOperationFunctionCode[] = {
0xb510, /* PUSH {R4, LR} */
0x2900, /* CMP R1, #0 */
0xd005, /* BEQ.N @12 */
@ -2734,11 +2734,12 @@ void flash_cache_clear(flash_config_t *config)
__DSB();
#endif /* FLASH_DRIVER_IS_FLASH_RESIDENT */
}
#if (defined(__GNUC__))
/* #pragma GCC pop_options */
#else
#if (defined(__CC_ARM))
#pragma pop
#endif
#if (defined(__GNUC__))
/* #pragma GCC pop_options */
#endif
#if FLASH_DRIVER_IS_FLASH_RESIDENT

View File

@ -158,4 +158,4 @@ void DisableDeepSleepIRQ(IRQn_Type interrupt)
DisableIRQ(interrupt); /* also disable interrupt at NVIC */
/* SYSCON->STARTERCLR[index] = 1u << intNumber; */
}
#endif /*CPU_QN908X */
#endif /*CPU_QN908X */

View File

@ -316,9 +316,8 @@ void ENET_Init(ENET_Type *base,
assert(bufferConfig->rxBufferAlign);
assert(macAddr);
uint32_t instance = ENET_GetInstance(base);
#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)
uint32_t instance = ENET_GetInstance(base);
/* Ungate ENET clock. */
CLOCK_EnableClock(s_enetClock[instance]);
#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */
@ -413,7 +412,7 @@ static void ENET_SetMacController(ENET_Type *base,
uint32_t tcr = 0;
uint32_t ecr = 0;
uint32_t macSpecialConfig = config->macSpecialConfig;
uint32_t instance = ENET_GetInstance(base);
ENET_GetInstance(base);
/* Configures MAC receive controller with user configure structure. */
rcr = ENET_RCR_NLC(!!(macSpecialConfig & kENET_ControlRxPayloadCheckEnable)) |

View File

@ -402,7 +402,7 @@ static void (*callFlashCommonBitOperation)(FTFx_REG32_ACCESS_TYPE base,
* @endcode
* Note2: The binary code is generated by IAR 7.70.1
*/
const static uint16_t s_flashRunCommandFunctionCode[] = {
static const uint16_t s_flashRunCommandFunctionCode[] = {
0x2180, /* MOVS R1, #128 ; 0x80 */
0x7001, /* STRB R1, [R0] */
/* @4: */
@ -432,7 +432,7 @@ const static uint16_t s_flashRunCommandFunctionCode[] = {
* @endcode
* Note2: The binary code is generated by IAR 7.70.1
*/
const static uint16_t s_flashCommonBitOperationFunctionCode[] = {
static const uint16_t s_flashCommonBitOperationFunctionCode[] = {
0xb510, /* PUSH {R4, LR} */
0x2900, /* CMP R1, #0 */
0xd005, /* BEQ.N @12 */
@ -2734,11 +2734,12 @@ void flash_cache_clear(flash_config_t *config)
__DSB();
#endif /* FLASH_DRIVER_IS_FLASH_RESIDENT */
}
#if (defined(__GNUC__))
/* #pragma GCC pop_options */
#else
#if (defined(__CC_ARM))
#pragma pop
#endif
#if (defined(__GNUC__))
/* #pragma GCC pop_options */
#endif
#if FLASH_DRIVER_IS_FLASH_RESIDENT

View File

@ -28,8 +28,11 @@ void hal_sleep(void)
void hal_deepsleep(void)
{
#if (defined(FSL_FEATURE_SOC_MCG_COUNT) && FSL_FEATURE_SOC_MCG_COUNT)
#if defined(kMCG_ModePEE)
mcg_mode_t mode = CLOCK_GetMode();
#endif
#endif
SMC_SetPowerModeProtection(SMC, kSMC_AllowPowerModeAll);
SMC_SetPowerModeVlps(SMC);