Commit 9930fe8f authored by mru's avatar mru

cosmetics: reformat intreadwrite.h

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19659 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent daad53f5
...@@ -55,12 +55,6 @@ ...@@ -55,12 +55,6 @@
# define AV_WN16(p, v) AV_WB16(p, v) # define AV_WN16(p, v) AV_WB16(p, v)
# endif # endif
# if defined(AV_RN32) && !defined(AV_RB32)
# define AV_RB32(p) AV_RN32(p)
# elif !defined(AV_RN32) && defined(AV_RB32)
# define AV_RN32(p) AV_RB32(p)
# endif
# if defined(AV_RN24) && !defined(AV_RB24) # if defined(AV_RN24) && !defined(AV_RB24)
# define AV_RB24(p) AV_RN24(p) # define AV_RB24(p) AV_RN24(p)
# elif !defined(AV_RN24) && defined(AV_RB24) # elif !defined(AV_RN24) && defined(AV_RB24)
...@@ -73,6 +67,12 @@ ...@@ -73,6 +67,12 @@
# define AV_WN24(p, v) AV_WB24(p, v) # define AV_WN24(p, v) AV_WB24(p, v)
# endif # endif
# if defined(AV_RN32) && !defined(AV_RB32)
# define AV_RB32(p) AV_RN32(p)
# elif !defined(AV_RN32) && defined(AV_RB32)
# define AV_RN32(p) AV_RB32(p)
# endif
# if defined(AV_WN32) && !defined(AV_WB32) # if defined(AV_WN32) && !defined(AV_WB32)
# define AV_WB32(p, v) AV_WN32(p, v) # define AV_WB32(p, v) AV_WN32(p, v)
# elif !defined(AV_WN32) && defined(AV_WB32) # elif !defined(AV_WN32) && defined(AV_WB32)
...@@ -105,12 +105,6 @@ ...@@ -105,12 +105,6 @@
# define AV_WN16(p, v) AV_WL16(p, v) # define AV_WN16(p, v) AV_WL16(p, v)
# endif # endif
# if defined(AV_RN32) && !defined(AV_RL32)
# define AV_RL32(p) AV_RN32(p)
# elif !defined(AV_RN32) && defined(AV_RL32)
# define AV_RN32(p) AV_RL32(p)
# endif
# if defined(AV_RN24) && !defined(AV_RL24) # if defined(AV_RN24) && !defined(AV_RL24)
# define AV_RL24(p) AV_RN24(p) # define AV_RL24(p) AV_RN24(p)
# elif !defined(AV_RN24) && defined(AV_RL24) # elif !defined(AV_RN24) && defined(AV_RL24)
...@@ -123,6 +117,12 @@ ...@@ -123,6 +117,12 @@
# define AV_WN24(p, v) AV_WL24(p, v) # define AV_WN24(p, v) AV_WL24(p, v)
# endif # endif
# if defined(AV_RN32) && !defined(AV_RL32)
# define AV_RL32(p) AV_RN32(p)
# elif !defined(AV_RN32) && defined(AV_RL32)
# define AV_RN32(p) AV_RL32(p)
# endif
# if defined(AV_WN32) && !defined(AV_WL32) # if defined(AV_WN32) && !defined(AV_WL32)
# define AV_WL32(p, v) AV_WN32(p, v) # define AV_WL32(p, v) AV_WN32(p, v)
# elif !defined(AV_WN32) && defined(AV_WL32) # elif !defined(AV_WN32) && defined(AV_WL32)
...@@ -170,55 +170,64 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed)); ...@@ -170,55 +170,64 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed));
#else #else
#ifndef AV_RB16 #ifndef AV_RB16
#define AV_RB16(x) ((((const uint8_t*)(x))[0] << 8) | \ # define AV_RB16(x) \
((((const uint8_t*)(x))[0] << 8) | \
((const uint8_t*)(x))[1]) ((const uint8_t*)(x))[1])
#endif #endif
#ifndef AV_WB16 #ifndef AV_WB16
#define AV_WB16(p, d) do { \ # define AV_WB16(p, d) do { \
((uint8_t*)(p))[1] = (d); \ ((uint8_t*)(p))[1] = (d); \
((uint8_t*)(p))[0] = (d)>>8; } while(0) ((uint8_t*)(p))[0] = (d)>>8; \
} while(0)
#endif #endif
#ifndef AV_RL16 #ifndef AV_RL16
#define AV_RL16(x) ((((const uint8_t*)(x))[1] << 8) | \ # define AV_RL16(x) \
((((const uint8_t*)(x))[1] << 8) | \
((const uint8_t*)(x))[0]) ((const uint8_t*)(x))[0])
#endif #endif
#ifndef AV_WL16 #ifndef AV_WL16
#define AV_WL16(p, d) do { \ # define AV_WL16(p, d) do { \
((uint8_t*)(p))[0] = (d); \ ((uint8_t*)(p))[0] = (d); \
((uint8_t*)(p))[1] = (d)>>8; } while(0) ((uint8_t*)(p))[1] = (d)>>8; \
} while(0)
#endif #endif
#ifndef AV_RB32 #ifndef AV_RB32
#define AV_RB32(x) ((((const uint8_t*)(x))[0] << 24) | \ # define AV_RB32(x) \
((((const uint8_t*)(x))[0] << 24) | \
(((const uint8_t*)(x))[1] << 16) | \ (((const uint8_t*)(x))[1] << 16) | \
(((const uint8_t*)(x))[2] << 8) | \ (((const uint8_t*)(x))[2] << 8) | \
((const uint8_t*)(x))[3]) ((const uint8_t*)(x))[3])
#endif #endif
#ifndef AV_WB32 #ifndef AV_WB32
#define AV_WB32(p, d) do { \ # define AV_WB32(p, d) do { \
((uint8_t*)(p))[3] = (d); \ ((uint8_t*)(p))[3] = (d); \
((uint8_t*)(p))[2] = (d)>>8; \ ((uint8_t*)(p))[2] = (d)>>8; \
((uint8_t*)(p))[1] = (d)>>16; \ ((uint8_t*)(p))[1] = (d)>>16; \
((uint8_t*)(p))[0] = (d)>>24; } while(0) ((uint8_t*)(p))[0] = (d)>>24; \
} while(0)
#endif #endif
#ifndef AV_RL32 #ifndef AV_RL32
#define AV_RL32(x) ((((const uint8_t*)(x))[3] << 24) | \ # define AV_RL32(x) \
((((const uint8_t*)(x))[3] << 24) | \
(((const uint8_t*)(x))[2] << 16) | \ (((const uint8_t*)(x))[2] << 16) | \
(((const uint8_t*)(x))[1] << 8) | \ (((const uint8_t*)(x))[1] << 8) | \
((const uint8_t*)(x))[0]) ((const uint8_t*)(x))[0])
#endif #endif
#ifndef AV_WL32 #ifndef AV_WL32
#define AV_WL32(p, d) do { \ # define AV_WL32(p, d) do { \
((uint8_t*)(p))[0] = (d); \ ((uint8_t*)(p))[0] = (d); \
((uint8_t*)(p))[1] = (d)>>8; \ ((uint8_t*)(p))[1] = (d)>>8; \
((uint8_t*)(p))[2] = (d)>>16; \ ((uint8_t*)(p))[2] = (d)>>16; \
((uint8_t*)(p))[3] = (d)>>24; } while(0) ((uint8_t*)(p))[3] = (d)>>24; \
} while(0)
#endif #endif
#ifndef AV_RB64 #ifndef AV_RB64
#define AV_RB64(x) (((uint64_t)((const uint8_t*)(x))[0] << 56) | \ # define AV_RB64(x) \
(((uint64_t)((const uint8_t*)(x))[0] << 56) | \
((uint64_t)((const uint8_t*)(x))[1] << 48) | \ ((uint64_t)((const uint8_t*)(x))[1] << 48) | \
((uint64_t)((const uint8_t*)(x))[2] << 40) | \ ((uint64_t)((const uint8_t*)(x))[2] << 40) | \
((uint64_t)((const uint8_t*)(x))[3] << 32) | \ ((uint64_t)((const uint8_t*)(x))[3] << 32) | \
...@@ -228,7 +237,7 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed)); ...@@ -228,7 +237,7 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed));
(uint64_t)((const uint8_t*)(x))[7]) (uint64_t)((const uint8_t*)(x))[7])
#endif #endif
#ifndef AV_WB64 #ifndef AV_WB64
#define AV_WB64(p, d) do { \ # define AV_WB64(p, d) do { \
((uint8_t*)(p))[7] = (d); \ ((uint8_t*)(p))[7] = (d); \
((uint8_t*)(p))[6] = (d)>>8; \ ((uint8_t*)(p))[6] = (d)>>8; \
((uint8_t*)(p))[5] = (d)>>16; \ ((uint8_t*)(p))[5] = (d)>>16; \
...@@ -236,11 +245,13 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed)); ...@@ -236,11 +245,13 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed));
((uint8_t*)(p))[3] = (d)>>32; \ ((uint8_t*)(p))[3] = (d)>>32; \
((uint8_t*)(p))[2] = (d)>>40; \ ((uint8_t*)(p))[2] = (d)>>40; \
((uint8_t*)(p))[1] = (d)>>48; \ ((uint8_t*)(p))[1] = (d)>>48; \
((uint8_t*)(p))[0] = (d)>>56; } while(0) ((uint8_t*)(p))[0] = (d)>>56; \
} while(0)
#endif #endif
#ifndef AV_RL64 #ifndef AV_RL64
#define AV_RL64(x) (((uint64_t)((const uint8_t*)(x))[7] << 56) | \ # define AV_RL64(x) \
(((uint64_t)((const uint8_t*)(x))[7] << 56) | \
((uint64_t)((const uint8_t*)(x))[6] << 48) | \ ((uint64_t)((const uint8_t*)(x))[6] << 48) | \
((uint64_t)((const uint8_t*)(x))[5] << 40) | \ ((uint64_t)((const uint8_t*)(x))[5] << 40) | \
((uint64_t)((const uint8_t*)(x))[4] << 32) | \ ((uint64_t)((const uint8_t*)(x))[4] << 32) | \
...@@ -250,7 +261,7 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed)); ...@@ -250,7 +261,7 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed));
(uint64_t)((const uint8_t*)(x))[0]) (uint64_t)((const uint8_t*)(x))[0])
#endif #endif
#ifndef AV_WL64 #ifndef AV_WL64
#define AV_WL64(p, d) do { \ # define AV_WL64(p, d) do { \
((uint8_t*)(p))[0] = (d); \ ((uint8_t*)(p))[0] = (d); \
((uint8_t*)(p))[1] = (d)>>8; \ ((uint8_t*)(p))[1] = (d)>>8; \
((uint8_t*)(p))[2] = (d)>>16; \ ((uint8_t*)(p))[2] = (d)>>16; \
...@@ -258,7 +269,8 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed)); ...@@ -258,7 +269,8 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed));
((uint8_t*)(p))[4] = (d)>>32; \ ((uint8_t*)(p))[4] = (d)>>32; \
((uint8_t*)(p))[5] = (d)>>40; \ ((uint8_t*)(p))[5] = (d)>>40; \
((uint8_t*)(p))[6] = (d)>>48; \ ((uint8_t*)(p))[6] = (d)>>48; \
((uint8_t*)(p))[7] = (d)>>56; } while(0) ((uint8_t*)(p))[7] = (d)>>56; \
} while(0)
#endif #endif
#if HAVE_BIGENDIAN #if HAVE_BIGENDIAN
...@@ -356,27 +368,31 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed)); ...@@ -356,27 +368,31 @@ struct unaligned_16 { uint16_t l; } __attribute__((packed));
#endif #endif
#ifndef AV_RB24 #ifndef AV_RB24
#define AV_RB24(x) ((((const uint8_t*)(x))[0] << 16) | \ # define AV_RB24(x) \
((((const uint8_t*)(x))[0] << 16) | \
(((const uint8_t*)(x))[1] << 8) | \ (((const uint8_t*)(x))[1] << 8) | \
((const uint8_t*)(x))[2]) ((const uint8_t*)(x))[2])
#endif #endif
#ifndef AV_WB24 #ifndef AV_WB24
#define AV_WB24(p, d) do { \ # define AV_WB24(p, d) do { \
((uint8_t*)(p))[2] = (d); \ ((uint8_t*)(p))[2] = (d); \
((uint8_t*)(p))[1] = (d)>>8; \ ((uint8_t*)(p))[1] = (d)>>8; \
((uint8_t*)(p))[0] = (d)>>16; } while(0) ((uint8_t*)(p))[0] = (d)>>16; \
} while(0)
#endif #endif
#ifndef AV_RL24 #ifndef AV_RL24
#define AV_RL24(x) ((((const uint8_t*)(x))[2] << 16) | \ # define AV_RL24(x) \
((((const uint8_t*)(x))[2] << 16) | \
(((const uint8_t*)(x))[1] << 8) | \ (((const uint8_t*)(x))[1] << 8) | \
((const uint8_t*)(x))[0]) ((const uint8_t*)(x))[0])
#endif #endif
#ifndef AV_WL24 #ifndef AV_WL24
#define AV_WL24(p, d) do { \ # define AV_WL24(p, d) do { \
((uint8_t*)(p))[0] = (d); \ ((uint8_t*)(p))[0] = (d); \
((uint8_t*)(p))[1] = (d)>>8; \ ((uint8_t*)(p))[1] = (d)>>8; \
((uint8_t*)(p))[2] = (d)>>16; } while(0) ((uint8_t*)(p))[2] = (d)>>16; \
} while(0)
#endif #endif
#endif /* AVUTIL_INTREADWRITE_H */ #endif /* AVUTIL_INTREADWRITE_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment