[glib: 1/2] gdate: Fix tautological comparison warnings on Android
- From: Sebastian Dröge <sdroege src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 1/2] gdate: Fix tautological comparison warnings on Android
- Date: Thu, 26 Sep 2019 07:59:36 +0000 (UTC)
commit 00c04fdec64d605fa6f142c0d8048bcb5dbd567c
Author: Philip Withnall <withnall endlessm com>
Date: Wed Sep 25 15:17:37 2019 +0100
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>
glib/gdate.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/glib/gdate.c b/glib/gdate.c
index 26b3f598e..b867ba9db 100644
--- a/glib/gdate.c
+++ b/glib/gdate.c
@@ -420,7 +420,7 @@ static const guint16 days_in_year[2][14] =
gboolean
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
g_date_valid_weekday (GDateWeekday w)
{
- return ( (w > G_DATE_BAD_WEEKDAY) && (w < 8) );
+ return (((gint) w > G_DATE_BAD_WEEKDAY) && ((gint) w < 8));
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]