gdate: Fix tautological comparison warnings on Android

Android is emitting `-Wtautological-constant-out-of-range-compare`
warnings when compiling the validation functions for the enum types for
`GDate`. Fix that by comparing as integers.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
Philip Withnall 2019-09-25 15:17:37 +01:00
parent 02a7af780b
commit 00c04fdec6

View File

@ -420,7 +420,7 @@ static const guint16 days_in_year[2][14] =
gboolean gboolean
g_date_valid_month (GDateMonth m) g_date_valid_month (GDateMonth m)
{ {
return ( (m > G_DATE_BAD_MONTH) && (m < 13) ); return (((gint) m > G_DATE_BAD_MONTH) && ((gint) m < 13));
} }
/** /**
@ -466,7 +466,7 @@ g_date_valid_day (GDateDay d)
gboolean gboolean
g_date_valid_weekday (GDateWeekday w) g_date_valid_weekday (GDateWeekday w)
{ {
return ( (w > G_DATE_BAD_WEEKDAY) && (w < 8) ); return (((gint) w > G_DATE_BAD_WEEKDAY) && ((gint) w < 8));
} }
/** /**