07-27-2023, 11:17 AM
This is written by someone who has left the company. I can't see any reason to do this and am curious if there's something I am missing.
enum thing_type_e
{
OPTION_A = 0,
OPTION_B,
OPTION_C,
OPTION_D
};
struct thing_type_data_s
{
enum_type_e mVariable;
};
I supposed it's possible he was going to add more to the structure, but after looking at how it is used, I don't think so.
Barring "he was going to add more to the structure," why package a single enum in a struct? Is there some motivation I'm not thinking of?
**Update:**
As asked in the comments, he used it in this fashion:
void process_thing_type(thing_type_data_s* ParamVariable)
{
local_variable = ParamVariable->mVariable;
...
}
This was originally built with GCC 3.3.5 if it makes any difference.
enum thing_type_e
{
OPTION_A = 0,
OPTION_B,
OPTION_C,
OPTION_D
};
struct thing_type_data_s
{
enum_type_e mVariable;
};
I supposed it's possible he was going to add more to the structure, but after looking at how it is used, I don't think so.
Barring "he was going to add more to the structure," why package a single enum in a struct? Is there some motivation I'm not thinking of?
**Update:**
As asked in the comments, he used it in this fashion:
void process_thing_type(thing_type_data_s* ParamVariable)
{
local_variable = ParamVariable->mVariable;
...
}
This was originally built with GCC 3.3.5 if it makes any difference.