Skip to content

Commit

Permalink
Use the hx::LessEq functions for cppia comparisons. For HaxeFoundatio…
Browse files Browse the repository at this point in the history
  • Loading branch information
hughsando committed Jun 18, 2019
1 parent 57a497a commit f92059c
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/hx/cppia/Cppia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7883,24 +7883,24 @@ struct name \
template<typename T> \
inline bool test(const T &left, const T&right) \
{ \
return left OP right; \
return OP(left,right); \
} \
};

#ifdef CPPIA_JIT
DEFINE_COMPARE_OP(CompareLess,<, cmpI_SIG_LESS, cmpI_SIG_GREATER_EQUAL, cmpD_LESS,cmpD_GREATER_EQUAL);
DEFINE_COMPARE_OP(CompareLessEq,<=, cmpI_SIG_LESS_EQUAL, cmpI_SIG_GREATER, cmpD_LESS_EQUAL,cmpD_GREATER);
DEFINE_COMPARE_OP(CompareGreater,>, cmpI_SIG_GREATER, cmpI_SIG_LESS_EQUAL, cmpD_GREATER, cmpD_LESS_EQUAL);
DEFINE_COMPARE_OP(CompareGreaterEq,>=,cmpI_SIG_GREATER_EQUAL,cmpI_SIG_LESS, cmpD_GREATER_EQUAL, cmpD_LESS);
DEFINE_COMPARE_OP(CompareEqual,==, cmpI_EQUAL, cmpI_NOT_EQUAL, cmpD_EQUAL, cmpD_NOT_EQUAL);
DEFINE_COMPARE_OP(CompareNotEqual,!=, cmpI_NOT_EQUAL, cmpI_EQUAL, cmpD_NOT_EQUAL, cmpD_EQUAL);
DEFINE_COMPARE_OP(CompareLess, hx::IsLess, cmpI_SIG_LESS, cmpI_SIG_GREATER_EQUAL, cmpD_LESS,cmpD_GREATER_EQUAL);
DEFINE_COMPARE_OP(CompareLessEq, hx::IsLessEq, cmpI_SIG_LESS_EQUAL, cmpI_SIG_GREATER, cmpD_LESS_EQUAL,cmpD_GREATER);
DEFINE_COMPARE_OP(CompareGreater, hx::IsGreater, cmpI_SIG_GREATER, cmpI_SIG_LESS_EQUAL, cmpD_GREATER, cmpD_LESS_EQUAL);
DEFINE_COMPARE_OP(CompareGreaterEq, hx::IsGreaterEq ,cmpI_SIG_GREATER_EQUAL,cmpI_SIG_LESS, cmpD_GREATER_EQUAL, cmpD_LESS);
DEFINE_COMPARE_OP(CompareEqual, hx::IsEq, cmpI_EQUAL, cmpI_NOT_EQUAL, cmpD_EQUAL, cmpD_NOT_EQUAL);
DEFINE_COMPARE_OP(CompareNotEqual, hx::IsNotEq, cmpI_NOT_EQUAL, cmpI_EQUAL, cmpD_NOT_EQUAL, cmpD_EQUAL);
#else
DEFINE_COMPARE_OP(CompareLess,<,0,0,0,0);
DEFINE_COMPARE_OP(CompareLessEq,<=,0,0,0,0);
DEFINE_COMPARE_OP(CompareGreater,>,0,0,0,0);
DEFINE_COMPARE_OP(CompareGreaterEq,>=,0,0,0,0);
DEFINE_COMPARE_OP(CompareEqual,==,0,0,0,0);
DEFINE_COMPARE_OP(CompareNotEqual,!=,0,0,0,0);
DEFINE_COMPARE_OP(CompareLess, hx::IsLess ,0,0,0,0);
DEFINE_COMPARE_OP(CompareLessEq, hx::IsLessEq,0,0,0,0);
DEFINE_COMPARE_OP(CompareGreater, hx::IsGreater ,0,0,0,0);
DEFINE_COMPARE_OP(CompareGreaterEq, hx::IsGreaterEq,0,0,0,0);
DEFINE_COMPARE_OP(CompareEqual,hx::IsEq,0,0,0,0);
DEFINE_COMPARE_OP(CompareNotEqual,hx::IsNotEq,0,0,0,0);
#endif


Expand Down

2 comments on commit f92059c

@kLabz
Copy link

@kLabz kLabz commented on f92059c Jun 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hughsando
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix was good (too good!) and showed an issue with Array.map on cppia, which should now be fixed.

Please sign in to comment.