diff options
author | Måns Rullgård <mans@mansr.com> | 2010-02-18 13:40:19 +0000 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2010-02-18 13:40:19 +0000 |
commit | d10458c9e27a5901ab2bc74059fde99f7ff3c267 (patch) | |
tree | a13743a899e659c8031d342059f764ae65516961 /libavutil/intreadwrite.h | |
parent | 024bf79fe0c10ef855c4ea78041c83b9c815c78f (diff) | |
download | ffmpeg-d10458c9e27a5901ab2bc74059fde99f7ff3c267.tar.gz |
Add alias-safe union typedefs
Originally committed as revision 21877 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/intreadwrite.h')
-rw-r--r-- | libavutil/intreadwrite.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libavutil/intreadwrite.h b/libavutil/intreadwrite.h index 81ba82de5c..57fa83c3a6 100644 --- a/libavutil/intreadwrite.h +++ b/libavutil/intreadwrite.h @@ -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 |