Skip to content

Commit

Permalink
Type-cast enums to int before comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
giordano committed Nov 10, 2021
1 parent 53ae190 commit 405d49c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lxroot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -728,8 +728,8 @@ struct Syscall { // xxsy ----------------------------- struct Syscall

// the below verbose yet simple implementation should optimize well.

#define if_equal( a, b ) ( a == b ? b : 0 )
#define if_not_equal( a, b ) ( ( a != b ) && ( n & a ) ? b : 0 )
#define if_equal( a, b ) ( (int)a == (int)b ? b : 0 )
#define if_not_equal( a, b ) ( ( (int)a != (int)b ) && ( n & a ) ? b : 0 )

constexpr flags_t copy_these_bits =
if_equal ( ST_RDONLY, MS_RDONLY )
Expand Down

0 comments on commit 405d49c

Please sign in to comment.