In the huge (millons of LOC) C project I want to expand a "double" type into a struct containing two doubles:
Now I have
typedef double popular_type;
//... a lot (>1k) usage of the type in expressions like:
popular_type a;
a = (popular_type) some_double_variable;
I want to change popular_type definition into
#ifdef SYNTHETIC_POPULAR_TYPE
typedef struct {
double orig_field;
double additional_field;
} popular_type;
#else
typedef double popular_type;
#endif
If I do not change the expressions like
popular_type a;
a = (popular_type) some_double_variable;
to
popular_type a;
a.orig_field = some_double_variable;
will the program work?
How can I redeclare popular_type
in order that I do not have to change all assignments?