From 8c532400eaf2b23eba50e69b57b471e6d56e5cae Mon Sep 17 00:00:00 2001 From: anod <182859762@qq.com> Date: Tue, 11 Oct 2022 20:52:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E7=BC=96=E8=AF=91=E5=99=A8?= =?UTF-8?q?=E7=9A=84warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/arm11/atp.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/arm11/atp.c b/source/arm11/atp.c index 2e88527..d9c6dc6 100644 --- a/source/arm11/atp.c +++ b/source/arm11/atp.c @@ -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;