summaryrefslogtreecommitdiffstats
path: root/gst-libs/gst/floatcast
diff options
context:
space:
mode:
authorThomas Vander Stichele <thomas@apestaart.org>2004-03-14 22:34:33 +0000
committerThomas Vander Stichele <thomas@apestaart.org>2004-03-14 22:34:33 +0000
commit7a778ee4b7ec09a1f5b2185c9cceee3910dfbdf2 (patch)
treef863b467dea9559a6ec9c48affbfae11f8104164 /gst-libs/gst/floatcast
parenta19db4bbdc4a15ea0d8f4d28e9a1302c9c3d1657 (diff)
downloadgst-plugins-bad-7a778ee4b7ec09a1f5b2185c9cceee3910dfbdf2.tar.gz
gst-plugins-bad-7a778ee4b7ec09a1f5b2185c9cceee3910dfbdf2.tar.bz2
gst-plugins-bad-7a778ee4b7ec09a1f5b2185c9cceee3910dfbdf2.zip
gst-indent
Original commit message from CVS: gst-indent
Diffstat (limited to 'gst-libs/gst/floatcast')
-rw-r--r--gst-libs/gst/floatcast/floatcast.h57
1 files changed, 24 insertions, 33 deletions
diff --git a/gst-libs/gst/floatcast/floatcast.h b/gst-libs/gst/floatcast/floatcast.h
index ae87a43f..2951a810 100644
--- a/gst-libs/gst/floatcast/floatcast.h
+++ b/gst-libs/gst/floatcast/floatcast.h
@@ -29,53 +29,46 @@
#include <glib/gtypes.h>
G_BEGIN_DECLS
-
#if (HAVE_LRINT && HAVE_LRINTF)
-
- /* These defines enable functionality introduced with the 1999 ISO C
- ** standard. They must be defined before the inclusion of math.h to
- ** engage them. If optimisation is enabled, these functions will be
- ** inlined. With optimisation switched off, you have to link in the
- ** maths library using -lm.
- */
-
- #define _ISOC9X_SOURCE 1
- #define _ISOC99_SOURCE 1
-
- #define __USE_ISOC9X 1
- #define __USE_ISOC99 1
-
- #include <math.h>
-
- #define gst_cast_float(x) ((gint)lrintf(x))
- #define gst_cast_double(x) ((gint)lrint(x))
-
+ /* These defines enable functionality introduced with the 1999 ISO C
+ ** standard. They must be defined before the inclusion of math.h to
+ ** engage them. If optimisation is enabled, these functions will be
+ ** inlined. With optimisation switched off, you have to link in the
+ ** maths library using -lm.
+ */
+#define _ISOC9X_SOURCE 1
+#define _ISOC99_SOURCE 1
+#define __USE_ISOC9X 1
+#define __USE_ISOC99 1
+#include <math.h>
+#define gst_cast_float(x) ((gint)lrintf(x))
+#define gst_cast_double(x) ((gint)lrint(x))
#else
- /* use a standard c cast, but do rounding correctly */
- #define gst_cast_float(x) ((gint)floor((x)+0.5))
- #define gst_cast_double(x) ((gint)floor((x)+0.5))
-
+ /* use a standard c cast, but do rounding correctly */
+#define gst_cast_float(x) ((gint)floor((x)+0.5))
+#define gst_cast_double(x) ((gint)floor((x)+0.5))
#endif
-
inline static gfloat
-GFLOAT_SWAP_LE_BE(gfloat in)
+GFLOAT_SWAP_LE_BE (gfloat in)
{
gint32 swap;
gfloat out;
- memcpy(&swap, &in, 4);
+
+ memcpy (&swap, &in, 4);
swap = GUINT32_SWAP_LE_BE_CONSTANT (swap);
- memcpy(&out, &swap, 4);
+ memcpy (&out, &swap, 4);
return out;
}
inline static gdouble
-GDOUBLE_SWAP_LE_BE(gdouble in)
+GDOUBLE_SWAP_LE_BE (gdouble in)
{
gint64 swap;
gdouble out;
- memcpy(&swap, &in, 8);
+
+ memcpy (&swap, &in, 8);
swap = GUINT64_SWAP_LE_BE_CONSTANT (swap);
- memcpy(&out, &swap, 8);
+ memcpy (&out, &swap, 8);
return out;
}
@@ -101,6 +94,4 @@ GDOUBLE_SWAP_LE_BE(gdouble in)
#define GDOUBLE_FROM_BE(val) (GDOUBLE_TO_BE (val))
G_END_DECLS
-
#endif /* __FLOATCAST_H__ */
-