Replace nonportable assumption of bitfields order with bitwise operations