History

bytestream: Eliminate one level of pointless macro indirection.

Diego Biurrun committed 14 years ago

Commit f03183d1 parent abe3c691 file · +11 −19Browse files

Unified · Split

libavcodec/bytestream.h+11−19
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323 #ifndef AVCODEC_BYTESTREAM_H
2424 #define AVCODEC_BYTESTREAM_H
2525
26+#include <stdint.h>
2627 #include <string.h>
2728
2829 #include "libavutil/common.h"
@@ -37,7 +38,7 @@ typedef struct { · 8 unmodified lines
3738 int eof;
3839 } PutByteContext;
3940
40−#define DEF_T(type, name, bytes, read, write) \
41+#define DEF(type, name, bytes, read, write) \
4142 static av_always_inline type bytestream_get_ ## name(const uint8_t **b) \
4243 { \
4344 (*b) += bytes; \
@@ -80,24 +81,15 @@ static av_always_inline type bytestream2_peek_ ## name(GetByteContext *g) \ · 36 unmodified lines
8081 return read(g->buffer); \
8182 }
8283
83−#define DEF(name, bytes, read, write) \
84− DEF_T(unsigned int, name, bytes, read, write)
85−#define DEF64(name, bytes, read, write) \
86− DEF_T(uint64_t, name, bytes, read, write)
87−
88−DEF64(le64, 8, AV_RL64, AV_WL64)
89−DEF (le32, 4, AV_RL32, AV_WL32)
90−DEF (le24, 3, AV_RL24, AV_WL24)
91−DEF (le16, 2, AV_RL16, AV_WL16)
92−DEF64(be64, 8, AV_RB64, AV_WB64)
93−DEF (be32, 4, AV_RB32, AV_WB32)
94−DEF (be24, 3, AV_RB24, AV_WB24)
95−DEF (be16, 2, AV_RB16, AV_WB16)
96−DEF (byte, 1, AV_RB8 , AV_WB8 )
97−
98−#undef DEF
99−#undef DEF64
100−#undef DEF_T
84+DEF(uint64_t, le64, 8, AV_RL64, AV_WL64)
85+DEF(unsigned int, le32, 4, AV_RL32, AV_WL32)
86+DEF(unsigned int, le24, 3, AV_RL24, AV_WL24)
87+DEF(unsigned int, le16, 2, AV_RL16, AV_WL16)
88+DEF(uint64_t, be64, 8, AV_RB64, AV_WB64)
89+DEF(unsigned int, be32, 4, AV_RB32, AV_WB32)
90+DEF(unsigned int, be24, 3, AV_RB24, AV_WB24)
91+DEF(unsigned int, be16, 2, AV_RB16, AV_WB16)
92+DEF(unsigned int, byte, 1, AV_RB8 , AV_WB8)
10193
10294 #if HAVE_BIGENDIAN
10395 # define bytestream2_get_ne16 bytestream2_get_be16

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t