[apps/code] Status at the beginning of a script is one byte long

This saves space + avoids clashes with the NumWorks Workshop when
exchanging scripts
This commit is contained in:
Léa Saviot
2020-06-05 11:28:12 +02:00
parent d53a16eb91
commit 9a1ff2bd33
6 changed files with 33 additions and 20 deletions

View File

@@ -37,7 +37,7 @@ void EditorController::setScript(Script script, int scriptIndex) {
* */
size_t newScriptSize = Ion::Storage::sharedStorage()->putAvailableSpaceAtEndOfRecord(m_script);
m_editorView.setText(const_cast<char *>(m_script.content()), newScriptSize - Script::InformationSize());
m_editorView.setText(const_cast<char *>(m_script.content()), newScriptSize - Script::StatusSize());
}
void EditorController::willExitApp() {
@@ -156,7 +156,7 @@ void EditorController::cleanStorageEmptySpace() {
Ion::Storage::Record::Data scriptValue = m_script.value();
Ion::Storage::sharedStorage()->getAvailableSpaceFromEndOfRecord(
m_script,
scriptValue.size - Script::InformationSize() - (strlen(m_script.content()) + 1)); // TODO optimize number of script fetches
scriptValue.size - Script::StatusSize() - (strlen(m_script.content()) + 1)); // TODO optimize number of script fetches
}