summaryrefslogtreecommitdiffstats
path: root/parse.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2020-07-29 22:44:53 -0400
committerTavian Barnes <tavianator@tavianator.com>2020-07-29 22:53:27 -0400
commitf7b03c0695b313a0ddd527d4bbd6c50c010bd7e4 (patch)
tree667ae9a0b75cf6d1cf5503f9e9e9dd8d866a826a /parse.c
parent5590685c30b7af5441938938db68a66e42820507 (diff)
downloadbfs-f7b03c0695b313a0ddd527d4bbd6c50c010bd7e4.tar.xz
bftw: Rename bftw_typeflag to bftw_type, and make it not a bitmask
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c9
1 files changed, 5 insertions, 4 deletions
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;
}