From 9a3ce0df261ce8e6532cd771dee34652ed755be2 Mon Sep 17 00:00:00 2001 From: Ruben Dashyan Date: Fri, 6 Sep 2019 12:17:45 +0200 Subject: [PATCH] [apps/shared/cartesian_function] Rename CartesianFunctionRecordDataBuffer to RecordDataBuffer --- apps/shared/cartesian_function.cpp | 10 +++++----- apps/shared/cartesian_function.h | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/apps/shared/cartesian_function.cpp b/apps/shared/cartesian_function.cpp index 1e6dd6a9c..e3e3c75b2 100644 --- a/apps/shared/cartesian_function.cpp +++ b/apps/shared/cartesian_function.cpp @@ -58,7 +58,7 @@ CartesianFunction CartesianFunction::NewModel(Ion::Storage::Record::ErrorStatus // Create the record char nameBuffer[SymbolAbstract::k_maxNameSize]; int numberOfColors = sizeof(Palette::DataColor)/sizeof(KDColor); - CartesianFunctionRecordDataBuffer data(Palette::DataColor[s_colorIndex++ % numberOfColors]); + RecordDataBuffer data(Palette::DataColor[s_colorIndex++ % numberOfColors]); if (baseName == nullptr) { DefaultName(nameBuffer, SymbolAbstract::k_maxNameSize); baseName = nameBuffer; @@ -261,17 +261,17 @@ void CartesianFunction::setTMax(float tMax) { } void * CartesianFunction::Model::expressionAddress(const Ion::Storage::Record * record) const { - return (char *)record->value().buffer+sizeof(CartesianFunctionRecordDataBuffer); + return (char *)record->value().buffer+sizeof(RecordDataBuffer); } size_t CartesianFunction::Model::expressionSize(const Ion::Storage::Record * record) const { - return record->value().size-sizeof(CartesianFunctionRecordDataBuffer); + return record->value().size-sizeof(RecordDataBuffer); } -CartesianFunction::CartesianFunctionRecordDataBuffer * CartesianFunction::recordData() const { +CartesianFunction::RecordDataBuffer * CartesianFunction::recordData() const { assert(!isNull()); Ion::Storage::Record::Data d = value(); - return reinterpret_cast(const_cast(d.buffer)); + return reinterpret_cast(const_cast(d.buffer)); } template diff --git a/apps/shared/cartesian_function.h b/apps/shared/cartesian_function.h index 39b625ab1..370e9c512 100644 --- a/apps/shared/cartesian_function.h +++ b/apps/shared/cartesian_function.h @@ -70,12 +70,12 @@ private: typedef Poincare::Coordinate2D (*ComputePointOfInterest)(Poincare::Expression e, char * symbol, double start, double step, double max, Poincare::Context * context); Poincare::Coordinate2D nextPointOfInterestFrom(double start, double step, double max, Poincare::Context * context, ComputePointOfInterest compute) const; template Poincare::Coordinate2D privateEvaluateXYAtParameter(T t, Poincare::Context * context) const; - /* CartesianFunctionRecordDataBuffer is the layout of the data buffer of Record + /* RecordDataBuffer is the layout of the data buffer of Record * representing a CartesianFunction. See comment on * Shared::Function::RecordDataBuffer about packing. */ - class __attribute__((packed)) CartesianFunctionRecordDataBuffer : public Function::RecordDataBuffer { + class __attribute__((packed)) RecordDataBuffer : public Function::RecordDataBuffer { public: - CartesianFunctionRecordDataBuffer(KDColor color) : + RecordDataBuffer(KDColor color) : Function::RecordDataBuffer(color), m_plotType(PlotType::Cartesian), m_domain(-INFINITY, INFINITY), @@ -103,9 +103,9 @@ private: private: size_t expressionSize(const Ion::Storage::Record * record) const override; }; - size_t metaDataSize() const override { return sizeof(CartesianFunctionRecordDataBuffer); } + size_t metaDataSize() const override { return sizeof(RecordDataBuffer); } const ExpressionModel * model() const override { return &m_model; } - CartesianFunctionRecordDataBuffer * recordData() const; + RecordDataBuffer * recordData() const; template Poincare::Coordinate2D templatedApproximateAtParameter(T t, Poincare::Context * context) const; Model m_model; };