Skip to content

Commit

Permalink
fix for warning: expression with side effects will be evaluated despi…
Browse files Browse the repository at this point in the history
…te being used as an operand to 'typeid' [-Wpotentially-evaluated-expression]
  • Loading branch information
michaeldsmith committed Apr 4, 2024
1 parent 4a8bcf0 commit d41a7e6
Showing 1 changed file with 28 additions and 7 deletions.
35 changes: 28 additions & 7 deletions lib/IlmCtl/CtlType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,10 @@ VoidType::VoidType (): DataType ()
bool
VoidType::isSameTypeAs (const TypePtr &t) const
{
return t && typeid (*this) == typeid (*t);
const type_info& ti1 = typeid(*this);
const type_info& ti2 = typeid(*t);
return t && ti1 == ti2;
//return t && typeid (*this) == typeid (*t);
}


Expand Down Expand Up @@ -282,7 +285,10 @@ BoolType::BoolType () : DataType ()
bool
BoolType::isSameTypeAs (const TypePtr &t) const
{
return t && typeid (*this) == typeid (*t);
const type_info& ti1 = typeid(*this);
const type_info& ti2 = typeid(*t);
return t && ti1 == ti2;
//return t && typeid (*this) == typeid (*t);
}


Expand Down Expand Up @@ -463,7 +469,10 @@ IntType::IntType () : DataType ()
bool
IntType::isSameTypeAs (const TypePtr &t) const
{
return t && typeid (*this) == typeid (*t);
const type_info& ti1 = typeid(*this);
const type_info& ti2 = typeid(*t);
return t && ti1 == ti2;
//return t && typeid (*this) == typeid (*t);
}


Expand Down Expand Up @@ -678,7 +687,10 @@ UIntType::UIntType () : DataType ()
bool
UIntType::isSameTypeAs (const TypePtr &t) const
{
return t && typeid (*this) == typeid (*t);
const type_info& ti1 = typeid(*this);
const type_info& ti2 = typeid(*t);
return t && ti1 == ti2;
//return t && typeid (*this) == typeid (*t);
}


Expand Down Expand Up @@ -892,7 +904,10 @@ HalfType::HalfType (): DataType ()
bool
HalfType::isSameTypeAs (const TypePtr &t) const
{
return t && typeid (*this) == typeid (*t);
const type_info& ti1 = typeid(*this);
const type_info& ti2 = typeid(*t);
return t && ti1 == ti2;
//return t && typeid (*this) == typeid (*t);
}


Expand Down Expand Up @@ -1076,7 +1091,10 @@ FloatType::FloatType (): DataType ()
bool
FloatType::isSameTypeAs (const TypePtr &t) const
{
return t && typeid (*this) == typeid (*t);
const type_info& ti1 = typeid(*this);
const type_info& ti2 = typeid(*t);
return t && ti1 == ti2;
//return t && typeid (*this) == typeid (*t);
}


Expand Down Expand Up @@ -1261,7 +1279,10 @@ StringType::StringType (): DataType ()
bool
StringType::isSameTypeAs (const TypePtr &t) const
{
return t && typeid (*this) == typeid (*t);
const type_info& ti1 = typeid(*this);
const type_info& ti2 = typeid(*t);
return t && ti1 == ti2;
//return t && typeid (*this) == typeid (*t);
}


Expand Down

0 comments on commit d41a7e6

Please sign in to comment.