[apps/sequence][apps/graph] Checksum takes into account whether the

function is active and its name

Change-Id: I790d9a793c512a686f21f1db4fc0848a16baea5c
This commit is contained in:
Émilie Feral
2017-05-29 11:41:39 +02:00
parent 1966b4648c
commit 832af9f9f4
4 changed files with 7 additions and 2 deletions

View File

@@ -29,6 +29,8 @@ Function& Function::operator=(const Function& other) {
uint32_t Function::checksum() {
char data[k_dataLengthInBytes/sizeof(char)] = {};
strlcpy(data, m_text, TextField::maxBufferSize());
data[k_dataLengthInBytes-2] = m_name != nullptr ? m_name[0] : 0;
data[k_dataLengthInBytes-1] = m_active ? 1 : 0;
return Ion::crc32((uint32_t *)data, k_dataLengthInBytes>>2);
}