From 04db76ac80e8f629712aca08bdee9b18dfa160ce Mon Sep 17 00:00:00 2001 From: Sam V Date: Mon, 29 Nov 2021 22:53:18 +0100 Subject: [PATCH] Allow short case labels on single line, wrap braces before lambda bodies #84 --- .clang-format | 2 ++ dlls/soundent.cpp | 9 ++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.clang-format b/.clang-format index 3201b87..d227918 100644 --- a/.clang-format +++ b/.clang-format @@ -6,9 +6,11 @@ AccessModifierOffset: -4 AlignAfterOpenBracket: DontAlign AllowShortBlocksOnASingleLine: true +AllowShortCaseLabelsOnASingleLine: true AllowShortFunctionsOnASingleLine: All BasedOnStyle: LLVM BraceWrapping: + BeforeLambdaBody: true AfterCaseLabel: true AfterClass: true AfterControlStatement: true diff --git a/dlls/soundent.cpp b/dlls/soundent.cpp index 0ca277f..654b519 100644 --- a/dlls/soundent.cpp +++ b/dlls/soundent.cpp @@ -270,13 +270,12 @@ void CSoundEnt::Initialize() //========================================================= int CSoundEnt::ISoundsInList(int iListType) { - int iThisSound = [=]() { + int iThisSound = [=]() + { switch (iListType) { - case SOUNDLISTTYPE_FREE: - return m_iFreeSound; - case SOUNDLISTTYPE_ACTIVE: - return m_iActiveSound; + case SOUNDLISTTYPE_FREE: return m_iFreeSound; + case SOUNDLISTTYPE_ACTIVE: return m_iActiveSound; default: ALERT(at_console, "Unknown Sound List Type!\n"); return SOUNDLIST_EMPTY;