Skip to content

Commit

Permalink
Fix incorrect type in static_cast
Browse files Browse the repository at this point in the history
Summary: Fix static_cast in flecs C++ API to use correct type.

Differential Revision: D66967950
  • Loading branch information
SanderMertens authored and facebook-github-bot committed Dec 9, 2024
1 parent 57ebed1 commit 70a24ff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions distr/flecs.h
Original file line number Diff line number Diff line change
Expand Up @@ -29299,7 +29299,7 @@ struct term_builder_i : term_ref_builder_i<Base> {
/** Set read/write access of term. */
Base& inout(flecs::inout_kind_t inout) {
this->assert_term();
term_->inout = static_cast<ecs_inout_kind_t>(inout);
term_->inout = static_cast<int16_t>(inout);
return *this;
}

Expand All @@ -29313,7 +29313,7 @@ struct term_builder_i : term_ref_builder_i<Base> {
*/
Base& inout_stage(flecs::inout_kind_t inout) {
this->assert_term();
term_->inout = static_cast<ecs_inout_kind_t>(inout);
term_->inout = static_cast<int16_t>(inout);
if (term_->oper != EcsNot) {
this->src().entity(0);
}
Expand Down Expand Up @@ -29364,7 +29364,7 @@ struct term_builder_i : term_ref_builder_i<Base> {
/** Set operator of term. */
Base& oper(flecs::oper_kind_t oper) {
this->assert_term();
term_->oper = static_cast<ecs_oper_kind_t>(oper);
term_->oper = static_cast<int16_t>(oper);
return *this;
}

Expand Down
6 changes: 3 additions & 3 deletions include/flecs/addons/cpp/mixins/term/builder_i.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ struct term_builder_i : term_ref_builder_i<Base> {
/** Set read/write access of term. */
Base& inout(flecs::inout_kind_t inout) {
this->assert_term();
term_->inout = static_cast<ecs_inout_kind_t>(inout);
term_->inout = static_cast<int16_t>(inout);
return *this;
}

Expand All @@ -295,7 +295,7 @@ struct term_builder_i : term_ref_builder_i<Base> {
*/
Base& inout_stage(flecs::inout_kind_t inout) {
this->assert_term();
term_->inout = static_cast<ecs_inout_kind_t>(inout);
term_->inout = static_cast<int16_t>(inout);
if (term_->oper != EcsNot) {
this->src().entity(0);
}
Expand Down Expand Up @@ -346,7 +346,7 @@ struct term_builder_i : term_ref_builder_i<Base> {
/** Set operator of term. */
Base& oper(flecs::oper_kind_t oper) {
this->assert_term();
term_->oper = static_cast<ecs_oper_kind_t>(oper);
term_->oper = static_cast<int16_t>(oper);
return *this;
}

Expand Down

0 comments on commit 70a24ff

Please sign in to comment.