mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-14 16:34:18 +09:00
[warnings] fix float/double warnings
This commit is contained in:
@@ -534,11 +534,11 @@ static void touch_handle_down(void* data, struct wl_touch* wl_touch, uint32_t se
|
||||
tdata->seat = seat;
|
||||
tdata->id = id;
|
||||
|
||||
float sx = wl_fixed_to_double(x_w);
|
||||
float sy = wl_fixed_to_double(y_w);
|
||||
double sx = wl_fixed_to_double(x_w);
|
||||
double sy = wl_fixed_to_double(y_w);
|
||||
|
||||
tdata->x = sx;
|
||||
tdata->y = sy;
|
||||
tdata->x = (wl_fixed_t)lround(sx);
|
||||
tdata->y = (wl_fixed_t)lround(sy);
|
||||
|
||||
#if 0
|
||||
struct widget *widget;
|
||||
@@ -644,11 +644,11 @@ static void touch_handle_motion(void* data, struct wl_touch* wl_touch, uint32_t
|
||||
tdata->seat = seat;
|
||||
tdata->id = id;
|
||||
|
||||
float sx = wl_fixed_to_double(x_w);
|
||||
float sy = wl_fixed_to_double(y_w);
|
||||
double sx = wl_fixed_to_double(x_w);
|
||||
double sy = wl_fixed_to_double(y_w);
|
||||
|
||||
tdata->x = sx;
|
||||
tdata->y = sy;
|
||||
tdata->x = (wl_fixed_t)lround(sx);
|
||||
tdata->y = (wl_fixed_t)lround(sy);
|
||||
|
||||
#if 0
|
||||
struct touch_point *tp;
|
||||
@@ -757,8 +757,8 @@ static void pointer_handle_enter(void* data, struct wl_pointer* pointer, uint32_
|
||||
|
||||
assert(input);
|
||||
|
||||
float sx = wl_fixed_to_double(sx_w);
|
||||
float sy = wl_fixed_to_double(sy_w);
|
||||
double sx = wl_fixed_to_double(sx_w);
|
||||
double sy = wl_fixed_to_double(sy_w);
|
||||
|
||||
if (!surface)
|
||||
{
|
||||
@@ -782,8 +782,8 @@ static void pointer_handle_enter(void* data, struct wl_pointer* pointer, uint32_
|
||||
|
||||
event->seat = input;
|
||||
event->window = window;
|
||||
event->x = sx;
|
||||
event->y = sy;
|
||||
event->x = (uint32_t)lround(sx);
|
||||
event->y = (uint32_t)lround(sy);
|
||||
|
||||
/* Apply cursor theme */
|
||||
set_cursor_image(input, serial);
|
||||
@@ -861,8 +861,8 @@ static void pointer_handle_button(void* data, struct wl_pointer* pointer, uint32
|
||||
|
||||
event->seat = seat;
|
||||
event->window = window;
|
||||
event->x = seat->sx;
|
||||
event->y = seat->sy;
|
||||
event->x = (uint32_t)lround(seat->sx);
|
||||
event->y = (uint32_t)lround(seat->sy);
|
||||
event->button = button;
|
||||
event->state = (enum wl_pointer_button_state)state_w;
|
||||
}
|
||||
@@ -885,8 +885,8 @@ static void pointer_handle_axis(void* data, struct wl_pointer* pointer, uint32_t
|
||||
|
||||
event->seat = seat;
|
||||
event->window = window;
|
||||
event->x = seat->sx;
|
||||
event->y = seat->sy;
|
||||
event->x = (uint32_t)lround(seat->sx);
|
||||
event->y = (uint32_t)lround(seat->sy);
|
||||
event->axis = axis;
|
||||
event->value = value;
|
||||
}
|
||||
@@ -957,8 +957,8 @@ static void pointer_axis_discrete(void* data, struct wl_pointer* wl_pointer, uin
|
||||
|
||||
event->seat = seat;
|
||||
event->window = window;
|
||||
event->x = seat->sx;
|
||||
event->y = seat->sy;
|
||||
event->x = (uint32_t)lround(seat->sx);
|
||||
event->y = (uint32_t)lround(seat->sy);
|
||||
event->axis = axis;
|
||||
event->value = discrete;
|
||||
}
|
||||
@@ -983,8 +983,8 @@ static void pointer_axis_value120(void* data, struct wl_pointer* wl_pointer, uin
|
||||
|
||||
event->seat = seat;
|
||||
event->window = window;
|
||||
event->x = seat->sx;
|
||||
event->y = seat->sy;
|
||||
event->x = (uint32_t)lround(seat->sx);
|
||||
event->y = (uint32_t)lround(seat->sy);
|
||||
event->axis = axis;
|
||||
event->value = value120 / 120;
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ struct uwac_seat
|
||||
|
||||
int repeat_timer_fd;
|
||||
UwacTask repeat_task;
|
||||
float sx, sy;
|
||||
double sx, sy;
|
||||
struct wl_list link;
|
||||
|
||||
void* data_context;
|
||||
|
||||
@@ -710,14 +710,19 @@ static void damage_surface(UwacWindow* window, UwacBuffer* buffer, int scale)
|
||||
static void damage_surface(UwacWindow* window, UwacBuffer* buffer, int scale)
|
||||
{
|
||||
uint32_t nrects = 0;
|
||||
const RECTANGLE_16* box = region16_rects(&buffer->damage, &nrects);
|
||||
const RECTANGLE_16* boxes = region16_rects(&buffer->damage, &nrects);
|
||||
|
||||
for (UINT32 i = 0; i < nrects; i++, box++)
|
||||
for (UINT32 i = 0; i < nrects; i++)
|
||||
{
|
||||
const int x = ((int)floor(box->left / scale)) - 1;
|
||||
const int y = ((int)floor(box->top / scale)) - 1;
|
||||
const int w = ((int)ceil((box->right - box->left) / scale)) + 2;
|
||||
const int h = ((int)ceil((box->bottom - box->top) / scale)) + 2;
|
||||
const RECTANGLE_16* box = &boxes[i];
|
||||
const double dx = floor(1.0 * box->left / scale);
|
||||
const double dy = floor(1.0 * box->top / scale);
|
||||
const double dw = ceil(1.0 * (box->right - box->left) / scale);
|
||||
const double dh = ceil(1.0 * (box->bottom - box->top) / scale);
|
||||
const int x = ((int)dx) - 1;
|
||||
const int y = ((int)dy) - 1;
|
||||
const int w = ((int)dw) + 2;
|
||||
const int h = ((int)dh) + 2;
|
||||
wl_surface_damage(window->surface, x, y, w, h);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user