Note to Zebediah (mainly on second commit of this serie):
- there is also a load of 'uint32_t flags' parameters that I didn't change (mainly not to change too many things) Is this something to consider?
Not Zebediah, but IMO uint32_t is the right type for flags, as well as for other bit-masks like "location" in patch 3/3.