Skip to content
Snippets Groups Projects
Commit 944900c4 authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

Don't pass enums in the `cell_*_flag` functions, but rather use the type of...

Don't pass enums in the `cell_*_flag` functions, but rather use the type of the `flags` value itself. Using the enum causes problems when passing the union of more than one flag.
parent 649cd738
Branches
Tags
1 merge request!792Cell flags
...@@ -1292,19 +1292,19 @@ __attribute__((always_inline)) INLINE static void cell_free_stars_sorts( ...@@ -1292,19 +1292,19 @@ __attribute__((always_inline)) INLINE static void cell_free_stars_sorts(
/** Set the given flag for the given cell. */ /** Set the given flag for the given cell. */
__attribute__((always_inline)) INLINE static void cell_set_flag( __attribute__((always_inline)) INLINE static void cell_set_flag(
struct cell *c, enum cell_flags flag) { struct cell *c, uint16_t cell_flags flag) {
c->flags |= flag; c->flags |= flag;
} }
/** Clear the given flag for the given cell. */ /** Clear the given flag for the given cell. */
__attribute__((always_inline)) INLINE static void cell_clear_flag( __attribute__((always_inline)) INLINE static void cell_clear_flag(
struct cell *c, enum cell_flags flag) { struct cell *c, uint16_t cell_flags flag) {
c->flags &= ~flag; c->flags &= ~flag;
} }
/** Get the given flag for the given cell. */ /** Get the given flag for the given cell. */
__attribute__((always_inline)) INLINE static int cell_get_flag( __attribute__((always_inline)) INLINE static int cell_get_flag(
const struct cell *c, enum cell_flags flag) { const struct cell *c, uint16_t cell_flags flag) {
return (c->flags & flag) > 0; return (c->flags & flag) > 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment