mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-02-19 12:41:00 +00:00
update clang-format (#666)
This commit is contained in:
parent
a7a9df3b9d
commit
f9963ed39b
47
.github/workflows/cpp-lint.yml
vendored
47
.github/workflows/cpp-lint.yml
vendored
@ -3,6 +3,8 @@
|
|||||||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||||
# the above-mentioned repo.
|
# the above-mentioned repo.
|
||||||
|
|
||||||
|
# Lint c++ source files and cmake files.
|
||||||
|
|
||||||
name: C++ Lint
|
name: C++ Lint
|
||||||
|
|
||||||
on:
|
on:
|
||||||
@ -10,45 +12,36 @@ on:
|
|||||||
branches: [master, nightly]
|
branches: [master, nightly]
|
||||||
types: [opened, synchronize, reopened]
|
types: [opened, synchronize, reopened]
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check_src:
|
|
||||||
name: Check src
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Check
|
|
||||||
id: check
|
|
||||||
run: |
|
|
||||||
if [ -d "./src" ]
|
|
||||||
then
|
|
||||||
FOUND=true
|
|
||||||
else
|
|
||||||
FOUND=false
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "src=${FOUND}" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
outputs:
|
|
||||||
src: ${{ steps.check.outputs.src }}
|
|
||||||
|
|
||||||
clang-format:
|
clang-format:
|
||||||
name: Clang Format Lint
|
name: Clang Format Lint
|
||||||
needs: [check_src]
|
|
||||||
if: ${{ needs.check_src.outputs.src == 'true' }}
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Find cpp files
|
||||||
|
id: cpp_files
|
||||||
|
run: |
|
||||||
|
cpp_files=$(find . -type f -iname "*.cpp" -o -iname "*.h" -o -iname "*.m" -o -iname "*.mm")
|
||||||
|
|
||||||
|
echo "found cpp files: ${cpp_files}"
|
||||||
|
|
||||||
|
# do not quote to keep this as a single line
|
||||||
|
echo cpp_files=${cpp_files} >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Clang format lint
|
- name: Clang format lint
|
||||||
|
if: ${{ steps.cpp_files.outputs.cpp_files }}
|
||||||
uses: DoozyX/clang-format-lint-action@v0.15
|
uses: DoozyX/clang-format-lint-action@v0.15
|
||||||
with:
|
with:
|
||||||
source: './src'
|
source: ${{ steps.cpp_files.outputs.cpp_files }}
|
||||||
extensions: 'cpp,h,m,mm'
|
extensions: 'cpp,h,m,mm'
|
||||||
clangFormatVersion: 13
|
clangFormatVersion: 15
|
||||||
style: file
|
style: file
|
||||||
inplace: false
|
inplace: false
|
||||||
|
|
||||||
@ -57,7 +50,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: clang-format-fixes
|
name: clang-format-fixes
|
||||||
path: src/
|
path: ${{ steps.cpp_files.outputs.cpp_files }}
|
||||||
|
|
||||||
cmake-lint:
|
cmake-lint:
|
||||||
name: CMake Lint
|
name: CMake Lint
|
||||||
|
12
src/crypto.h
12
src/crypto.h
@ -84,8 +84,8 @@ public:
|
|||||||
|
|
||||||
class ecb_t : public cipher_t {
|
class ecb_t : public cipher_t {
|
||||||
public:
|
public:
|
||||||
ecb_t() = default;
|
ecb_t() = default;
|
||||||
ecb_t(ecb_t &&) noexcept = default;
|
ecb_t(ecb_t &&) noexcept = default;
|
||||||
ecb_t &operator=(ecb_t &&) noexcept = default;
|
ecb_t &operator=(ecb_t &&) noexcept = default;
|
||||||
|
|
||||||
ecb_t(const aes_t &key, bool padding = true);
|
ecb_t(const aes_t &key, bool padding = true);
|
||||||
@ -96,8 +96,8 @@ public:
|
|||||||
|
|
||||||
class gcm_t : public cipher_t {
|
class gcm_t : public cipher_t {
|
||||||
public:
|
public:
|
||||||
gcm_t() = default;
|
gcm_t() = default;
|
||||||
gcm_t(gcm_t &&) noexcept = default;
|
gcm_t(gcm_t &&) noexcept = default;
|
||||||
gcm_t &operator=(gcm_t &&) noexcept = default;
|
gcm_t &operator=(gcm_t &&) noexcept = default;
|
||||||
|
|
||||||
gcm_t(const crypto::aes_t &key, bool padding = true);
|
gcm_t(const crypto::aes_t &key, bool padding = true);
|
||||||
@ -115,8 +115,8 @@ public:
|
|||||||
|
|
||||||
class cbc_t : public cipher_t {
|
class cbc_t : public cipher_t {
|
||||||
public:
|
public:
|
||||||
cbc_t() = default;
|
cbc_t() = default;
|
||||||
cbc_t(cbc_t &&) noexcept = default;
|
cbc_t(cbc_t &&) noexcept = default;
|
||||||
cbc_t &operator=(cbc_t &&) noexcept = default;
|
cbc_t &operator=(cbc_t &&) noexcept = default;
|
||||||
|
|
||||||
cbc_t(const crypto::aes_t &key, bool padding = true);
|
cbc_t(const crypto::aes_t &key, bool padding = true);
|
||||||
|
@ -31,8 +31,10 @@ int write_file(const char *path, const std::string_view &contents);
|
|||||||
std::uint16_t map_port(int port);
|
std::uint16_t map_port(int port);
|
||||||
|
|
||||||
namespace mail {
|
namespace mail {
|
||||||
#define MAIL(x) \
|
#define MAIL(x) \
|
||||||
constexpr auto x = std::string_view { #x }
|
constexpr auto x = std::string_view { \
|
||||||
|
#x \
|
||||||
|
}
|
||||||
|
|
||||||
extern safe::mail_t man;
|
extern safe::mail_t man;
|
||||||
|
|
||||||
|
@ -158,9 +158,9 @@ struct img_t {
|
|||||||
public:
|
public:
|
||||||
img_t() = default;
|
img_t() = default;
|
||||||
|
|
||||||
img_t(img_t &&) = delete;
|
img_t(img_t &&) = delete;
|
||||||
img_t(const img_t &) = delete;
|
img_t(const img_t &) = delete;
|
||||||
img_t &operator=(img_t &&) = delete;
|
img_t &operator=(img_t &&) = delete;
|
||||||
img_t &operator=(const img_t &) = delete;
|
img_t &operator=(const img_t &) = delete;
|
||||||
|
|
||||||
std::uint8_t *data {};
|
std::uint8_t *data {};
|
||||||
|
@ -35,7 +35,7 @@ class tex_t : public util::buffer_t<GLuint> {
|
|||||||
using util::buffer_t<GLuint>::buffer_t;
|
using util::buffer_t<GLuint>::buffer_t;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
tex_t(tex_t &&) = default;
|
tex_t(tex_t &&) = default;
|
||||||
tex_t &operator=(tex_t &&) = default;
|
tex_t &operator=(tex_t &&) = default;
|
||||||
|
|
||||||
~tex_t();
|
~tex_t();
|
||||||
@ -47,7 +47,7 @@ class frame_buf_t : public util::buffer_t<GLuint> {
|
|||||||
using util::buffer_t<GLuint>::buffer_t;
|
using util::buffer_t<GLuint>::buffer_t;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
frame_buf_t(frame_buf_t &&) = default;
|
frame_buf_t(frame_buf_t &&) = default;
|
||||||
frame_buf_t &operator=(frame_buf_t &&) = default;
|
frame_buf_t &operator=(frame_buf_t &&) = default;
|
||||||
|
|
||||||
~frame_buf_t();
|
~frame_buf_t();
|
||||||
|
@ -39,7 +39,7 @@ public:
|
|||||||
dmabuf_t(const dmabuf_t &) = delete;
|
dmabuf_t(const dmabuf_t &) = delete;
|
||||||
|
|
||||||
dmabuf_t &operator=(const dmabuf_t &) = delete;
|
dmabuf_t &operator=(const dmabuf_t &) = delete;
|
||||||
dmabuf_t &operator=(dmabuf_t &&) = delete;
|
dmabuf_t &operator=(dmabuf_t &&) = delete;
|
||||||
|
|
||||||
dmabuf_t();
|
dmabuf_t();
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ public:
|
|||||||
monitor_t(const monitor_t &) = delete;
|
monitor_t(const monitor_t &) = delete;
|
||||||
|
|
||||||
monitor_t &operator=(const monitor_t &) = delete;
|
monitor_t &operator=(const monitor_t &) = delete;
|
||||||
monitor_t &operator=(monitor_t &&) = delete;
|
monitor_t &operator=(monitor_t &&) = delete;
|
||||||
|
|
||||||
monitor_t(wl_output *output);
|
monitor_t(wl_output *output);
|
||||||
|
|
||||||
@ -130,7 +130,7 @@ public:
|
|||||||
interface_t(const interface_t &) = delete;
|
interface_t(const interface_t &) = delete;
|
||||||
|
|
||||||
interface_t &operator=(const interface_t &) = delete;
|
interface_t &operator=(const interface_t &) = delete;
|
||||||
interface_t &operator=(interface_t &&) = delete;
|
interface_t &operator=(interface_t &&) = delete;
|
||||||
|
|
||||||
interface_t() noexcept;
|
interface_t() noexcept;
|
||||||
|
|
||||||
@ -193,7 +193,7 @@ public:
|
|||||||
monitor_t(const monitor_t &) = delete;
|
monitor_t(const monitor_t &) = delete;
|
||||||
|
|
||||||
monitor_t &operator=(const monitor_t &) = delete;
|
monitor_t &operator=(const monitor_t &) = delete;
|
||||||
monitor_t &operator=(monitor_t &&) = delete;
|
monitor_t &operator=(monitor_t &&) = delete;
|
||||||
|
|
||||||
monitor_t(wl_output *output);
|
monitor_t(wl_output *output);
|
||||||
|
|
||||||
|
@ -193,4 +193,4 @@ std::vector<std::string> display_names(mem_type_e hwdevice_type) {
|
|||||||
|
|
||||||
return display_names;
|
return display_names;
|
||||||
}
|
}
|
||||||
}
|
} // namespace platf
|
||||||
|
@ -84,4 +84,4 @@ public:
|
|||||||
std::unique_ptr<audio_control_t> audio_control() {
|
std::unique_ptr<audio_control_t> audio_control() {
|
||||||
return std::make_unique<macos_audio_control_t>();
|
return std::make_unique<macos_audio_control_t>();
|
||||||
}
|
}
|
||||||
}
|
} // namespace platf
|
||||||
|
@ -142,7 +142,7 @@ typedef struct control_encrypted_t {
|
|||||||
return (uint8_t *)(this + 1);
|
return (uint8_t *)(this + 1);
|
||||||
}
|
}
|
||||||
// encrypted control_header_v2 and payload data follow
|
// encrypted control_header_v2 and payload data follow
|
||||||
} * control_encrypted_p;
|
} *control_encrypted_p;
|
||||||
|
|
||||||
struct audio_fec_packet_raw_t {
|
struct audio_fec_packet_raw_t {
|
||||||
uint8_t *payload() {
|
uint8_t *payload() {
|
||||||
|
@ -21,7 +21,9 @@ template<typename T>
|
|||||||
struct argument_type;
|
struct argument_type;
|
||||||
|
|
||||||
template<typename T, typename U>
|
template<typename T, typename U>
|
||||||
struct argument_type<T(U)> { typedef U type; };
|
struct argument_type<T(U)> {
|
||||||
|
typedef U type;
|
||||||
|
};
|
||||||
|
|
||||||
#define KITTY_USING_MOVE_T(move_t, t, init_val, z) \
|
#define KITTY_USING_MOVE_T(move_t, t, init_val, z) \
|
||||||
class move_t { \
|
class move_t { \
|
||||||
@ -58,22 +60,22 @@ struct argument_type<T(U)> { typedef U type; };
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define KITTY_DECL_CONSTR(x) \
|
#define KITTY_DECL_CONSTR(x) \
|
||||||
x(x &&) noexcept = default; \
|
x(x &&) noexcept = default; \
|
||||||
x &operator=(x &&) noexcept = default; \
|
x &operator=(x &&) noexcept = default; \
|
||||||
x();
|
x();
|
||||||
|
|
||||||
#define KITTY_DEFAULT_CONSTR_MOVE(x) \
|
#define KITTY_DEFAULT_CONSTR_MOVE(x) \
|
||||||
x(x &&) noexcept = default; \
|
x(x &&) noexcept = default; \
|
||||||
x &operator=(x &&) noexcept = default;
|
x &operator=(x &&) noexcept = default;
|
||||||
|
|
||||||
#define KITTY_DEFAULT_CONSTR_MOVE_THROW(x) \
|
#define KITTY_DEFAULT_CONSTR_MOVE_THROW(x) \
|
||||||
x(x &&) = default; \
|
x(x &&) = default; \
|
||||||
x &operator=(x &&) = default; \
|
x &operator=(x &&) = default; \
|
||||||
x() = default;
|
x() = default;
|
||||||
|
|
||||||
#define KITTY_DEFAULT_CONSTR(x) \
|
#define KITTY_DEFAULT_CONSTR(x) \
|
||||||
KITTY_DEFAULT_CONSTR_MOVE(x) \
|
KITTY_DEFAULT_CONSTR_MOVE(x) \
|
||||||
x(const x &) noexcept = default; \
|
x(const x &) noexcept = default; \
|
||||||
x &operator=(const x &) = default;
|
x &operator=(const x &) = default;
|
||||||
|
|
||||||
#define TUPLE_2D(a, b, expr) \
|
#define TUPLE_2D(a, b, expr) \
|
||||||
@ -133,7 +135,9 @@ template<bool V, class X, class Y>
|
|||||||
using either_t = typename __either<V, X, Y>::type;
|
using either_t = typename __either<V, X, Y>::type;
|
||||||
|
|
||||||
template<class... Ts>
|
template<class... Ts>
|
||||||
struct overloaded : Ts... { using Ts::operator()...; };
|
struct overloaded : Ts... {
|
||||||
|
using Ts::operator()...;
|
||||||
|
};
|
||||||
template<class... Ts>
|
template<class... Ts>
|
||||||
overloaded(Ts...) -> overloaded<Ts...>;
|
overloaded(Ts...) -> overloaded<Ts...>;
|
||||||
|
|
||||||
@ -453,7 +457,7 @@ public:
|
|||||||
constexpr uniq_ptr() noexcept : _p { nullptr } {}
|
constexpr uniq_ptr() noexcept : _p { nullptr } {}
|
||||||
constexpr uniq_ptr(std::nullptr_t) noexcept : _p { nullptr } {}
|
constexpr uniq_ptr(std::nullptr_t) noexcept : _p { nullptr } {}
|
||||||
|
|
||||||
uniq_ptr(const uniq_ptr &other) noexcept = delete;
|
uniq_ptr(const uniq_ptr &other) noexcept = delete;
|
||||||
uniq_ptr &operator=(const uniq_ptr &other) noexcept = delete;
|
uniq_ptr &operator=(const uniq_ptr &other) noexcept = delete;
|
||||||
|
|
||||||
template<class V>
|
template<class V>
|
||||||
|
@ -1334,7 +1334,7 @@ void captureThreadSync() {
|
|||||||
ctx.shutdown_event->raise(true);
|
ctx.shutdown_event->raise(true);
|
||||||
ctx.join_event->raise(true);
|
ctx.join_event->raise(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
while(encode_run_sync(synced_session_ctxs, ctx) == encode_e::reinit) {}
|
while(encode_run_sync(synced_session_ctxs, ctx) == encode_e::reinit) {}
|
||||||
}
|
}
|
||||||
@ -1350,7 +1350,7 @@ void capture_async(
|
|||||||
auto lg = util::fail_guard([&]() {
|
auto lg = util::fail_guard([&]() {
|
||||||
images->stop();
|
images->stop();
|
||||||
shutdown_event->raise(true);
|
shutdown_event->raise(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
auto ref = capture_thread_async.ref();
|
auto ref = capture_thread_async.ref();
|
||||||
if(!ref) {
|
if(!ref) {
|
||||||
|
667
third-party/nvfbc/NvFBC.h
vendored
667
third-party/nvfbc/NvFBC.h
vendored
File diff suppressed because it is too large
Load Diff
1659
third-party/nvfbc/helper_math.h
vendored
1659
third-party/nvfbc/helper_math.h
vendored
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user