[go: up one dir, main page]

Skip to content

Format code in C, astyle delete space in funtion pointer in struct.

I want format like this code:

typedef struct {
    const char  *pcName;
    int32_t     (*pfnCmd)(int32_t argc, char *argv[]);
    const char  *pcUsage;
    const char  *pcDesc;
} stc_cli_cmd_t;

,but when I use astyle, code changed to be:

typedef struct {
    const char  *pcName;
    int32_t (*pfnCmd)(int32_t argc, char *argv[]);
    const char  *pcUsage;
    const char  *pcDesc;
} stc_cli_cmd_t;

There are all my options for my C source file.

Astyle -A3s4pHUnk3W3z1vSrm1M80 ./project_folder/*.c,*.h

I know deleting --unpad-paren/-U can avoid this problem, but I want delete space in function define. What shold I do? thanks all.

Edited by Leeto