Skip to content

Commit

Permalink
fix build warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
xianjimli committed Dec 3, 2023
1 parent 36a37f6 commit 98bcda3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
8 changes: 4 additions & 4 deletions src/remote_ui/service/remote_ui_service.c
Original file line number Diff line number Diff line change
Expand Up @@ -860,8 +860,8 @@ static ret_t remote_ui_service_dispatch_impl(remote_ui_service_t* ui, tk_msg_hea
case EVT_POINTER_UP:
case EVT_POINTER_MOVE: {
pointer_event_t evt;
int x = 0;
int y = 0;
int32_t x = 0;
int32_t y = 0;

rbuffer_read_int32(&rb, &x);
rbuffer_read_int32(&rb, &y);
Expand Down Expand Up @@ -889,8 +889,8 @@ static ret_t remote_ui_service_dispatch_impl(remote_ui_service_t* ui, tk_msg_hea
break;
}
case REMOTE_UI_MOVE_WIDGET: {
int x = 0;
int y = 0;
int32_t x = 0;
int32_t y = 0;
widget_t* widget = NULL;
const char* target = NULL;

Expand Down
4 changes: 0 additions & 4 deletions src/tkc/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,11 +703,7 @@ int32_t tk_wstricmp(const wchar_t* a, const wchar_t* b) {
return 1;
}

#ifdef MINGW
return wcs_case_cmp(a, b);
#else
return wcscasecmp(a, b);
#endif
}

char* tk_str_copy(char* dst, const char* src) {
Expand Down
10 changes: 5 additions & 5 deletions src/widgets/pages.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,14 +270,14 @@ static ret_t pages_on_remove_child(widget_t* widget, widget_t* child) {

if (!widget->destroying) {
widget_t* active = NULL;
int32_t index = (int32_t)(pages->active);
int32_t active_index = (int32_t)(pages->active);
int32_t remove_index = widget_index_of(child);
bool_t is_last = remove_index == (widget->children->size - 1);
return_value_if_fail(remove_index >= 0, RET_BAD_PARAMS);
active = widget_get_child(widget, pages->active);
if (remove_index < index ||
(remove_index == active && remove_index == widget->children->size - 1)) {
index = tk_max(index - 1, 0);
pages_set_active(widget, index);
if (remove_index < active_index || (remove_index == active_index && is_last)) {
active_index = tk_max(active_index - 1, 0);
pages_set_active(widget, active_index);
}
if (active != widget_get_child(widget, pages->active)) {
widget_dispatch_simple_event(widget, EVT_PAGE_CHANGED);
Expand Down

0 comments on commit 98bcda3

Please sign in to comment.