diff options
author | Johan Dahlin <johan@gnome.org> | 2004-03-15 16:32:54 +0000 |
---|---|---|
committer | Johan Dahlin <johan@gnome.org> | 2004-03-15 16:32:54 +0000 |
commit | 39fd8a2dbd436cbabe5e336d1145b62c2a885ed5 (patch) | |
tree | 61df7da4a9d2b8bdb853af50a27219a8921bf5e4 /gst-libs/gst/floatcast | |
parent | 1633bd8693c54cbc5f6648703a7ecf01548ec55f (diff) | |
download | gst-plugins-bad-39fd8a2dbd436cbabe5e336d1145b62c2a885ed5.tar.gz gst-plugins-bad-39fd8a2dbd436cbabe5e336d1145b62c2a885ed5.tar.bz2 gst-plugins-bad-39fd8a2dbd436cbabe5e336d1145b62c2a885ed5.zip |
*.h: Revert indenting
Original commit message from CVS:
* *.h: Revert indenting
Diffstat (limited to 'gst-libs/gst/floatcast')
-rw-r--r-- | gst-libs/gst/floatcast/floatcast.h | 57 |
1 files changed, 33 insertions, 24 deletions
diff --git a/gst-libs/gst/floatcast/floatcast.h b/gst-libs/gst/floatcast/floatcast.h index 2951a810..ae87a43f 100644 --- a/gst-libs/gst/floatcast/floatcast.h +++ b/gst-libs/gst/floatcast/floatcast.h @@ -29,46 +29,53 @@ #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; } @@ -94,4 +101,6 @@ GDOUBLE_SWAP_LE_BE (gdouble in) #define GDOUBLE_FROM_BE(val) (GDOUBLE_TO_BE (val)) G_END_DECLS + #endif /* __FLOATCAST_H__ */ + |