1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-31 16:09:28 +02:00

Martyn, good catch on commit r11461. I had gone back and forth between what you did and this commit, and messed up the edit. I like this one better because it doesn't duplicate the constant, and keeps all the wxLogDebug calls consistent -- less cognitive overhead.

This commit is contained in:
v.audacity 2012-02-06 22:02:50 +00:00
parent fc595a4d3f
commit 4386504569

View File

@ -231,15 +231,16 @@ bool SimpleBlockFile::WriteSimpleBlockFile(
for( int i = 0; i < sampleLen; i++ )
{
nBytesToWrite = 3;
nBytesWritten =
#if wxBYTE_ORDER == wxBIG_ENDIAN
file.Write((char*)&int24sampleData[i] + 1, 3);
file.Write((char*)&int24sampleData[i] + 1, nBytesToWrite);
#else
file.Write((char*)&int24sampleData[i], 3);
file.Write((char*)&int24sampleData[i], nBytesToWrite);
#endif
if (nBytesWritten != 3)
if (nBytesWritten != nBytesToWrite)
{
wxLogDebug(wxT("Wrote %d bytes, expected 3."), nBytesWritten);
wxLogDebug(wxT("Wrote %d bytes, expected %d."), nBytesWritten, nBytesToWrite);
return false;
}
}