I have an Ada enum with 2 values type Polarity is (Normal, Reversed), and I would like to convert them to 0, 1 (or True, False–as Boolean seems to implicitly play nice as binary) respectively, so I can store their values as specific bits in a byte. How can I accomplish this?
I have an Ada enum with 2 values type Polarity is (Normal, Reversed) ,
Share
It seems all I needed to do was
pragma Pack([type name]);(in which ‘type name’ is the type composed of Polarity) to compress the value down to a single bit.