mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-25 16:50:50 +01:00
[apps] Replace sizeInBits>>2 sizeInBits/sizeof(uint32_t) in checksums
Change-Id: I4f96514caa4552d2158bb9ebdc328a6453554934
This commit is contained in:
@@ -24,7 +24,7 @@ uint32_t CartesianFunctionStore::storeChecksum() {
|
||||
for (int i = 0; i < k_maxNumberOfFunctions; i++) {
|
||||
checksums[i] = m_functions[i].checksum();
|
||||
}
|
||||
return Ion::crc32((uint32_t *)checksums, dataLengthInBytes>>2);
|
||||
return Ion::crc32((uint32_t *)checksums, dataLengthInBytes/sizeof(uint32_t));
|
||||
}
|
||||
|
||||
CartesianFunction * CartesianFunctionStore::functionAtIndex(int i) {
|
||||
|
||||
@@ -89,7 +89,7 @@ uint32_t Sequence::checksum() {
|
||||
data[k_dataLengthInBytes-3] = (char)m_type;
|
||||
data[k_dataLengthInBytes-2] = name()!= nullptr ? name()[0] : 0;
|
||||
data[k_dataLengthInBytes-1] = isActive() ? 1 : 0;
|
||||
return Ion::crc32((uint32_t *)data, k_dataLengthInBytes>>2);
|
||||
return Ion::crc32((uint32_t *)data, k_dataLengthInBytes/sizeof(uint32_t));
|
||||
}
|
||||
|
||||
const char * Sequence::firstInitialConditionText() {
|
||||
|
||||
@@ -17,7 +17,7 @@ uint32_t SequenceStore::storeChecksum() {
|
||||
for (int i = 0; i < k_maxNumberOfSequences; i++) {
|
||||
checksums[i] = m_sequences[i].checksum();
|
||||
}
|
||||
return Ion::crc32((uint32_t *)checksums, dataLengthInBytes>>2);
|
||||
return Ion::crc32((uint32_t *)checksums, dataLengthInBytes/sizeof(uint32_t));
|
||||
}
|
||||
|
||||
Sequence * SequenceStore::functionAtIndex(int i) {
|
||||
|
||||
@@ -11,7 +11,7 @@ uint32_t CurveViewRange::rangeChecksum() {
|
||||
float data[4] = {xMin(), xMax(), yMin(), yMax()};
|
||||
size_t dataLengthInBytes = 4*sizeof(float);
|
||||
assert((dataLengthInBytes & 0x3) == 0); // Assert that dataLengthInBytes is a multiple of 4
|
||||
return Ion::crc32((uint32_t *)data, dataLengthInBytes>>2);
|
||||
return Ion::crc32((uint32_t *)data, dataLengthInBytes/sizeof(uint32_t));
|
||||
}
|
||||
|
||||
float CurveViewRange::yGridUnit() {
|
||||
|
||||
@@ -64,7 +64,7 @@ uint32_t FloatPairStore::storeChecksum() {
|
||||
* clear the store when deleting pairs. However, this might trigger a bug? */
|
||||
size_t dataLengthInBytes = m_numberOfPairs*2*sizeof(double);
|
||||
assert((dataLengthInBytes & 0x3) == 0); // Assert that dataLengthInBytes is a multiple of 4
|
||||
return Ion::crc32((uint32_t *)m_data, dataLengthInBytes>>2);
|
||||
return Ion::crc32((uint32_t *)m_data, dataLengthInBytes/sizeof(uint32_t));
|
||||
}
|
||||
|
||||
double FloatPairStore::defaultValue(int i) {
|
||||
|
||||
@@ -31,7 +31,7 @@ uint32_t Function::checksum() {
|
||||
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);
|
||||
return Ion::crc32((uint32_t *)data, k_dataLengthInBytes/sizeof(uint32_t));
|
||||
}
|
||||
|
||||
void Function::setContent(const char * c) {
|
||||
|
||||
@@ -29,7 +29,7 @@ uint32_t InteractiveCurveViewRange::rangeChecksum() {
|
||||
float data[5] = {m_xMin, m_xMax, m_yMin, m_yMax, m_yAuto ? 1.0f : 0.0f};
|
||||
size_t dataLengthInBytes = 5*sizeof(float);
|
||||
assert((dataLengthInBytes & 0x3) == 0); // Assert that dataLengthInBytes is a multiple of 4
|
||||
return Ion::crc32((uint32_t *)data, dataLengthInBytes>>2);
|
||||
return Ion::crc32((uint32_t *)data, dataLengthInBytes/sizeof(uint32_t));
|
||||
}
|
||||
|
||||
bool InteractiveCurveViewRange::yAuto() {
|
||||
|
||||
@@ -21,7 +21,7 @@ uint32_t Store::barChecksum() {
|
||||
float data[2] = {m_barWidth, m_firstDrawnBarAbscissa};
|
||||
size_t dataLengthInBytes = 2*sizeof(float);
|
||||
assert((dataLengthInBytes & 0x3) == 0); // Assert that dataLengthInBytes is a multiple of 4
|
||||
return Ion::crc32((uint32_t *)data, dataLengthInBytes>>2);
|
||||
return Ion::crc32((uint32_t *)data, dataLengthInBytes/sizeof(uint32_t));
|
||||
}
|
||||
|
||||
/* Histogram bars */
|
||||
|
||||
Reference in New Issue
Block a user