Remove Nodes' init method: assert node is not allocationFailure instead

This commit is contained in:
Léa Saviot
2018-07-02 13:12:04 +02:00
parent 38cd5332f8
commit 882e81e4db
3 changed files with 6 additions and 4 deletions

View File

@@ -50,7 +50,9 @@ private:
class CharLayoutRef : public LayoutReference<CharLayoutNode> {
public:
CharLayoutRef(char c) : LayoutReference<CharLayoutNode>() {
this->castedNode()->setChar(c); //TODO use init
if (!(this->node()->isAllocationFailure())) {
this->castedNode()->setChar(c);
}
}
};

View File

@@ -18,7 +18,6 @@ public:
return m_value > 1 ? "BigFloat" : "SmallFloat";
}
void setFloat(float f) { m_value = f; }
void init(float f) override { m_value = f; }
private:
float m_value;
};
@@ -26,7 +25,9 @@ private:
class FloatRef : public ExpressionReference<FloatNode> {
public:
FloatRef(float f) : ExpressionReference<FloatNode>() {
this->node()->init(f);
if (!(this->node()->isAllocationFailure())) {
this->castedNode()->setFloat(f);
}
}
};

View File

@@ -37,7 +37,6 @@ public:
}
// Node operations
virtual void init(float f) {}
void retain() { m_referenceCounter++; }
void release();
void releaseChildren();