[英]aligning function declarations in clang-format
我在函數聲明對齊方面有問題。
考慮:
RplInstanceS* RplGetInstance(inst_t instID, uint8_t createFlag);
RplDagS* RplGetDag(RplInstanceS* inst, RplAddrS* dagID, uint8_t createFlag);
void RplFreeInstance(RplInstanceS* inst, uint8_t forced);
void ResetDioTrickle(RplDagS* dag);
RplDagS* GetNextInuseDag(int* state);
void RplFreeAllInstances(void);
uint8_t CountAllInstances(void);
uint8_t StartAllInstances(void);
我希望可以有一個 clang-format 選項將其轉換為:
RplInstanceS* RplGetInstance(inst_t instID, uint8_t createFlag);
RplDagS* RplGetDag(RplInstanceS* inst, RplAddrS* dagID, uint8_t createFlag);
void RplFreeInstance(RplInstanceS* inst, uint8_t forced);
void ResetDioTrickle(RplDagS* dag);
RplDagS* GetNextInuseDag(int* state);
void RplFreeAllInstances(void);
uint8_t CountAllInstances(void);
uint8_t StartAllInstances(void);
沒有特定於函數的選項,但有AlignConsecutiveDeclarations
選項,如果設置為true
對齊連續聲明。
這可以與PointerAlignment
選項一起使用,其值設置為PAS_Left
(在配置中:Left),這將使指針向左對齊。
這兩個選項的組合應該給你你正在尋找的東西。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.