summaryrefslogtreecommitdiff
path: root/libavutil/intreadwrite.h
diff options
context:
space:
mode:
authorRoman Shaposhnik <roman@shaposhnik.org>2007-08-09 17:01:15 +0000
committerRoman Shaposhnik <roman@shaposhnik.org>2007-08-09 17:01:15 +0000
commit905694d96e9fe18298b1484946ce5966c64d1177 (patch)
tree734237e9b4c547fbb85decb66d9d0758607f535a /libavutil/intreadwrite.h
parent5c2198b1841fa451ace272128966a3facc8932ea (diff)
downloadffmpeg-905694d96e9fe18298b1484946ce5966c64d1177.tar.gz
* renaming (ST|LD)(16|32|64) -> AV_(R|W)N(16|32|64)
Originally committed as revision 10023 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/intreadwrite.h')
-rw-r--r--libavutil/intreadwrite.h72
1 files changed, 36 insertions, 36 deletions
diff --git a/libavutil/intreadwrite.h b/libavutil/intreadwrite.h
index 085aaadb9d..d6c1b67ffa 100644
--- a/libavutil/intreadwrite.h
+++ b/libavutil/intreadwrite.h
@@ -28,23 +28,23 @@ struct unaligned_64 { uint64_t l; } __attribute__((packed));
struct unaligned_32 { uint32_t l; } __attribute__((packed));
struct unaligned_16 { uint16_t l; } __attribute__((packed));
-#define LD16(a) (((const struct unaligned_16 *) (a))->l)
-#define LD32(a) (((const struct unaligned_32 *) (a))->l)
-#define LD64(a) (((const struct unaligned_64 *) (a))->l)
+#define AV_RN16(a) (((const struct unaligned_16 *) (a))->l)
+#define AV_RN32(a) (((const struct unaligned_32 *) (a))->l)
+#define AV_RN64(a) (((const struct unaligned_64 *) (a))->l)
-#define ST16(a, b) (((struct unaligned_16 *) (a))->l) = (b)
-#define ST32(a, b) (((struct unaligned_32 *) (a))->l) = (b)
-#define ST64(a, b) (((struct unaligned_64 *) (a))->l) = (b)
+#define AV_WN16(a, b) (((struct unaligned_16 *) (a))->l) = (b)
+#define AV_WN32(a, b) (((struct unaligned_32 *) (a))->l) = (b)
+#define AV_WN64(a, b) (((struct unaligned_64 *) (a))->l) = (b)
#else /* __GNUC__ */
-#define LD16(a) (*((uint16_t*)(a)))
-#define LD32(a) (*((uint32_t*)(a)))
-#define LD64(a) (*((uint64_t*)(a)))
+#define AV_RN16(a) (*((uint16_t*)(a)))
+#define AV_RN32(a) (*((uint32_t*)(a)))
+#define AV_RN64(a) (*((uint64_t*)(a)))
-#define ST16(a, b) *((uint16_t*)(a)) = (b)
-#define ST32(a, b) *((uint32_t*)(a)) = (b)
-#define ST64(a, b) *((uint64_t*)(a)) = (b)
+#define AV_WN16(a, b) *((uint16_t*)(a)) = (b)
+#define AV_WN32(a, b) *((uint32_t*)(a)) = (b)
+#define AV_WN64(a, b) *((uint64_t*)(a)) = (b)
#endif /* !__GNUC__ */
@@ -57,17 +57,17 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed));
#ifdef HAVE_FAST_UNALIGNED
# ifdef WORDS_BIGENDIAN
-# define AV_RB16(x) LD16(x)
-# define AV_WB16(p, d) ST16(p, d)
+# define AV_RB16(x) AV_RN16(x)
+# define AV_WB16(p, d) AV_WN16(p, d)
-# define AV_RL16(x) bswap_16(LD16(x))
-# define AV_WL16(p, d) ST16(p, bswap_16(d))
+# define AV_RL16(x) bswap_16(AV_RN16(x))
+# define AV_WL16(p, d) AV_WN16(p, bswap_16(d))
# else /* WORDS_BIGENDIAN */
-# define AV_RB16(x) bswap_16(LD16(x))
-# define AV_WB16(p, d) ST16(p, bswap_16(d))
+# define AV_RB16(x) bswap_16(AV_RN16(x))
+# define AV_WB16(p, d) AV_WN16(p, bswap_16(d))
-# define AV_RL16(x) LD16(x)
-# define AV_WL16(p, d) ST16(p, d)
+# define AV_RL16(x) AV_RN16(x)
+# define AV_WL16(p, d) AV_WN16(p, d)
# endif
#else /* HAVE_FAST_UNALIGNED */
#define AV_RB16(x) ((((uint8_t*)(x))[0] << 8) | ((uint8_t*)(x))[1])
@@ -100,17 +100,17 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed));
#ifdef HAVE_FAST_UNALIGNED
# ifdef WORDS_BIGENDIAN
-# define AV_RB32(x) LD32(x)
-# define AV_WB32(p, d) ST32(p, d)
+# define AV_RB32(x) AV_RN32(x)
+# define AV_WB32(p, d) AV_WN32(p, d)
-# define AV_RL32(x) bswap_32(LD32(x))
-# define AV_WL32(p, d) ST32(p, bswap_32(d))
+# define AV_RL32(x) bswap_32(AV_RN32(x))
+# define AV_WL32(p, d) AV_WN32(p, bswap_32(d))
# else /* WORDS_BIGENDIAN */
-# define AV_RB32(x) bswap_32(LD32(x))
-# define AV_WB32(p, d) ST32(p, bswap_32(d))
+# define AV_RB32(x) bswap_32(AV_RN32(x))
+# define AV_WB32(p, d) AV_WN32(p, bswap_32(d))
-# define AV_RL32(x) LD32(x)
-# define AV_WL32(p, d) ST32(p, d)
+# define AV_RL32(x) AV_RN32(x)
+# define AV_WL32(p, d) AV_WN32(p, d)
# endif
#else /* HAVE_FAST_UNALIGNED */
#define AV_RB32(x) ((((uint8_t*)(x))[0] << 24) | \
@@ -136,17 +136,17 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed));
#ifdef HAVE_FAST_UNALIGNED
# ifdef WORDS_BIGENDIAN
-# define AV_RB64(x) LD64(x)
-# define AV_WB64(p, d) ST64(p, d)
+# define AV_RB64(x) AV_RN64(x)
+# define AV_WB64(p, d) AV_WN64(p, d)
-# define AV_RL64(x) bswap_64(LD64(x))
-# define AV_WL64(p, d) ST64(p, bswap_64(d))
+# define AV_RL64(x) bswap_64(AV_RN64(x))
+# define AV_WL64(p, d) AV_WN64(p, bswap_64(d))
# else /* WORDS_BIGENDIAN */
-# define AV_RB64(x) bswap_64(LD64(x))
-# define AV_WB64(p, d) ST64(p, bswap_64(d))
+# define AV_RB64(x) bswap_64(AV_RN64(x))
+# define AV_WB64(p, d) AV_WN64(p, bswap_64(d))
-# define AV_RL64(x) LD64(x)
-# define AV_WL64(p, d) ST64(p, d)
+# define AV_RL64(x) AV_RN64(x)
+# define AV_WL64(p, d) AV_WN64(p, d)
# endif
#else /* HAVE_FAST_UNALIGNED */
#define AV_RB64(x) (((uint64_t)((uint8_t*)(x))[0] << 56) | \