From 1cd5145d3f92f82be78909b8b94e7e3fa07165a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Wed, 10 Oct 2018 09:42:59 +0200 Subject: [PATCH] [shared] Fix StorageFunction --- apps/shared/storage_function.cpp | 4 ++-- apps/shared/storage_function.h | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/apps/shared/storage_function.cpp b/apps/shared/storage_function.cpp index 7f1c8e442..bd9c9240f 100644 --- a/apps/shared/storage_function.cpp +++ b/apps/shared/storage_function.cpp @@ -30,12 +30,12 @@ void StorageFunction::setColor(KDColor color) { template 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(const_cast(d.buffer)); } diff --git a/apps/shared/storage_function.h b/apps/shared/storage_function.h index 5822e9f36..404671e0e 100644 --- a/apps/shared/storage_function.h +++ b/apps/shared/storage_function.h @@ -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 T templatedApproximateAtAbscissa(T x, Poincare::Context * context) const; FunctionRecordData * recordData() const; virtual const char * symbol() const = 0;