mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-01-30 03:32:43 +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
|
||||
# the above-mentioned repo.
|
||||
|
||||
# Lint c++ source files and cmake files.
|
||||
|
||||
name: C++ Lint
|
||||
|
||||
on:
|
||||
@ -10,45 +12,36 @@ on:
|
||||
branches: [master, nightly]
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
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:
|
||||
name: Clang Format Lint
|
||||
needs: [check_src]
|
||||
if: ${{ needs.check_src.outputs.src == 'true' }}
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
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
|
||||
if: ${{ steps.cpp_files.outputs.cpp_files }}
|
||||
uses: DoozyX/clang-format-lint-action@v0.15
|
||||
with:
|
||||
source: './src'
|
||||
source: ${{ steps.cpp_files.outputs.cpp_files }}
|
||||
extensions: 'cpp,h,m,mm'
|
||||
clangFormatVersion: 13
|
||||
clangFormatVersion: 15
|
||||
style: file
|
||||
inplace: false
|
||||
|
||||
@ -57,7 +50,7 @@ jobs:
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: clang-format-fixes
|
||||
path: src/
|
||||
path: ${{ steps.cpp_files.outputs.cpp_files }}
|
||||
|
||||
cmake-lint:
|
||||
name: CMake Lint
|
||||
|
12
src/crypto.h
12
src/crypto.h
@ -84,8 +84,8 @@ public:
|
||||
|
||||
class ecb_t : public cipher_t {
|
||||
public:
|
||||
ecb_t() = default;
|
||||
ecb_t(ecb_t &&) noexcept = default;
|
||||
ecb_t() = default;
|
||||
ecb_t(ecb_t &&) noexcept = default;
|
||||
ecb_t &operator=(ecb_t &&) noexcept = default;
|
||||
|
||||
ecb_t(const aes_t &key, bool padding = true);
|
||||
@ -96,8 +96,8 @@ public:
|
||||
|
||||
class gcm_t : public cipher_t {
|
||||
public:
|
||||
gcm_t() = default;
|
||||
gcm_t(gcm_t &&) noexcept = default;
|
||||
gcm_t() = default;
|
||||
gcm_t(gcm_t &&) noexcept = default;
|
||||
gcm_t &operator=(gcm_t &&) noexcept = default;
|
||||
|
||||
gcm_t(const crypto::aes_t &key, bool padding = true);
|
||||
@ -115,8 +115,8 @@ public:
|
||||
|
||||
class cbc_t : public cipher_t {
|
||||
public:
|
||||
cbc_t() = default;
|
||||
cbc_t(cbc_t &&) noexcept = default;
|
||||
cbc_t() = default;
|
||||
cbc_t(cbc_t &&) noexcept = default;
|
||||
cbc_t &operator=(cbc_t &&) noexcept = default;
|
||||
|
||||
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);
|
||||
|
||||
namespace mail {
|
||||
#define MAIL(x) \
|
||||
constexpr auto x = std::string_view { #x }
|
||||
#define MAIL(x) \
|
||||
constexpr auto x = std::string_view { \
|
||||
#x \
|
||||
}
|
||||
|
||||
extern safe::mail_t man;
|
||||
|
||||
|
@ -158,9 +158,9 @@ struct img_t {
|
||||
public:
|
||||
img_t() = default;
|
||||
|
||||
img_t(img_t &&) = delete;
|
||||
img_t(const img_t &) = delete;
|
||||
img_t &operator=(img_t &&) = delete;
|
||||
img_t(img_t &&) = delete;
|
||||
img_t(const img_t &) = delete;
|
||||
img_t &operator=(img_t &&) = delete;
|
||||
img_t &operator=(const img_t &) = delete;
|
||||
|
||||
std::uint8_t *data {};
|
||||
|
@ -35,7 +35,7 @@ class tex_t : public util::buffer_t<GLuint> {
|
||||
using util::buffer_t<GLuint>::buffer_t;
|
||||
|
||||
public:
|
||||
tex_t(tex_t &&) = default;
|
||||
tex_t(tex_t &&) = default;
|
||||
tex_t &operator=(tex_t &&) = default;
|
||||
|
||||
~tex_t();
|
||||
@ -47,7 +47,7 @@ class frame_buf_t : public util::buffer_t<GLuint> {
|
||||
using util::buffer_t<GLuint>::buffer_t;
|
||||
|
||||
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();
|
||||
|
@ -39,7 +39,7 @@ public:
|
||||
dmabuf_t(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();
|
||||
|
||||
@ -91,7 +91,7 @@ public:
|
||||
monitor_t(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);
|
||||
|
||||
@ -130,7 +130,7 @@ public:
|
||||
interface_t(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;
|
||||
|
||||
@ -193,7 +193,7 @@ public:
|
||||
monitor_t(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);
|
||||
|
||||
|
@ -193,4 +193,4 @@ std::vector<std::string> display_names(mem_type_e hwdevice_type) {
|
||||
|
||||
return display_names;
|
||||
}
|
||||
}
|
||||
} // namespace platf
|
||||
|
@ -84,4 +84,4 @@ public:
|
||||
std::unique_ptr<audio_control_t> audio_control() {
|
||||
return std::make_unique<macos_audio_control_t>();
|
||||
}
|
||||
}
|
||||
} // namespace platf
|
||||
|
@ -142,7 +142,7 @@ typedef struct control_encrypted_t {
|
||||
return (uint8_t *)(this + 1);
|
||||
}
|
||||
// encrypted control_header_v2 and payload data follow
|
||||
} * control_encrypted_p;
|
||||
} *control_encrypted_p;
|
||||
|
||||
struct audio_fec_packet_raw_t {
|
||||
uint8_t *payload() {
|
||||
|
@ -21,7 +21,9 @@ template<typename T>
|
||||
struct argument_type;
|
||||
|
||||
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) \
|
||||
class move_t { \
|
||||
@ -58,22 +60,22 @@ struct argument_type<T(U)> { typedef U type; };
|
||||
}
|
||||
|
||||
#define KITTY_DECL_CONSTR(x) \
|
||||
x(x &&) noexcept = default; \
|
||||
x(x &&) noexcept = default; \
|
||||
x &operator=(x &&) noexcept = default; \
|
||||
x();
|
||||
|
||||
#define KITTY_DEFAULT_CONSTR_MOVE(x) \
|
||||
x(x &&) noexcept = default; \
|
||||
#define KITTY_DEFAULT_CONSTR_MOVE(x) \
|
||||
x(x &&) noexcept = default; \
|
||||
x &operator=(x &&) noexcept = default;
|
||||
|
||||
#define KITTY_DEFAULT_CONSTR_MOVE_THROW(x) \
|
||||
x(x &&) = default; \
|
||||
x(x &&) = default; \
|
||||
x &operator=(x &&) = default; \
|
||||
x() = default;
|
||||
|
||||
#define KITTY_DEFAULT_CONSTR(x) \
|
||||
KITTY_DEFAULT_CONSTR_MOVE(x) \
|
||||
x(const x &) noexcept = default; \
|
||||
#define KITTY_DEFAULT_CONSTR(x) \
|
||||
KITTY_DEFAULT_CONSTR_MOVE(x) \
|
||||
x(const x &) noexcept = default; \
|
||||
x &operator=(const x &) = default;
|
||||
|
||||
#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;
|
||||
|
||||
template<class... Ts>
|
||||
struct overloaded : Ts... { using Ts::operator()...; };
|
||||
struct overloaded : Ts... {
|
||||
using Ts::operator()...;
|
||||
};
|
||||
template<class... Ts>
|
||||
overloaded(Ts...) -> overloaded<Ts...>;
|
||||
|
||||
@ -453,7 +457,7 @@ public:
|
||||
constexpr uniq_ptr() 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;
|
||||
|
||||
template<class V>
|
||||
|
@ -1334,7 +1334,7 @@ void captureThreadSync() {
|
||||
ctx.shutdown_event->raise(true);
|
||||
ctx.join_event->raise(true);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
while(encode_run_sync(synced_session_ctxs, ctx) == encode_e::reinit) {}
|
||||
}
|
||||
@ -1350,7 +1350,7 @@ void capture_async(
|
||||
auto lg = util::fail_guard([&]() {
|
||||
images->stop();
|
||||
shutdown_event->raise(true);
|
||||
});
|
||||
});
|
||||
|
||||
auto ref = capture_thread_async.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