Deprecate GTimeVal- and GTime-based APIs
On OpenBSD time_t
is defined as a 64 bit type on all our platforms __int64_t __time_t;
(long long
). Subsequently struct timeval
is defined as:
struct timeval {
time_t tv_sec; /* seconds */
suseconds_t tv_usec; /* and microseconds */
}
(suseconds_t
is a long
)
Comparing this against GLib's GTimeVal
:
struct _GTimeVal
{
glong tv_sec;
glong tv_usec;
};
This means that a GTimeVal.tv_sec
is smaller than the OS-level counterpart and leads to various compilation warnings. Such as:
../gcab-1.0/src/gcab.c:201:41: warning: incompatible pointer types passing 'glong *' (aka 'long *') to parameter of type 'const time_t *' (aka 'const long long *') [-Wincompatible-pointer-types]
tm = localtime (&tv.tv_sec);
^~~~~~~~~~
/usr/include/time.h:129:36: note: passing argument to parameter here
struct tm *localtime(const time_t *);
^
1 warning generated.
Also note that GTime
is defined as a gint32
. How should we go about addressing this issue in a matter?
Edited by Philip Withnall