diff: convert flags to be stored in bitfields