1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-06 04:00:08 +00:00

Removed an unnecessary extra byte generated by AudioProcessor::copyXmlToBinary()

This commit is contained in:
jules 2012-10-01 10:14:26 +01:00
parent 5d7622ade5
commit 86223a267c

View file

@ -267,7 +267,7 @@ void AudioProcessor::copyXmlToBinary (const XmlElement& xml, juce::MemoryBlock&
const String xmlString (xml.createDocument (String::empty, true, false));
const int stringLength = xmlString.getNumBytesAsUTF8();
destData.setSize ((size_t) stringLength + 10);
destData.setSize ((size_t) stringLength + 9);
char* const d = static_cast<char*> (destData.getData());
*(uint32*) d = ByteOrder::swapIfBigEndian ((const uint32) magicXmlNumber);
@ -276,8 +276,7 @@ void AudioProcessor::copyXmlToBinary (const XmlElement& xml, juce::MemoryBlock&
xmlString.copyToUTF8 (d + 8, stringLength + 1);
}
XmlElement* AudioProcessor::getXmlFromBinary (const void* data,
const int sizeInBytes)
XmlElement* AudioProcessor::getXmlFromBinary (const void* data, const int sizeInBytes)
{
if (sizeInBytes > 8
&& ByteOrder::littleEndianInt (data) == magicXmlNumber)