Skip to content

Commit 1b6f076

Browse files
fredroybakpaul
authored andcommitted
[Defaulttype, Helper] Return empty string instead of zero (sofa-framework#5388)
return empty string instead of null
1 parent b47b902 commit 1b6f076

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Sofa/framework/DefaultType/src/sofa/defaulttype/typeinfo/NoTypeInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class SOFA_DEFAULTTYPE_API NoTypeInfo : public AbstractTypeInfo
103103
/// Relevant only if this type can be casted to `double`.
104104
double getScalarValue (const void*, Index) const override {return 0;}
105105
/// Get the value at \a index of \a data as a string.
106-
std::string getTextValue (const void*, Index) const override {return 0;}
106+
std::string getTextValue (const void*, Index) const override {return "";}
107107

108108
/// Set the value at \a index of \a data from an integer value.
109109
void setIntegerValue(void*, Index, long long ) const override {return;}

Sofa/framework/Helper/src/sofa/helper/AdvancedTimer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,12 +1457,12 @@ std::string AdvancedTimer::getTimeAnalysis(IdTimer id, double time, double delta
14571457
if (curTimer.empty())
14581458
{
14591459
msg_error("AdvancedTimer::end") << "timer[" << id << "] called while begin was not" ;
1460-
return nullptr;
1460+
return "";
14611461
}
14621462
if (id != curTimer.top())
14631463
{
14641464
msg_error("AdvancedTimer::end") << "timer[" << id << "] does not correspond to last call to begin(" << curTimer.top() << ")" ;
1465-
return nullptr;
1465+
return "";
14661466
}
14671467
type::vector<Record>* curRecords = getCurRecords();
14681468
if (curRecords)

0 commit comments

Comments
 (0)