mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-19 05:40:38 +01:00
[apps] Use crc32 methods in models
Change-Id: I2c0588eef90c8015d13fd7aed87a4b615243fe5c
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#include <math.h>
|
||||
#include <assert.h>
|
||||
#include <stddef.h>
|
||||
#include <ion.h>
|
||||
|
||||
FloatPairStore::FloatPairStore() :
|
||||
m_numberOfPairs(0)
|
||||
@@ -58,8 +59,7 @@ float FloatPairStore::sumOfColumn(int i) {
|
||||
uint32_t FloatPairStore::storeChecksum() {
|
||||
size_t dataLengthInBytes = m_numberOfPairs*2*sizeof(float);
|
||||
assert((dataLengthInBytes & 0x3) == 0); // Assert that dataLengthInBytes is a multiple of 4
|
||||
//return Ion::crc32((uint32_t *)m_data, dataLengthInBytes>>2);
|
||||
return sumOfColumn(0)+sumOfColumn(1);
|
||||
return Ion::crc32((uint32_t *)m_data, dataLengthInBytes>>2);
|
||||
}
|
||||
|
||||
float FloatPairStore::defaultValue(int i) {
|
||||
|
||||
@@ -3,6 +3,7 @@ extern "C" {
|
||||
#include <assert.h>
|
||||
}
|
||||
#include <stddef.h>
|
||||
#include <ion.h>
|
||||
|
||||
namespace Graph {
|
||||
|
||||
@@ -19,8 +20,7 @@ FunctionStore::FunctionStore() :
|
||||
uint32_t FunctionStore::storeChecksum() {
|
||||
size_t dataLengthInBytes = m_numberOfFunctions*sizeof(Function);
|
||||
assert((dataLengthInBytes & 0x3) == 0); // Assert that dataLengthInBytes is a multiple of 4
|
||||
//return Ion::crc32((uint32_t *)m_functions, dataLengthInBytes>>2);
|
||||
return m_numberOfFunctions;
|
||||
return Ion::crc32((uint32_t *)m_functions, dataLengthInBytes>>2);
|
||||
}
|
||||
|
||||
Function * FunctionStore::functionAtIndex(int i) {
|
||||
|
||||
@@ -25,8 +25,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 m_xMin+ m_xMax+ m_yMin+ m_yMax+ m_yAuto;
|
||||
return Ion::crc32((uint32_t *)data, dataLengthInBytes>>2);
|
||||
}
|
||||
|
||||
float InteractiveCurveViewRange::xMin() {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <float.h>
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
#include <ion.h>
|
||||
|
||||
namespace Statistics {
|
||||
|
||||
@@ -18,8 +19,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 m_barWidth + m_firstDrawnBarAbscissa;
|
||||
return Ion::crc32((uint32_t *)data, dataLengthInBytes>>2);
|
||||
}
|
||||
|
||||
/* Histogram bars */
|
||||
|
||||
Reference in New Issue
Block a user