mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2025-12-20 04:40:07 +01:00
libweston/matrix: Fix narrow conversion with C++
Fixes the following C++ narrow conversion:
/include/libweston-14/libweston/matrix.h: In function ‘weston_coord
weston_coord_truncate(weston_coord)’:
/include/libweston-14/libweston/matrix.h:212:39: error: narrowing
conversion of ‘(int)in.weston_coord::x’ from ‘int’ to ‘double’
[-Werror=narrowing] 212 | return (struct weston_coord){
(int)in.x, (int)in.y };
| ^~~~~~~~~
/home/mvlad/install-new/include/libweston-14/libweston/matrix.h:212:50:
error: narrowing conversion of ‘(int)in.weston_coord::y’ from ‘int’ to
‘double’ [-Werror=narrowing] 212 | return (struct weston_coord){
(int)in.x, (int)in.y };
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
(cherry picked from commit a501acd291)
This commit is contained in:
parent
502e4bd31d
commit
7eaba52a22
1 changed files with 1 additions and 1 deletions
|
|
@ -209,7 +209,7 @@ weston_coord_surface_sub(struct weston_coord_surface a,
|
|||
static inline struct weston_coord __attribute__ ((warn_unused_result))
|
||||
weston_coord_truncate(struct weston_coord in)
|
||||
{
|
||||
return (struct weston_coord){ (int)in.x, (int)in.y };
|
||||
return (struct weston_coord){ (double)(int) in.x, (double)(int) in.y };
|
||||
}
|
||||
|
||||
static inline struct weston_coord_surface __attribute__ ((warn_unused_result))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue