Mercurial > libavutil.hg
diff intreadwrite.h @ 837:fb1a89b9ae54 libavutil
Add alias-safe union typedefs
author | mru |
---|---|
date | Thu, 18 Feb 2010 13:40:19 +0000 |
parents | 5d63d070e9ff |
children | 5e375940e195 |
line wrap: on
line diff
--- a/intreadwrite.h Tue Feb 16 20:17:50 2010 +0000 +++ b/intreadwrite.h Thu Feb 18 13:40:19 2010 +0000 @@ -22,6 +22,28 @@ #include <stdint.h> #include "config.h" #include "bswap.h" +#include "common.h" + +typedef union { + uint64_t u64; + uint32_t u32[2]; + uint16_t u16[4]; + uint8_t u8 [8]; + double f64; + float f32[2]; +} av_alias av_alias64; + +typedef union { + uint32_t u32; + uint16_t u16[2]; + uint8_t u8 [4]; + float f32; +} av_alias av_alias32; + +typedef union { + uint16_t u16; + uint8_t u8 [2]; +} av_alias av_alias16; /* * Arch-specific headers can provide any combination of