mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-11 20:06:18 +01:00
Fix always false statement warning in glib/gdatetime.c
glib/gdatetime.c:896:27: warning: comparison is always false due to limited range of data type if ((gint64) tv->tv_sec > G_MAXINT64 - 1 || ^
This commit is contained in:
parent
32b4c53295
commit
33c2968669
@ -893,8 +893,9 @@ static GDateTime *
|
|||||||
g_date_time_new_from_timeval (GTimeZone *tz,
|
g_date_time_new_from_timeval (GTimeZone *tz,
|
||||||
const GTimeVal *tv)
|
const GTimeVal *tv)
|
||||||
{
|
{
|
||||||
if ((gint64) tv->tv_sec > G_MAXINT64 - 1 ||
|
gint64 tv_sec = tv->tv_sec;
|
||||||
!UNIX_TO_INSTANT_IS_VALID ((gint64) tv->tv_sec + 1))
|
|
||||||
|
if (tv_sec > G_MAXINT64 - 1 || !UNIX_TO_INSTANT_IS_VALID (tv_sec + 1))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return g_date_time_from_instant (tz, tv->tv_usec +
|
return g_date_time_from_instant (tz, tv->tv_usec +
|
||||||
|
Loading…
Reference in New Issue
Block a user