Commit 0d129e57 authored by Thomas Vander Stichele's avatar Thomas Vander Stichele
Browse files

gst/gstutils.c: apparently converting from guint64 to double is not implemented on MSVC

Original commit message from CVS:

* gst/gstutils.c: (guint64_to_gdouble), (gst_util_uint64_scale):
apparently converting from guint64 to double is not implemented
on MSVC
parent 2153c459
2005-10-10 Thomas Vander Stichele <thomas at apestaart dot org>
* gst/gstutils.c: (guint64_to_gdouble), (gst_util_uint64_scale):
apparently converting from guint64 to double is not implemented
on MSVC
2005-10-10 Wim Taymans <wim@fluendo.com>
* check/Makefile.am:
......
......@@ -299,6 +299,21 @@ gst_util_set_object_arg (GObject * object, const gchar * name,
}
}
#ifdef WIN32
/* work around error C2520: conversion from unsigned __int64 to double
* not implemented, use signed __int64 */
static gdouble
guint64_to_gdouble (guint64 value)
{
if (value & 0x8000000000000000)
return (gdouble) ((gint64) value) + (gdouble) 18446744073709551616.;
else
return (gdouble) ((gint64) value);
}
#else
#define guint64_to_gdouble(value) ((gdouble) value)
#endif
/**
* gst_util_uint64_scale:
* @val: the number to scale
......@@ -313,7 +328,7 @@ guint64
gst_util_uint64_scale (guint64 val, guint64 num, guint64 denom)
{
/* implement me with fixed point, if you care */
return val * (((double) num) / denom);
return val * ((guint64_to_gdouble (num)) / denom);
}
/* -----------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment