Skip to content
Snippets Groups Projects
Commit a44a2d74 authored by Sean McBride's avatar Sean McBride Committed by Kitware Robot
Browse files

Merge topic 'vtkSetEnumMacroWarning3' into release


321d087f Fixed unused warnings in get/set enum macros / made getter const

Acked-by: default avatarKitware Robot <kwrobot@kitware.com>
Acked-by: default avatarBen Boeckel <ben.boeckel@kitware.com>
Merge-request: !7383
parents c0ba8a6a 321d087f
No related branches found
No related tags found
No related merge requests found
......@@ -149,11 +149,8 @@
#define vtkSetEnumMacro(name, enumType) \
virtual void Set##name(enumType _arg) \
{ \
using T = typename std::underlying_type<enumType>::type; \
T _intArg = static_cast<T>(_arg); \
vtkDebugMacro(<< this->GetClassName() << " (" << this << "): setting " #name " to " \
<< _intArg); \
(void)_intArg; /* suppress unused warning for when vtkDebugMacro does nothing */ \
<< static_cast<std::underlying_type<enumType>::type>(_arg)); \
if (this->name != _arg) \
{ \
this->name = _arg; \
......@@ -166,12 +163,10 @@
// vtkSetMacro can't be used because 'enum class' won't trivially convert to integer for logging.
//
#define vtkGetEnumMacro(name, enumType) \
virtual enumType Get##name() \
virtual enumType Get##name() const \
{ \
using T = typename std::underlying_type<enumType>::type; \
T _intName = static_cast<T>(this->name); \
vtkDebugMacro(<< this->GetClassName() << " (" << this << "): returning " << #name " of " \
<< _intName); \
<< static_cast<std::underlying_type<enumType>::type>(this->name)); \
return this->name; \
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment