mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-27 01:29:58 +01:00
[shared] Fix StorageFunction
This commit is contained in:
@@ -30,12 +30,12 @@ void StorageFunction::setColor(KDColor color) {
|
||||
|
||||
template<typename T>
|
||||
T StorageFunction::templatedApproximateAtAbscissa(T x, Poincare::Context * context) const {
|
||||
return reducedExpression(context).approximateWithValueForSymbol(symbol(), x, *context, Preferences::sharedPreferences()->angleUnit());
|
||||
return expression(context).approximateWithValueForSymbol(symbol(), x, *context, Preferences::sharedPreferences()->angleUnit());
|
||||
}
|
||||
|
||||
StorageFunction::FunctionRecordData * StorageFunction::recordData() const {
|
||||
assert(!record().isNull());
|
||||
Ion::Storage::Record::Data d = record().value();
|
||||
Ion::Storage::Record::Data d = value();
|
||||
return reinterpret_cast<FunctionRecordData *>(const_cast<void *>(d.buffer));
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ namespace Shared {
|
||||
class StorageFunction : public StorageExpressionModel {
|
||||
public:
|
||||
// Constructors
|
||||
StorageFunction(const char * name = nullptr) : StorageExpressionModel(name) {}
|
||||
StorageFunction(Ion::Storage::Record record) : StorageExpressionModel(record){}
|
||||
|
||||
// Checksum
|
||||
@@ -43,8 +42,6 @@ protected:
|
||||
bool m_active;
|
||||
};
|
||||
private:
|
||||
constexpr static size_t k_dataLengthInBytes = (TextField::maxBufferSize()+2)*sizeof(char)+2;
|
||||
static_assert((k_dataLengthInBytes & 0x3) == 0, "The function data size is not a multiple of 4 bytes (cannot compute crc)"); // Assert that dataLengthInBytes is a multiple of 4
|
||||
template<typename T> T templatedApproximateAtAbscissa(T x, Poincare::Context * context) const;
|
||||
FunctionRecordData * recordData() const;
|
||||
virtual const char * symbol() const = 0;
|
||||
|
||||
Reference in New Issue
Block a user