Use glib macros for byte order conversion.
authorDavid I. Lehn <dlehn@users.sourceforge.net>
Wed, 21 Feb 2001 20:58:09 +0000 (20:58 +0000)
committerDavid I. Lehn <dlehn@users.sourceforge.net>
Wed, 21 Feb 2001 20:58:09 +0000 (20:58 +0000)
Original commit message from CVS:
Use glib macros for byte order conversion.

libs/getbits/gstgetbits.h
libs/getbits/gstgetbits_inl.h

index 7e56796..79b29f3 100644 (file)
 #include <sse.h>
 #endif /* HAVE_LIBSSE */
 
-#ifdef WORDS_BIGENDIAN
-#  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
+#define swab32(x) GUINT32_FROM_BE(x)
 
 typedef struct _gst_getbits_t gst_getbits_t;
 typedef void (*GstGetbitsCallback) (gst_getbits_t *gb, void *data);
index 2e025c7..0fcbc3b 100644 (file)
 #define checklength2(src, dst)
 #endif
 
-#ifdef WORDS_BIGENDIAN
-#  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
+#define swab32(x) GUINT32_FROM_BE(x)
 
 /* External declarations for bitstream i/o operations. */
 extern unsigned long gst_getbits_nBitMask[];