[apps/shared] Revert to pack record

It appeared that without the packed keyword, the compiler did not handle
access to unaligned record data members, which leads to crashes on the
device.

Change-Id: I401f075e7f62458a4733baa8d81983d4be34b730
This commit is contained in:
Hugo Saint-Vignes
2020-06-24 16:27:41 +02:00
committed by Émilie Feral
parent 969fea7494
commit 5bc19af196
6 changed files with 25 additions and 30 deletions

View File

@@ -68,17 +68,6 @@ int Function::nameWithArgument(char * buffer, size_t bufferSize) {
return result;
}
Function::RecordDataBuffer::RecordDataBuffer(KDColor color, size_t size) {
/* Size is passed so that the entire derived RecordDataBuffer can be set to 0
* before initializing parameters. This is done in order to ensure any padding
* bits are set to 0 and prevent storage's CRC32 from depending on junk data. */
assert(size >= sizeof(*this));
memset(this, 0, size);
// Members must be initialized after memset
m_color = color;
m_active = true;
}
Function::RecordDataBuffer * Function::recordData() const {
assert(!isNull());
Ion::Storage::Record::Data d = value();