mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-27 01:29:58 +01:00
[apps] Gather asserts about the size of function name with argument
This commit is contained in:
committed by
LeaNumworks
parent
8f88f7fea6
commit
f73c80daa3
@@ -26,6 +26,7 @@ public:
|
||||
constexpr static int k_parenthesedThetaArgumentByteLength = 4;
|
||||
constexpr static int k_parenthesedXNTArgumentByteLength = 3;
|
||||
constexpr static int k_maxNameWithArgumentSize = Poincare::SymbolAbstract::k_maxNameSize + k_parenthesedThetaArgumentByteLength; /* Function name and null-terminating char + "(θ)" */;
|
||||
static_assert(k_maxNameWithArgumentSize > Poincare::SymbolAbstract::k_maxNameSize, "Forgot argument's size?");
|
||||
static bool BaseNameCompliant(const char * baseName, NameNotCompliantError * error = nullptr);
|
||||
|
||||
// Constructors
|
||||
|
||||
@@ -100,7 +100,6 @@ void VariableBoxController::willDisplayCellForIndex(HighlightCell * cell, int in
|
||||
}
|
||||
ExpressionTableCellWithExpression * myCell = (ExpressionTableCellWithExpression *)cell;
|
||||
Storage::Record record = recordAtIndex(index);
|
||||
assert(Shared::Function::k_maxNameWithArgumentSize > SymbolAbstract::k_maxNameSize);
|
||||
char symbolName[Shared::Function::k_maxNameWithArgumentSize];
|
||||
size_t symbolLength = 0;
|
||||
if (m_currentPage == Page::Expression) {
|
||||
@@ -188,8 +187,6 @@ bool VariableBoxController::selectLeaf(int selectedRow) {
|
||||
|
||||
// Get the name text to insert
|
||||
Storage::Record record = recordAtIndex(selectedRow);
|
||||
assert(Shared::Function::k_maxNameWithArgumentSize > 0);
|
||||
assert(Shared::Function::k_maxNameWithArgumentSize > SymbolAbstract::k_maxNameSize);
|
||||
constexpr size_t nameToHandleMaxSize = Shared::Function::k_maxNameWithArgumentSize;
|
||||
char nameToHandle[nameToHandleMaxSize];
|
||||
size_t nameLength = SymbolAbstract::TruncateExtension(nameToHandle, record.fullName(), nameToHandleMaxSize);
|
||||
|
||||
Reference in New Issue
Block a user