Skip to content

Commit

Permalink
Avoid using FALSE and TRUE in enum
Browse files Browse the repository at this point in the history
  • Loading branch information
jslee02 committed Jan 30, 2025
1 parent 6e5387b commit 86625e4
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 22 deletions.
12 changes: 0 additions & 12 deletions dart/utils/mjcf/detail/Compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,23 +180,11 @@ Errors Compiler::read(tinyxml2::XMLElement* element)
const std::string inertiafromgeom
= getAttributeString(element, "inertiafromgeom");
if (inertiafromgeom == "false") {
#if DART_OS_WINDOWS
mInertiaFromGeom = InertiaFromGeom::IFG_FALSE;
#else
mInertiaFromGeom = InertiaFromGeom::FALSE;
#endif
} else if (inertiafromgeom == "true") {
#if DART_OS_WINDOWS
mInertiaFromGeom = InertiaFromGeom::IFG_TRUE;
#else
mInertiaFromGeom = InertiaFromGeom::TRUE;
#endif
} else if (inertiafromgeom == "auto") {
#if DART_OS_WINDOWS
mInertiaFromGeom = InertiaFromGeom::IFG_AUTO;
#else
mInertiaFromGeom = InertiaFromGeom::AUTO;
#endif
} else {
errors.emplace_back(
ErrorCode::ATTRIBUTE_INVALID,
Expand Down
4 changes: 0 additions & 4 deletions dart/utils/mjcf/detail/Compiler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,7 @@ class Compiler final
bool mConvexHull{true};
bool mUserThread{true};
bool mFuseStatic{false};
#if DART_OS_WINDOWS
InertiaFromGeom mInertiaFromGeom{InertiaFromGeom::IFG_AUTO};
#else
InertiaFromGeom mInertiaFromGeom{InertiaFromGeom::AUTO};
#endif
Eigen::Vector2i mInertiaGroupRange{Eigen::Vector2i(0, 5)};
};

Expand Down
6 changes: 0 additions & 6 deletions dart/utils/mjcf/detail/Types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,9 @@ enum class Integrator

enum class InertiaFromGeom
{
#if DART_OS_WINDOWS
IFG_FALSE,
IFG_TRUE,
IFG_AUTO,
#else
FALSE,
TRUE,
AUTO,
#endif
};

enum class CollisionType
Expand Down

0 comments on commit 86625e4

Please sign in to comment.