Use casting when printing value that may be of a different type

The stat struct could use whatever type for st_* fields.
This commit is contained in:
Andrea Mazzoleni 2017-10-27 22:54:42 +02:00
parent 57a1df44a4
commit 61a1e7a7e6
7 changed files with 14 additions and 14 deletions

View file

@ -34,11 +34,11 @@
/* Check if we have nanoseconds support */
#if HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
#define STAT_NSEC(st) (st)->st_mtim.tv_nsec /* Linux */
#define STAT_NSEC(st) ((int)(st)->st_mtim.tv_nsec) /* Linux */
#elif HAVE_STRUCT_STAT_ST_MTIMENSEC
#define STAT_NSEC(st) (st)->st_mtimensec /* NetBSD */
#define STAT_NSEC(st) ((int)(st)->st_mtimensec) /* NetBSD */
#elif HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC
#define STAT_NSEC(st) (st)->st_mtimespec.tv_nsec /* FreeBSD, Mac OS X */
#define STAT_NSEC(st) ((int)(st)->st_mtimespec.tv_nsec) /* FreeBSD, Mac OS X */
#else
#define STAT_NSEC(st) STAT_NSEC_INVALID
#endif