# HG changeset patch # User mru # Date 1266500419 0 # Node ID fb1a89b9ae54069f89b57b9c3040ad439a26fcf2 # Parent af688c6fa72f58ce38717260fd4f42f77b229e51 Add alias-safe union typedefs diff -r af688c6fa72f -r fb1a89b9ae54 intreadwrite.h --- 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 #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