mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-21 14:50:44 +01:00
[apps/graph] Handle undefined function
Change-Id: Id26e0f81ba5c1446655f33b2c63f97ab5b684e41
This commit is contained in:
@@ -23,7 +23,22 @@ Function * FunctionStore::activeFunctionAtIndex(int i) {
|
||||
assert(i>=0 && i<m_numberOfFunctions);
|
||||
int index = 0;
|
||||
for (int k = 0; k < m_numberOfFunctions; k++) {
|
||||
if (m_functions[k].isActive()) {
|
||||
if (m_functions[k].isActive() && m_functions[k].layout() != nullptr) {
|
||||
if (i == index) {
|
||||
return &m_functions[k];
|
||||
}
|
||||
index++;
|
||||
}
|
||||
}
|
||||
assert(false);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Function * FunctionStore::definedFunctionAtIndex(int i) {
|
||||
assert(i>=0 && i<m_numberOfFunctions);
|
||||
int index = 0;
|
||||
for (int k = 0; k < m_numberOfFunctions; k++) {
|
||||
if (m_functions[k].layout() != nullptr) {
|
||||
if (i == index) {
|
||||
return &m_functions[k];
|
||||
}
|
||||
@@ -71,6 +86,16 @@ int FunctionStore::numberOfActiveFunctions() {
|
||||
return result;
|
||||
}
|
||||
|
||||
int FunctionStore::numberOfDefinedFunctions() {
|
||||
int result = 0;
|
||||
for (int i = 0; i < m_numberOfFunctions; i++) {
|
||||
if (m_functions[i].layout() != nullptr) {
|
||||
result++;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
const char * FunctionStore::firstAvailableName() {
|
||||
for (int k = 0; k < k_maxNumberOfFunctions; k++) {
|
||||
int j = 0;
|
||||
|
||||
Reference in New Issue
Block a user