From: <tho...@fr...> - 2005-10-10 17:05:31
|
CVS Root: /cvs/gstreamer Module: gstreamer Changes by: thomasvs Date: Mon Oct 10 2005 10:05:16 PDT Log message: another cast bites the dust Modified files: gst : gstutils.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstutils.c.diff?r1=1.98&r2=1.99 ====Begin Diffs==== Index: gstutils.c =================================================================== RCS file: /cvs/gstreamer/gstreamer/gst/gstutils.c,v retrieving revision 1.98 retrieving revision 1.99 diff -u -d -r1.98 -r1.99 --- gstutils.c 10 Oct 2005 16:45:45 -0000 1.98 +++ gstutils.c 10 Oct 2005 17:05:04 -0000 1.99 @@ -310,8 +310,19 @@ else return (gdouble) ((gint64) value); } + +static gdouble +gdouble_to_guint64 (gdouble value) +{ + if (value < (gdouble) 9223372036854775808.) /* 1 << 63 */ + return ((guint64) ((gint64) value)); + value -= 9223372036854775808.; + return ((guint64) ((gint64) value)) + 1LL << 63; +} #else -#define guint64_to_gdouble(value) ((gdouble) value) +#define gdouble_to_guint64(value) ((guint64) (value)) +#define guint64_to_gdouble(value) ((gdouble) (value)) #endif /** |