Skip to content

Commit

Permalink
Fix detection of big endian
Browse files Browse the repository at this point in the history
  • Loading branch information
carlesfernandez committed Feb 10, 2017
1 parent ca0352b commit 5264622
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ bool systemIsBigEndian()
bool systemBytesAreBigEndian()
{
byte_and_samples b;
b.byte = static_cast< int8_t>(0x1B);

return b.samples.sample_0 == 0x3;
b.byte = static_cast<int8_t>(0x01);
if(*(char *)&b.byte == 1) return false;
else return true;
}

void swapEndianness( int8_t const *in, std::vector< int8_t > &out, size_t item_size, unsigned int ninput_items )
Expand Down

0 comments on commit 5264622

Please sign in to comment.