Skip to content

Commit 1292721

Browse files
authored
ci: upgrade clang-format check to v18 (Ubuntu 24.04) (#1723)
1 parent 5b5856b commit 1292721

7 files changed

Lines changed: 32 additions & 24 deletions

File tree

.github/workflows/clang-format.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
jobs:
1212
clang-format-check:
13-
runs-on: ubuntu-22.04
13+
runs-on: ubuntu-24.04
1414
steps:
1515
- name: Checkout
1616
uses: actions/checkout@v4
@@ -19,7 +19,8 @@ jobs:
1919

2020
- name: Install clang format
2121
run: |
22-
sudo apt-get install -y clang-format-13
22+
sudo apt-get update
23+
sudo apt-get install -y clang-format-18
2324
2425
- name: 'Run clang-format'
2526
run: |

ci/check-format.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ elif [[ ${OS} = "Darwin" ]] ; then
2626
fi
2727

2828
# Discover clang-format
29-
if type clang-format-13 2> /dev/null ; then
30-
CLANG_FORMAT=clang-format-13
31-
elif type clang-format 2> /dev/null ; then
29+
if command -v clang-format-18 > /dev/null 2>&1 ; then
30+
CLANG_FORMAT=clang-format-18
31+
elif command -v clang-format > /dev/null 2>&1 ; then
3232
# Clang format found, but need to check version
3333
CLANG_FORMAT=clang-format
3434
V=$(clang-format --version)
35-
if [[ $V != *"version 13.0"* ]]; then
36-
echo "clang-format is not 13.0 (returned ${V})"
35+
if [[ $V != *"version 18"* ]]; then
36+
echo "clang-format is not 18 (returned ${V})"
3737
exit 1
3838
fi
3939
else
40-
echo "No appropriate clang-format found (expected clang-format-13.0.0, or clang-format)"
40+
echo "No appropriate clang-format found (expected clang-format-18, or clang-format)"
4141
exit 1
4242
fi
4343

obs-studio-client/source/controller.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,7 @@ std::shared_ptr<ipc::client> Controller::host(const std::string &uri)
257257
const std::string version = GET_OSN_VERSION;
258258

259259
std::stringstream commandLine;
260-
commandLine << "\"" << serverBinaryPath << "\""
261-
<< " " << uri << " " << version;
260+
commandLine << "\"" << serverBinaryPath << "\"" << " " << uri << " " << version;
262261

263262
std::string workingDirectory;
264263

obs-studio-client/source/utility.hpp

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,15 @@
2828
#include <thread>
2929

3030
#ifdef __cplusplus
31-
#define INITIALIZER(f) \
32-
static void f(void); \
33-
struct f##_t_ { \
34-
f##_t_(void) { f(); } \
35-
}; \
36-
static f##_t_ f##_; \
31+
#define INITIALIZER(f) \
32+
static void f(void); \
33+
struct f##_t_ { \
34+
f##_t_(void) \
35+
{ \
36+
f(); \
37+
} \
38+
}; \
39+
static f##_t_ f##_; \
3740
static void f(void)
3841
#elif defined(_MSC_VER)
3942
#pragma section(".CRT$XCU", read)
@@ -144,11 +147,17 @@ template<typename T> inline std::string TypeOf(T v)
144147
return "unknown";
145148
}
146149

147-
#define AUTO_TYPEOF(x) \
148-
template<> inline std::string TypeOf<x>(x v) { return dstr(x); }
150+
#define AUTO_TYPEOF(x) \
151+
template<> inline std::string TypeOf<x>(x v) \
152+
{ \
153+
return dstr(x); \
154+
}
149155

150-
#define AUTO_TYPEOF_NAME(x, y) \
151-
template<> inline std::string TypeOf<x>(x v) { return y; }
156+
#define AUTO_TYPEOF_NAME(x, y) \
157+
template<> inline std::string TypeOf<x>(x v) \
158+
{ \
159+
return y; \
160+
}
152161

153162
AUTO_TYPEOF_NAME(bool, "boolean");
154163
AUTO_TYPEOF(int8_t);

obs-studio-server/source/nodeobs_display.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,7 @@ class OBS::Display::SystemWorkerThread final {
114114
HWND m_windowHandle = NULL;
115115
};
116116

117-
struct DestroyWindowMessageAnswer : MessageAnswer {
118-
};
117+
struct DestroyWindowMessageAnswer : MessageAnswer {};
119118

120119
SystemWorkerThread() : m_thread(&OBS::Display::SystemWorkerThread::Thread, this) {}
121120
~SystemWorkerThread()

obs-studio-server/source/nodeobs_display.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#include <versionhelpers.h>
3636
#include <windows.h>
3737
EXTERN_C IMAGE_DOS_HEADER __ImageBase;
38-
#define HINST_THISCOMPONENT ((HINSTANCE)&__ImageBase)
38+
#define HINST_THISCOMPONENT ((HINSTANCE) & __ImageBase)
3939

4040
#elif defined(__APPLE__)
4141

0 commit comments

Comments
 (0)