diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2020-07-29 22:44:53 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2020-07-29 22:53:27 -0400 |
commit | f7b03c0695b313a0ddd527d4bbd6c50c010bd7e4 (patch) | |
tree | 667ae9a0b75cf6d1cf5503f9e9e9dd8d866a826a /parse.c | |
parent | 5590685c30b7af5441938938db68a66e42820507 (diff) |
bftw: Rename bftw_typeflag to bftw_type, and make it not a bitmask
Diffstat (limited to 'parse.c')
-rw-r--r-- | parse.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -2388,12 +2388,12 @@ static struct expr *parse_type(struct parser_state *state, int x, int arg2) { return NULL; } - enum bftw_typeflag types = 0; + unsigned int types = 0; double probability = 0.0; const char *c = expr->sdata; while (true) { - enum bftw_typeflag type; + enum bftw_type type; double type_prob; switch (*c) { @@ -2444,8 +2444,9 @@ static struct expr *parse_type(struct parser_state *state, int x, int arg2) { goto fail; } - if (!(types & type)) { - types |= type; + unsigned int flag = 1 << type; + if (!(types & flag)) { + types |= flag; probability += type_prob; } |