简体   繁体   中英

uncrustify, c, align struct init member

I am looking for the parameter to align initialization.
before:

V_Zyle[Z1]=(Zylinder){&AP31[0], &AP31[1], &XP12_22_1, &XP12_22_2, 0, 0, ZY_PL}; // Z1 Drehzylinder Vereinzelung
V_Zyle[Z2]=(Zylinder){&AP31[2], &AP31[3], NULL, NULL, 0, 0, ZY_GR};             // Z2 Blasluft Topf Gehäuse
V_Zyle[Z3]=(Zylinder){&AP31[4], &AP31[5], NULL, NULL, 0, 0, ZY_GR};             // Z3 Blasluft Zuführung Gehäuse

after:

V_Zyle[Z1]=(Zylinder){&AP31[0], &AP31[1], &XP12_22_1, &XP12_22_2, 0, 0, ZY_PL}; // Z1 Drehzylinder Vereinzelung
V_Zyle[Z2]=(Zylinder){&AP31[2], &AP31[3], NULL,       NULL,       0, 0, ZY_GR}; // Z2 Blasluft Topf Gehäuse
V_Zyle[Z3]=(Zylinder){&AP31[4], &AP31[5], NULL,       NULL,       0, 0, ZY_GR}; // Z3 Blasluft Zuführung Gehäuse

Hopefully there is a way to do this.

No there is no option for that currently, there is however:

Align parameters in single-line functions that have the same name. The function names must already be aligned with each other.

align_same_func_call_params     = true     # false/true

which does similar aligning for function call params. If you need that soon-ish you could, based on that, write a new option. Alternatively you can submit a feature request at the github repo.


What's with the downvotes on the question? Seems reasonable to me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM