gr: Fix type of OnDemoInit callbacks - #3300
Conversation
These callbacks can be called with a non-0/1 argument via fn_80169444, so the argument can't be a bool.
|
It's seemingly an enum and not a ground segment. |
|
If we're refactoring anyway we should make an enum with values 0, 1, and 2. |
|
This has been up for a while so let me clarify where I'm at. This is a good point that I hadn't originally considered - since you made me aware of that, I've intended to do the bool -> enum_t refactor, but need to look into a method to enforce this a bit better, if possible. Seems simple but has some sticking points! The bool -> int refactor is motivated by the "native build" CI check where "bool" is a proper primitive type, rather than being aliased to int as in the MWCC build, so this PR is actually needed to widen the native build check to gr/ code. You should be able to reproduce this yourself; try widening the Properly refactoring int -> enum_t here would be a bit wider than the existing diff, I think, because AFAIK there are some existing callbacks taking So basically, this is still valid and important, but has turned into a big yak shave that I'll need to set aside some time to look into 😉 |
|
Yeah that makes sense, and I was suggesting a specific placeholder enum definition rather than |
These callbacks can be called with a non-0/1 argument via fn_80169444, so the argument can't be a bool.