Skip to content

Commit

Permalink
Ignore spurious Wconversion warnings when using get_override
Browse files Browse the repository at this point in the history
  • Loading branch information
wxmerkt committed Apr 6, 2022
1 parent 03969b3 commit 405fa82
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
6 changes: 6 additions & 0 deletions python/broadphase/broadphase_callbacks.hh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ struct CollisionCallBackBaseWrapper : CollisionCallBackBase,

void init() { this->get_override("init")(); }
bool collide(CollisionObject* o1, CollisionObject* o2) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
return this->get_override("collide")(o1, o2);
#pragma GCC diagnostic pop
}

static void expose() {
Expand All @@ -83,7 +86,10 @@ struct DistanceCallBackBaseWrapper : DistanceCallBackBase,
}

bool distance(CollisionObject* o1, CollisionObject* o2, FCL_REAL& dist) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
return this->get_override("distance")(o1, o2, dist);
#pragma GCC diagnostic pop
}

static void expose() {
Expand Down
17 changes: 15 additions & 2 deletions python/broadphase/broadphase_collision_manager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ struct BroadPhaseCollisionManagerWrapper
void clear() { this->get_override("clear")(); }

std::vector<CollisionObject *> getObjects() const {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
return this->get_override("getObjects")();
#pragma GCC diagnostic pop
}

void collide(CollisionCallBackBase *callback) const {
Expand All @@ -103,8 +106,18 @@ struct BroadPhaseCollisionManagerWrapper
this->get_override("collide")(other_manager, callback);
}

bool empty() const { return this->get_override("empty")(); }
size_t size() const { return this->get_override("size")(); }
bool empty() const {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
return this->get_override("empty")();
#pragma GCC diagnostic pop
}
size_t size() const {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
return this->get_override("size")();
#pragma GCC diagnostic pop
}

static void expose() {
bp::class_<BroadPhaseCollisionManagerWrapper, boost::noncopyable>(
Expand Down

0 comments on commit 405fa82

Please sign in to comment.