fix warnings

This commit is contained in:
lixianjing 2021-09-16 17:31:41 +08:00
parent 02ffad87c1
commit 1a021e1223
5 changed files with 18 additions and 15 deletions

View File

@ -419,17 +419,17 @@ static uint32_t s_chat_bubble_curr_len = 0;
static ret_t add_char_to_chat_bubble(const timer_info_t* timer) {
widget_t* lb_chat_bubble = timer->ctx;
str_t str;
wstr_t str;
return_value_if_fail(lb_chat_bubble != NULL, RET_REMOVE);
str_init(&str, s_chat_bubble_curr_len);
wstr_init(&str, s_chat_bubble_curr_len);
if (s_chat_bubble_curr_len > 0) {
str_append_with_len(&str, s_chat_bubble, s_chat_bubble_curr_len);
wstr_set_utf8_with_len(&str, s_chat_bubble, s_chat_bubble_curr_len);
} else {
str_append(&str, " ");
wstr_set_utf8(&str, " ");
}
widget_set_text_utf8(lb_chat_bubble, str.str);
str_reset(&str);
widget_set_text(lb_chat_bubble, str.str);
wstr_reset(&str);
s_chat_bubble_curr_len = (s_chat_bubble_curr_len + 1) % (s_chat_bubble_len + 1);
@ -1029,8 +1029,10 @@ static ret_t on_page_switch(void* ctx, event_t* e) {
#endif /* ENABLE_PAGE_SWITCH */
static ret_t on_page_enter(void* ctx, event_t* e) {
widget_t* page = WIDGET(e->target);
#if defined(ENABLE_PAGE_SWITCH) && ENABLE_PAGE_SWITCH
widget_t* scroll_view = NULL;
#endif /* ENABLE_PAGE_SWITCH */
widget_t* page = WIDGET(e->target);
page_enter_func_t enter_func = (page_enter_func_t)ctx;
return_value_if_fail(page != NULL, RET_BAD_PARAMS);

View File

@ -38,8 +38,8 @@ uint32_t tk_mem_speed_test(void* buffer, uint32_t length, uint32_t* pmemcpy_spee
uint32_t i = 0;
uint32_t cost = 0;
uint32_t total_cost = 0;
uint32_t memcpy_speed;
uint32_t memset_speed;
uint32_t memcpy_speed = 0;
uint32_t memset_speed = 0;
uint32_t max_size = 100 * 1024 * 1024;
uint64_t start = time_now_ms();
uint32_t nr = max_size / length;

View File

@ -9,7 +9,7 @@
</view>
</view>
</view>
<view name="view_rt" h="350" children_layout="default(r=0,c=1,x=0,y=0,s=13)">
<view name="view_rt" h="357" children_layout="default(r=0,c=1,x=0,y=0,s=13)">
<hscroll_label h="22" style="title" loop="true" yoyo="true" tr_text="Rich Text"/>
<view h="-22" children_layout="default(r=1,c=0,x=20,y=0,s=10)">
<view w="280">

View File

@ -9,6 +9,7 @@
* 补充新demoui键盘中文翻译修改kb\_foo样式感谢兆坤提供补丁
* 修复gtest编译警告感谢智明提供补丁
* 修复编译警告(感谢智明和兆坤提供补丁)
* 修复编译demoui警告感谢兆坤提供补丁
2021/09/14
* 根据新增接口,完善 object\_array 以及 object\_default感谢雨欣提供补丁

View File

@ -1,5 +1,5 @@
/**
* File: mledit.h
* File: mledit.c
* Author: AWTK Develop Team
* Brief: mledit
*
@ -958,9 +958,9 @@ static slist_t* mledit_get_rows_by_text(widget_t* widget, slist_t* slist, const
for (i = 0; i < text_size; i++) {
if (i + 1 < text_size && TWINS_CHAR_IS_LINE_BREAK(text[i], text[i + 1])) {
i++;
slist_append(slist, (void*)(int64_t)(i + 1));
slist_append(slist, tk_pointer_from_int((int32_t)(i + 1)));
} else if (CHAR_IS_LINE_BREAK(text[i])) {
slist_append(slist, (void*)(int64_t)(i + 1));
slist_append(slist, tk_pointer_from_int((int32_t)(i + 1)));
}
}
@ -981,7 +981,7 @@ ret_t mledit_insert_text(widget_t* widget, uint32_t offset, const char* text) {
if (mledit_get_rows_by_text(widget, &offset_list, text) != NULL) {
uint32_t text_size = tk_strlen(text);
if (mledit->max_lines == 1) {
rows_start_offset = (uint32_t)(int64_t)slist_tail_pop(&offset_list);
rows_start_offset = (uint32_t)tk_pointer_to_int(slist_tail_pop(&offset_list));
if (rows_start_offset < text_size) {
wstr_reset(&widget->text);
@ -990,7 +990,7 @@ ret_t mledit_insert_text(widget_t* widget, uint32_t offset, const char* text) {
} else {
slist_node_t* iter = offset_list.first;
while (ret == RET_OK && iter != NULL) {
uint32_t rows_end_offset = (uint32_t)(int64_t)iter->data;
uint32_t rows_end_offset = (uint32_t)tk_pointer_to_int(iter->data);
ret = text_edit_overwrite_text(mledit->model, &offset, text + rows_start_offset,
rows_end_offset - rows_start_offset);