修正编译器的warning

This commit is contained in:
anod 2022-10-11 20:52:15 +08:00
parent b5e07bc5e5
commit 8c532400ea

View File

@ -158,10 +158,11 @@ static atp_error_t title_paint( atp_callerdata_t datain, atp_counter_t idx, atp_
{
void **data = (void**)datain;
atp_text_t title = *(atp_text_t*)data[0];
uint8_t *title_offset = *(uint8_t*)data[1];
for( int i=0; i < idx; ++i )
uint8_t *title_offset = *(uint8_t**)data[1];
for( atp_counter_t i=0; i < idx; ++i )
title += title_offset[i];
config->text = title;
return ATP_SUCCESS;
}
static void draw_one_option( int index, int selected, int row, atp_itemprovider_t provider, atp_callerdata_t data )
@ -271,8 +272,8 @@ atp_error_t atp_select( atp_text_t title, atp_counter_t cnt, atp_itemprovider_t
int sel = item_sel + (key&KEY_DOWN ? 1 : -1);
// 更新item_sel
if( sel >= cnt ) sel = 0;
else if( sel < 0 ) sel = cnt-1;
if( sel >= (int0cnt ) sel = 0;
else if( sel < 0 ) sel = (int)cnt-1;
// 更新idx_top
int top = title_len + sel;