mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-20 01:08:15 +01:00
[shared] StorageFunction::nameWithArgument uses
SymbolAbstract::TruncateExtension instead of reimplementing it
This commit is contained in:
@@ -29,16 +29,9 @@ void StorageFunction::setActive(bool active) {
|
||||
|
||||
int StorageFunction::nameWithArgument(char * buffer, size_t bufferSize, char arg) {
|
||||
const char * functionName = fullName();
|
||||
size_t index = 0;
|
||||
k_parenthesedArgument[1] = arg;
|
||||
while (*functionName != Ion::Storage::k_dotChar
|
||||
&& index < bufferSize - k_parenthesedArgumentLength - 1)
|
||||
{
|
||||
// We keep room to write the final "(x)" //TODO should we?
|
||||
assert(functionName < fullName() + strlen(fullName()));
|
||||
buffer[index++] = *functionName++;
|
||||
}
|
||||
return index + strlcpy(&buffer[index], k_parenthesedArgument, bufferSize-index);
|
||||
size_t baseNameLength = SymbolAbstract::TruncateExtension(buffer, functionName, bufferSize - k_parenthesedArgumentLength);
|
||||
return baseNameLength + strlcpy(&buffer[baseNameLength], k_parenthesedArgument, bufferSize-baseNameLength);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
||||
Reference in New Issue
Block a user