From 0444a6f0949f8ddb3426e55d3b83b7a5302a15d0 Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Fri, 2 Feb 2024 20:46:12 +0100 Subject: [PATCH] `.clang-format`: break short enums, TypenameMacros (#1671) * IndentPPDirectives: AfterHash * AllowShortEnumsOnASingleLine: false * IndentPPDirectives: BeforeHash * format * format * TypenameMacros: [BAD_RETURN] * IndentPPDirectives: None --- .clang-format | 3 +++ src/code/ucode_disas.c | 7 ++++++- src/code/z_skelanime.c | 15 ++++++--------- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.clang-format b/.clang-format index c7b900f060..f3d4b9afd3 100644 --- a/.clang-format +++ b/.clang-format @@ -7,6 +7,7 @@ BreakBeforeBraces: Attach SpaceAfterCStyleCast: false Cpp11BracedListStyle: false IndentCaseLabels: true +IndentPPDirectives: None BinPackArguments: true BinPackParameters: true AlignAfterOpenBracket: Align @@ -18,6 +19,8 @@ AllowShortIfStatementsOnASingleLine: false AllowShortLoopsOnASingleLine: false AllowShortCaseLabelsOnASingleLine: false AllowShortFunctionsOnASingleLine: false +AllowShortEnumsOnASingleLine: false AlignEscapedNewlines: Left AlignTrailingComments: true SortIncludes: false +TypenameMacros: ['BAD_RETURN'] diff --git a/src/code/ucode_disas.c b/src/code/ucode_disas.c index cabc5a051d..de6f7eed4f 100644 --- a/src/code/ucode_disas.c +++ b/src/code/ucode_disas.c @@ -69,7 +69,12 @@ F3dzexFlag sUCodeDisasMtxFlags[] = { F3DZEX_FLAG(G_MTX_PUSH, G_MTX_NOPUSH), }; -typedef enum { COMBINER_A = 1, COMBINER_B, COMBINER_C, COMBINER_D } CombinerArg; +typedef enum { + COMBINER_A = 1, + COMBINER_B, + COMBINER_C, + COMBINER_D +} CombinerArg; const char* UCodeDisas_GetCombineColorName(u32 value, u32 arg) { const char* ret = "?"; diff --git a/src/code/z_skelanime.c b/src/code/z_skelanime.c index 5d421cd587..4be3f6735c 100644 --- a/src/code/z_skelanime.c +++ b/src/code/z_skelanime.c @@ -1374,9 +1374,8 @@ s32 LinkAnimation_OnFrame(SkelAnime* skelAnime, f32 frame) { /** * Initializes a normal skeleton to a looping animation, dynamically allocating the frame tables if not provided. */ -BAD_RETURN(s32) -SkelAnime_Init(PlayState* play, SkelAnime* skelAnime, SkeletonHeader* skeletonHeaderSeg, AnimationHeader* animation, - Vec3s* jointTable, Vec3s* morphTable, s32 limbCount) { +BAD_RETURN(s32) SkelAnime_Init(PlayState* play, SkelAnime* skelAnime, SkeletonHeader* skeletonHeaderSeg, + AnimationHeader* animation, Vec3s* jointTable, Vec3s* morphTable, s32 limbCount) { SkeletonHeader* skeletonHeader = SEGMENTED_TO_VIRTUAL(skeletonHeaderSeg); skelAnime->limbCount = skeletonHeader->limbCount + 1; @@ -1405,9 +1404,8 @@ SkelAnime_Init(PlayState* play, SkelAnime* skelAnime, SkeletonHeader* skeletonHe /** * Initializes a flex skeleton to a looping animation, dynamically allocating the frame tables if not given. */ -BAD_RETURN(s32) -SkelAnime_InitFlex(PlayState* play, SkelAnime* skelAnime, FlexSkeletonHeader* skeletonHeaderSeg, - AnimationHeader* animation, Vec3s* jointTable, Vec3s* morphTable, s32 limbCount) { +BAD_RETURN(s32) SkelAnime_InitFlex(PlayState* play, SkelAnime* skelAnime, FlexSkeletonHeader* skeletonHeaderSeg, + AnimationHeader* animation, Vec3s* jointTable, Vec3s* morphTable, s32 limbCount) { FlexSkeletonHeader* skeletonHeader = SEGMENTED_TO_VIRTUAL(skeletonHeaderSeg); skelAnime->limbCount = skeletonHeader->sh.limbCount + 1; @@ -1440,9 +1438,8 @@ SkelAnime_InitFlex(PlayState* play, SkelAnime* skelAnime, FlexSkeletonHeader* sk /** * Initializes a skeleton with SkinLimbs to a looping animation, dynamically allocating the frame tables. */ -BAD_RETURN(s32) -SkelAnime_InitSkin(PlayState* play, SkelAnime* skelAnime, SkeletonHeader* skeletonHeaderSeg, - AnimationHeader* animation) { +BAD_RETURN(s32) SkelAnime_InitSkin(PlayState* play, SkelAnime* skelAnime, SkeletonHeader* skeletonHeaderSeg, + AnimationHeader* animation) { SkeletonHeader* skeletonHeader = SEGMENTED_TO_VIRTUAL(skeletonHeaderSeg); skelAnime->limbCount = skeletonHeader->limbCount + 1;