From c173771ed2f8e1bfa309e7deca11ba1dbb60c810 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 5 Apr 2017 16:32:38 +0300 Subject: [PATCH] gst: Use GstClockTimeDiff instead of GstClockTime as type for GST_SECOND and friends They were (signed!) gint64 before because of G_GINT64_CONSTANT() already and they are actually used in signed calculations. With this change we at least ensure that an integer type of the correct size is used for GI (it was using gint before). --- gst/gstclock.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/gst/gstclock.h b/gst/gstclock.h index ea9682eb62..7bd7604e7d 100644 --- a/gst/gstclock.h +++ b/gst/gstclock.h @@ -95,31 +95,30 @@ typedef gpointer GstClockID; */ #define GST_CLOCK_STIME_IS_VALID(time) (((GstClockTimeDiff)(time)) != GST_CLOCK_STIME_NONE) -/* FIXME: still need to explicitly force types on the defines below */ /** - * GST_SECOND: (value 1000000000) (type GstClockTime) + * GST_SECOND: (value 1000000000) (type GstClockTimeDiff) * * Constant that defines one GStreamer second. */ -#define GST_SECOND ((GstClockTime)(G_USEC_PER_SEC * G_GINT64_CONSTANT (1000))) +#define GST_SECOND ((GstClockTimeDiff)(G_USEC_PER_SEC * G_GINT64_CONSTANT (1000))) /** - * GST_MSECOND: (value 1000000) (type GstClockTime) + * GST_MSECOND: (value 1000000) (type GstClockTimeDiff) * * Constant that defines one GStreamer millisecond. */ -#define GST_MSECOND ((GstClockTime)(GST_SECOND / G_GINT64_CONSTANT (1000))) +#define GST_MSECOND ((GstClockTimeDiff)(GST_SECOND / G_GINT64_CONSTANT (1000))) /** - * GST_USECOND: (value 1000) (type GstClockTime) + * GST_USECOND: (value 1000) (type GstClockTimeDiff) * * Constant that defines one GStreamer microsecond. */ -#define GST_USECOND ((GstClockTime)(GST_SECOND / G_GINT64_CONSTANT (1000000))) +#define GST_USECOND ((GstClockTimeDiff)(GST_SECOND / G_GINT64_CONSTANT (1000000))) /** - * GST_NSECOND: (value 1) (type GstClockTime) + * GST_NSECOND: (value 1) (type GstClockTimeDiff) * * Constant that defines one GStreamer nanosecond */ -#define GST_NSECOND ((GstClockTime)(GST_SECOND / G_GINT64_CONSTANT (1000000000))) +#define GST_NSECOND ((GstClockTimeDiff)(GST_SECOND / G_GINT64_CONSTANT (1000000000))) /**