mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-30 15:52:12 +01:00
Patch from PH which orders fields by size - important for using the M4 FPU
This commit is contained in:
parent
76a956416c
commit
3e2558bec6
@ -111,6 +111,11 @@ int UAVObjectParser::getNumBytes(int objIndex)
|
||||
}
|
||||
}
|
||||
|
||||
bool fieldTypeLessThan(const FieldInfo* f1, const FieldInfo* f2)
|
||||
{
|
||||
return f1->numBytes > f2->numBytes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse supplied XML file
|
||||
* @param xml The xml text
|
||||
@ -201,6 +206,9 @@ QString UAVObjectParser::parseXML(QString& xml, QString& filename)
|
||||
childNode = childNode.nextSibling();
|
||||
}
|
||||
|
||||
// Sort all fields according to size
|
||||
qStableSort(info->fields.begin(), info->fields.end(), fieldTypeLessThan);
|
||||
|
||||
// Make sure that required elements were found
|
||||
if ( !accessFound )
|
||||
return QString("Object::access element is missing");
|
||||
|
Loading…
x
Reference in New Issue
Block a user