Skip to content

Commit

Permalink
Merge pull request #7 from giordano/mg/enums-if-eq
Browse files Browse the repository at this point in the history
Type-cast enums to `int` before comparison
  • Loading branch information
parke committed Nov 13, 2021
2 parents 53ae190 + 405d49c commit a9cdb42
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 a9cdb42

Please sign in to comment.