From 4495067484662d077a209c5872a4de35d3b8bb15 Mon Sep 17 00:00:00 2001 From: Martchus Date: Wed, 16 Sep 2015 17:54:40 +0200 Subject: [PATCH] fixed aliasing warning --- io/binaryreader.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/io/binaryreader.h b/io/binaryreader.h index 719fe6c..bcc0f3c 100644 --- a/io/binaryreader.h +++ b/io/binaryreader.h @@ -257,7 +257,7 @@ inline uint32 BinaryReader::readUInt32BE() */ inline uint64 BinaryReader::readUInt40BE() { - *reinterpret_cast(m_buffer) = 0; + *m_buffer = *(m_buffer + 1) = *(m_buffer + 2) = 0; m_stream->read(m_buffer + 3, 5); return ConversionUtilities::BE::toUInt64(m_buffer); } @@ -373,7 +373,7 @@ inline uint32 BinaryReader::readUInt32LE() */ inline uint64 BinaryReader::readUInt40LE() { - *reinterpret_cast(m_buffer + 3) = 0; + *(m_buffer + 5) = *(m_buffer + 6) = *(m_buffer + 7) = 0; m_stream->read(m_buffer, 5); return ConversionUtilities::LE::toUInt64(m_buffer); }