From f7b03c0695b313a0ddd527d4bbd6c50c010bd7e4 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 29 Jul 2020 22:44:53 -0400 Subject: bftw: Rename bftw_typeflag to bftw_type, and make it not a bitmask --- parse.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'parse.c') diff --git a/parse.c b/parse.c index f990a69..3e54ef6 100644 --- a/parse.c +++ b/parse.c @@ -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; } -- cgit v1.2.3