Use glib macros for byte order conversion.

Original commit message from CVS:
Use glib macros for byte order conversion.
This commit is contained in:
David I. Lehn 2001-02-21 20:58:09 +00:00
parent da7eb8492f
commit 608eaa3d42
2 changed files with 2 additions and 32 deletions

View file

@ -17,22 +17,7 @@
#include <sse.h> #include <sse.h>
#endif /* HAVE_LIBSSE */ #endif /* HAVE_LIBSSE */
#ifdef WORDS_BIGENDIAN #define swab32(x) GUINT32_FROM_BE(x)
# define swab32(x) (x)
#else
# if defined (__i386__)
# define swab32(x) __i386_swab32(x)
static inline const unsigned long __i386_swab32(unsigned long x)
{
__asm__("bswap %0" : "=r" (x) : "0" (x));
return x;
}
# else
# define swab32(x)\
((((guint8*)&x)[0] << 24) | (((guint8*)&x)[1] << 16) | \
(((guint8*)&x)[2] << 8) | (((guint8*)&x)[3]))
# endif
#endif
typedef struct _gst_getbits_t gst_getbits_t; typedef struct _gst_getbits_t gst_getbits_t;
typedef void (*GstGetbitsCallback) (gst_getbits_t *gb, void *data); typedef void (*GstGetbitsCallback) (gst_getbits_t *gb, void *data);

View file

@ -73,22 +73,7 @@
#define checklength2(src, dst) #define checklength2(src, dst)
#endif #endif
#ifdef WORDS_BIGENDIAN #define swab32(x) GUINT32_FROM_BE(x)
# define swab32(x) (x)
#else
# if defined (__i386__)
# define swab32(x) __i386_swab32(x)
static inline const guint32 __i386_swab32(guint32 x)
{
__asm__("bswap %0" : "=r" (x) : "0" (x));
return x;
}
# else
# define swab32(x)\
((((guint8*)&x)[0] << 24) | (((guint8*)&x)[1] << 16) | \
(((guint8*)&x)[2] << 8) | (((guint8*)&x)[3]))
# endif
#endif
/* External declarations for bitstream i/o operations. */ /* External declarations for bitstream i/o operations. */
extern unsigned long gst_getbits_nBitMask[]; extern unsigned long gst_getbits_nBitMask[];