mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 04:36:20 +00:00
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
This commit is contained in:
parent
2153c45964
commit
0d129e5757
2 changed files with 22 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
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>
|
2005-10-10 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
* check/Makefile.am:
|
* 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:
|
* gst_util_uint64_scale:
|
||||||
* @val: the number to scale
|
* @val: the number to scale
|
||||||
|
@ -313,7 +328,7 @@ guint64
|
||||||
gst_util_uint64_scale (guint64 val, guint64 num, guint64 denom)
|
gst_util_uint64_scale (guint64 val, guint64 num, guint64 denom)
|
||||||
{
|
{
|
||||||
/* implement me with fixed point, if you care */
|
/* implement me with fixed point, if you care */
|
||||||
return val * (((double) num) / denom);
|
return val * ((guint64_to_gdouble (num)) / denom);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -----------------------------------------------------
|
/* -----------------------------------------------------
|
||||||
|
|
Loading…
Reference in a new issue