mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 16:10:41 -05:00
barrier/native: Fix warning about implicit enum conversion
Also add static asserts to make sure the values match so casting can be done. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2319>
This commit is contained in:
parent
ab21bedcfc
commit
79319a3a91
@ -26,6 +26,15 @@
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (MetaBarrier, meta_barrier, G_TYPE_OBJECT)
|
||||
G_DEFINE_TYPE (MetaBarrierImpl, meta_barrier_impl, G_TYPE_OBJECT)
|
||||
|
||||
G_STATIC_ASSERT ((int) META_BARRIER_DIRECTION_POSITIVE_X ==
|
||||
(int) META_BORDER_MOTION_DIRECTION_POSITIVE_X);
|
||||
G_STATIC_ASSERT ((int) META_BARRIER_DIRECTION_POSITIVE_Y ==
|
||||
(int) META_BORDER_MOTION_DIRECTION_POSITIVE_Y);
|
||||
G_STATIC_ASSERT ((int) META_BARRIER_DIRECTION_NEGATIVE_X ==
|
||||
(int) META_BORDER_MOTION_DIRECTION_NEGATIVE_X);
|
||||
G_STATIC_ASSERT ((int) META_BARRIER_DIRECTION_NEGATIVE_Y ==
|
||||
(int) META_BORDER_MOTION_DIRECTION_NEGATIVE_Y);
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
|
@ -109,8 +109,11 @@ static gboolean
|
||||
is_barrier_blocking_directions (MetaBarrier *barrier,
|
||||
MetaBarrierDirection directions)
|
||||
{
|
||||
MetaBorderMotionDirection border_motion_directions =
|
||||
(MetaBorderMotionDirection) directions;
|
||||
|
||||
return meta_border_is_blocking_directions (&barrier->priv->border,
|
||||
directions);
|
||||
border_motion_directions);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user