It is written by someone who left the company. I see no reason for this, and I am curious if something is missing for me there.
enum thing_type_e { OPTION_A = 0, OPTION_B, OPTION_C, OPTION_D }; struct thing_type_data_s { enum_type_e mVariable; };
I suggested that it might add more to the structure, but looking at how it is used, I donβt think so.
The ban "he was going to add more to the structure", why you need to pack the only listing in the structure? Is there any motivation that I don't think about?
Update:
As stated in the comments, he used it this way:
void process_thing_type(thing_type_data_s* ParamVariable) { local_variable = ParamVariable->mVariable; ... }
It was originally built using GCC 3.3.5, if that matters.
c ++ c enums struct
kmort
source share