UI: Fix compiler warning

uint32_t is unsigned long on 32-bit ARM and unsigned on 64-bit x64.
Add type specifier to avoid having warnings when compiling on Linux
This commit is contained in:
Federico Amedeo Izzo 2021-01-24 16:27:50 +01:00
parent bec69dc440
commit bc88247809
1 changed files with 16 additions and 16 deletions

View File

@ -75,13 +75,13 @@ void _ui_drawVFOMiddle(state_t* last_state)
// Print VFO frequencies
char freq_buf[20] = "";
snprintf(freq_buf, sizeof(freq_buf), " Rx:%03lu.%05lu",
last_state->channel.rx_frequency/1000000,
last_state->channel.rx_frequency%1000000/10);
(unsigned long)last_state->channel.rx_frequency/1000000,
(unsigned long)last_state->channel.rx_frequency%1000000/10);
gfx_print(layout.line2_left, freq_buf, layout.line2_font, TEXT_ALIGN_CENTER,
color_white);
snprintf(freq_buf, sizeof(freq_buf), " Tx:%03lu.%05lu",
last_state->channel.tx_frequency/1000000,
last_state->channel.tx_frequency%1000000/10);
(unsigned long)last_state->channel.tx_frequency/1000000,
(unsigned long)last_state->channel.tx_frequency%1000000/10);
gfx_print(layout.line3_left, freq_buf, layout.line3_font, TEXT_ALIGN_CENTER,
color_white);
}
@ -94,13 +94,13 @@ void _ui_drawMEMMiddle(state_t* last_state)
// Print Channel frequencies
char freq_buf[20] = "";
snprintf(freq_buf, sizeof(freq_buf), " Rx:%03lu.%05lu",
last_state->channel.rx_frequency/1000000,
last_state->channel.rx_frequency%1000000/10);
(unsigned long)last_state->channel.rx_frequency/1000000,
(unsigned long)last_state->channel.rx_frequency%1000000/10);
gfx_print(layout.line2_left, freq_buf, layout.line2_font, TEXT_ALIGN_CENTER,
color_white);
snprintf(freq_buf, sizeof(freq_buf), " Tx:%03lu.%05lu",
last_state->channel.tx_frequency/1000000,
last_state->channel.tx_frequency%1000000/10);
(unsigned long)last_state->channel.tx_frequency/1000000,
(unsigned long)last_state->channel.tx_frequency%1000000/10);
gfx_print(layout.line3_left, freq_buf, layout.line3_font, TEXT_ALIGN_CENTER,
color_white);
}
@ -118,8 +118,8 @@ void _ui_drawVFOMiddleInput(state_t* last_state, ui_state_t* ui_state)
if(ui_state->input_position == 0)
{
snprintf(freq_buf, sizeof(freq_buf), ">Rx:%03lu.%05lu",
ui_state->new_rx_frequency/1000000,
ui_state->new_rx_frequency%1000000/10);
(unsigned long)ui_state->new_rx_frequency/1000000,
(unsigned long)ui_state->new_rx_frequency%1000000/10);
gfx_print(layout.line2_left, freq_buf, layout.line2_font, TEXT_ALIGN_CENTER,
color_white);
}
@ -133,24 +133,24 @@ void _ui_drawVFOMiddleInput(state_t* last_state, ui_state_t* ui_state)
color_white);
}
snprintf(freq_buf, sizeof(freq_buf), " Tx:%03lu.%05lu",
last_state->channel.tx_frequency/1000000,
last_state->channel.tx_frequency%1000000/10);
(unsigned long)last_state->channel.tx_frequency/1000000,
(unsigned long)last_state->channel.tx_frequency%1000000/10);
gfx_print(layout.line3_left, freq_buf, layout.line3_font, TEXT_ALIGN_CENTER,
color_white);
}
else if(ui_state->input_set == SET_TX)
{
snprintf(freq_buf, sizeof(freq_buf), " Rx:%03lu.%05lu",
ui_state->new_rx_frequency/1000000,
ui_state->new_rx_frequency%1000000/10);
(unsigned long)ui_state->new_rx_frequency/1000000,
(unsigned long)ui_state->new_rx_frequency%1000000/10);
gfx_print(layout.line2_left, freq_buf, layout.line2_font, TEXT_ALIGN_CENTER,
color_white);
// Replace Rx frequency with underscorses
if(ui_state->input_position == 0)
{
snprintf(freq_buf, sizeof(freq_buf), ">Tx:%03lu.%05lu",
ui_state->new_rx_frequency/1000000,
ui_state->new_rx_frequency%1000000/10);
(unsigned long)ui_state->new_rx_frequency/1000000,
(unsigned long)ui_state->new_rx_frequency%1000000/10);
gfx_print(layout.line3_left, freq_buf, layout.line3_font, TEXT_ALIGN_CENTER,
color_white);
}