I'm trying to find some resources/tutorials to help me create a coccinelle script to find structure declarations and change them from ordered to unordered.
In our code base we use several structs hundreds of times. Somebody added a member in the middle of the definition and now I need to update hundreds of declarations. A default value of 0 is good so if I switch all the declarations from order to unordered, all is good, and more future proof for next change.
Ex:
struct some_struct {
int blah;
int blah2;
}
// code is like this now.
struct some_struct ex1 = {
0,
1,
};
// Need script to change to this
struct some_struct ex2 = {
.blah1 = 0,
.blah2 = 1
}
Can anybody point me in the right direction?