update clang-format (#666)
This commit is contained in:
@@ -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
|
||||||
|
|||||||
+3
-1
@@ -32,7 +32,9 @@ 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;
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
+6
-2
@@ -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 { \
|
||||||
@@ -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...>;
|
||||||
|
|
||||||
|
|||||||
Vendored
+25
-50
@@ -278,8 +278,7 @@ extern "C" {
|
|||||||
*
|
*
|
||||||
* \see NvFBCGetLastErrorStr
|
* \see NvFBCGetLastErrorStr
|
||||||
*/
|
*/
|
||||||
typedef enum _NVFBCSTATUS
|
typedef enum _NVFBCSTATUS {
|
||||||
{
|
|
||||||
/*!
|
/*!
|
||||||
* This indicates that the API call returned with no errors.
|
* This indicates that the API call returned with no errors.
|
||||||
*/
|
*/
|
||||||
@@ -384,8 +383,7 @@ typedef enum _NVFBCSTATUS
|
|||||||
/*!
|
/*!
|
||||||
* Defines boolean values.
|
* Defines boolean values.
|
||||||
*/
|
*/
|
||||||
typedef enum _NVFBC_BOOL
|
typedef enum _NVFBC_BOOL {
|
||||||
{
|
|
||||||
/*!
|
/*!
|
||||||
* False value.
|
* False value.
|
||||||
*/
|
*/
|
||||||
@@ -404,8 +402,7 @@ typedef enum _NVFBC_BOOL
|
|||||||
/*!
|
/*!
|
||||||
* Capture type.
|
* Capture type.
|
||||||
*/
|
*/
|
||||||
typedef enum _NVFBC_CAPTURE_TYPE
|
typedef enum _NVFBC_CAPTURE_TYPE {
|
||||||
{
|
|
||||||
/*!
|
/*!
|
||||||
* Capture frames to a buffer in system memory.
|
* Capture frames to a buffer in system memory.
|
||||||
*/
|
*/
|
||||||
@@ -439,8 +436,7 @@ typedef enum _NVFBC_CAPTURE_TYPE
|
|||||||
* output captures the region of the X screen that the RandR CRTC is sending to
|
* output captures the region of the X screen that the RandR CRTC is sending to
|
||||||
* the RandR output.
|
* the RandR output.
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
/*!
|
/*!
|
||||||
* By default, NvFBC tries to track a connected primary output. If none is
|
* By default, NvFBC tries to track a connected primary output. If none is
|
||||||
* found, then it tries to track the first connected output. If none is
|
* found, then it tries to track the first connected output. If none is
|
||||||
@@ -471,8 +467,7 @@ typedef enum
|
|||||||
/*!
|
/*!
|
||||||
* Buffer format.
|
* Buffer format.
|
||||||
*/
|
*/
|
||||||
typedef enum _NVFBC_BUFFER_FORMAT
|
typedef enum _NVFBC_BUFFER_FORMAT {
|
||||||
{
|
|
||||||
/*!
|
/*!
|
||||||
* Data will be converted to ARGB8888 byte-order format. 32 bpp.
|
* Data will be converted to ARGB8888 byte-order format. 32 bpp.
|
||||||
*/
|
*/
|
||||||
@@ -519,8 +514,7 @@ typedef uint64_t NVFBC_SESSION_HANDLE;
|
|||||||
* 800x600+100+50 effectively captures a region of 800x600+2020+50 relative to
|
* 800x600+100+50 effectively captures a region of 800x600+2020+50 relative to
|
||||||
* the X screen.
|
* the X screen.
|
||||||
*/
|
*/
|
||||||
typedef struct _NVFBC_BOX
|
typedef struct _NVFBC_BOX {
|
||||||
{
|
|
||||||
/*!
|
/*!
|
||||||
* [in] X offset of the box.
|
* [in] X offset of the box.
|
||||||
*/
|
*/
|
||||||
@@ -542,8 +536,7 @@ typedef struct _NVFBC_BOX
|
|||||||
/*!
|
/*!
|
||||||
* Size used to describe the size of a frame.
|
* Size used to describe the size of a frame.
|
||||||
*/
|
*/
|
||||||
typedef struct _NVFBC_SIZE
|
typedef struct _NVFBC_SIZE {
|
||||||
{
|
|
||||||
/*!
|
/*!
|
||||||
* [in] Width.
|
* [in] Width.
|
||||||
*/
|
*/
|
||||||
@@ -557,8 +550,7 @@ typedef struct _NVFBC_SIZE
|
|||||||
/*!
|
/*!
|
||||||
* Describes information about a captured frame.
|
* Describes information about a captured frame.
|
||||||
*/
|
*/
|
||||||
typedef struct _NVFBC_FRAME_GRAB_INFO
|
typedef struct _NVFBC_FRAME_GRAB_INFO {
|
||||||
{
|
|
||||||
/*!
|
/*!
|
||||||
* [out] Width of the captured frame.
|
* [out] Width of the captured frame.
|
||||||
*/
|
*/
|
||||||
@@ -644,8 +636,7 @@ typedef struct _NVFBC_FRAME_GRAB_INFO
|
|||||||
/*!
|
/*!
|
||||||
* Defines parameters for the CreateHandle() API call.
|
* Defines parameters for the CreateHandle() API call.
|
||||||
*/
|
*/
|
||||||
typedef struct _NVFBC_CREATE_HANDLE_PARAMS
|
typedef struct _NVFBC_CREATE_HANDLE_PARAMS {
|
||||||
{
|
|
||||||
/*!
|
/*!
|
||||||
* [in] Must be set to NVFBC_CREATE_HANDLE_PARAMS_VER
|
* [in] Must be set to NVFBC_CREATE_HANDLE_PARAMS_VER
|
||||||
*/
|
*/
|
||||||
@@ -705,8 +696,7 @@ typedef struct _NVFBC_CREATE_HANDLE_PARAMS
|
|||||||
/*!
|
/*!
|
||||||
* Defines parameters for the ::NvFBCDestroyHandle() API call.
|
* Defines parameters for the ::NvFBCDestroyHandle() API call.
|
||||||
*/
|
*/
|
||||||
typedef struct _NVFBC_DESTROY_HANDLE_PARAMS
|
typedef struct _NVFBC_DESTROY_HANDLE_PARAMS {
|
||||||
{
|
|
||||||
/*!
|
/*!
|
||||||
* [in] Must be set to NVFBC_DESTROY_HANDLE_PARAMS_VER
|
* [in] Must be set to NVFBC_DESTROY_HANDLE_PARAMS_VER
|
||||||
*/
|
*/
|
||||||
@@ -736,8 +726,7 @@ typedef struct _NVFBC_DESTROY_HANDLE_PARAMS
|
|||||||
*
|
*
|
||||||
* \see Requirements
|
* \see Requirements
|
||||||
*/
|
*/
|
||||||
typedef struct _NVFBC_OUTPUT
|
typedef struct _NVFBC_OUTPUT {
|
||||||
{
|
|
||||||
/*!
|
/*!
|
||||||
* Identifier of the RandR output.
|
* Identifier of the RandR output.
|
||||||
*/
|
*/
|
||||||
@@ -758,8 +747,7 @@ typedef struct _NVFBC_OUTPUT
|
|||||||
/*!
|
/*!
|
||||||
* Defines parameters for the ::NvFBCGetStatus() API call.
|
* Defines parameters for the ::NvFBCGetStatus() API call.
|
||||||
*/
|
*/
|
||||||
typedef struct _NVFBC_GET_STATUS_PARAMS
|
typedef struct _NVFBC_GET_STATUS_PARAMS {
|
||||||
{
|
|
||||||
/*!
|
/*!
|
||||||
* [in] Must be set to NVFBC_GET_STATUS_PARAMS_VER
|
* [in] Must be set to NVFBC_GET_STATUS_PARAMS_VER
|
||||||
*/
|
*/
|
||||||
@@ -830,8 +818,7 @@ typedef struct _NVFBC_GET_STATUS_PARAMS
|
|||||||
/*!
|
/*!
|
||||||
* Defines parameters for the ::NvFBCCreateCaptureSession() API call.
|
* Defines parameters for the ::NvFBCCreateCaptureSession() API call.
|
||||||
*/
|
*/
|
||||||
typedef struct _NVFBC_CREATE_CAPTURE_SESSION_PARAMS
|
typedef struct _NVFBC_CREATE_CAPTURE_SESSION_PARAMS {
|
||||||
{
|
|
||||||
/*!
|
/*!
|
||||||
* [in] Must be set to NVFBC_CREATE_CAPTURE_SESSION_PARAMS_VER
|
* [in] Must be set to NVFBC_CREATE_CAPTURE_SESSION_PARAMS_VER
|
||||||
*/
|
*/
|
||||||
@@ -998,8 +985,7 @@ typedef struct _NVFBC_CREATE_CAPTURE_SESSION_PARAMS
|
|||||||
/*!
|
/*!
|
||||||
* Defines parameters for the ::NvFBCDestroyCaptureSession() API call.
|
* Defines parameters for the ::NvFBCDestroyCaptureSession() API call.
|
||||||
*/
|
*/
|
||||||
typedef struct _NVFBC_DESTROY_CAPTURE_SESSION_PARAMS
|
typedef struct _NVFBC_DESTROY_CAPTURE_SESSION_PARAMS {
|
||||||
{
|
|
||||||
/*!
|
/*!
|
||||||
* [in] Must be set to NVFBC_DESTROY_CAPTURE_SESSION_PARAMS_VER
|
* [in] Must be set to NVFBC_DESTROY_CAPTURE_SESSION_PARAMS_VER
|
||||||
*/
|
*/
|
||||||
@@ -1014,8 +1000,7 @@ typedef struct _NVFBC_DESTROY_CAPTURE_SESSION_PARAMS
|
|||||||
/*!
|
/*!
|
||||||
* Defines parameters for the ::NvFBCBindContext() API call.
|
* Defines parameters for the ::NvFBCBindContext() API call.
|
||||||
*/
|
*/
|
||||||
typedef struct _NVFBC_BIND_CONTEXT_PARAMS
|
typedef struct _NVFBC_BIND_CONTEXT_PARAMS {
|
||||||
{
|
|
||||||
/*!
|
/*!
|
||||||
* [in] Must be set to NVFBC_BIND_CONTEXT_PARAMS_VER
|
* [in] Must be set to NVFBC_BIND_CONTEXT_PARAMS_VER
|
||||||
*/
|
*/
|
||||||
@@ -1030,8 +1015,7 @@ typedef struct _NVFBC_BIND_CONTEXT_PARAMS
|
|||||||
/*!
|
/*!
|
||||||
* Defines parameters for the ::NvFBCReleaseContext() API call.
|
* Defines parameters for the ::NvFBCReleaseContext() API call.
|
||||||
*/
|
*/
|
||||||
typedef struct _NVFBC_RELEASE_CONTEXT_PARAMS
|
typedef struct _NVFBC_RELEASE_CONTEXT_PARAMS {
|
||||||
{
|
|
||||||
/*!
|
/*!
|
||||||
* [in] Must be set to NVFBC_RELEASE_CONTEXT_PARAMS_VER
|
* [in] Must be set to NVFBC_RELEASE_CONTEXT_PARAMS_VER
|
||||||
*/
|
*/
|
||||||
@@ -1046,8 +1030,7 @@ typedef struct _NVFBC_RELEASE_CONTEXT_PARAMS
|
|||||||
/*!
|
/*!
|
||||||
* Defines flags that can be used when capturing to system memory.
|
* Defines flags that can be used when capturing to system memory.
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
/*!
|
/*!
|
||||||
* Default, capturing waits for a new frame or mouse move.
|
* Default, capturing waits for a new frame or mouse move.
|
||||||
*
|
*
|
||||||
@@ -1087,8 +1070,7 @@ typedef enum
|
|||||||
/*!
|
/*!
|
||||||
* Defines parameters for the ::NvFBCToSysSetUp() API call.
|
* Defines parameters for the ::NvFBCToSysSetUp() API call.
|
||||||
*/
|
*/
|
||||||
typedef struct _NVFBC_TOSYS_SETUP_PARAMS
|
typedef struct _NVFBC_TOSYS_SETUP_PARAMS {
|
||||||
{
|
|
||||||
/*!
|
/*!
|
||||||
* [in] Must be set to NVFBC_TOSYS_SETUP_PARAMS_VER
|
* [in] Must be set to NVFBC_TOSYS_SETUP_PARAMS_VER
|
||||||
*/
|
*/
|
||||||
@@ -1166,8 +1148,7 @@ typedef struct _NVFBC_TOSYS_SETUP_PARAMS
|
|||||||
/*!
|
/*!
|
||||||
* Defines parameters for the ::NvFBCToSysGrabFrame() API call.
|
* Defines parameters for the ::NvFBCToSysGrabFrame() API call.
|
||||||
*/
|
*/
|
||||||
typedef struct _NVFBC_TOSYS_GRAB_FRAME_PARAMS
|
typedef struct _NVFBC_TOSYS_GRAB_FRAME_PARAMS {
|
||||||
{
|
|
||||||
/*!
|
/*!
|
||||||
* [in] Must be set to NVFBC_TOSYS_GRAB_FRAME_PARAMS_VER
|
* [in] Must be set to NVFBC_TOSYS_GRAB_FRAME_PARAMS_VER
|
||||||
*/
|
*/
|
||||||
@@ -1218,8 +1199,7 @@ typedef struct _NVFBC_TOSYS_GRAB_FRAME_PARAMS
|
|||||||
/*!
|
/*!
|
||||||
* Defines flags that can be used when capturing to a CUDA buffer in video memory.
|
* Defines flags that can be used when capturing to a CUDA buffer in video memory.
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
/*!
|
/*!
|
||||||
* Default, capturing waits for a new frame or mouse move.
|
* Default, capturing waits for a new frame or mouse move.
|
||||||
*
|
*
|
||||||
@@ -1259,8 +1239,7 @@ typedef enum
|
|||||||
/*!
|
/*!
|
||||||
* Defines parameters for the ::NvFBCToCudaSetUp() API call.
|
* Defines parameters for the ::NvFBCToCudaSetUp() API call.
|
||||||
*/
|
*/
|
||||||
typedef struct _NVFBC_TOCUDA_SETUP_PARAMS
|
typedef struct _NVFBC_TOCUDA_SETUP_PARAMS {
|
||||||
{
|
|
||||||
/*!
|
/*!
|
||||||
* [in] Must be set to NVFBC_TOCUDA_SETUP_PARAMS_VER
|
* [in] Must be set to NVFBC_TOCUDA_SETUP_PARAMS_VER
|
||||||
*/
|
*/
|
||||||
@@ -1279,8 +1258,7 @@ typedef struct _NVFBC_TOCUDA_SETUP_PARAMS
|
|||||||
/*!
|
/*!
|
||||||
* Defines parameters for the ::NvFBCToCudaGrabFrame() API call.
|
* Defines parameters for the ::NvFBCToCudaGrabFrame() API call.
|
||||||
*/
|
*/
|
||||||
typedef struct _NVFBC_TOCUDA_GRAB_FRAME_PARAMS
|
typedef struct _NVFBC_TOCUDA_GRAB_FRAME_PARAMS {
|
||||||
{
|
|
||||||
/*!
|
/*!
|
||||||
* [in] Must be set to NVFBC_TOCUDA_GRAB_FRAME_PARAMS_VER.
|
* [in] Must be set to NVFBC_TOCUDA_GRAB_FRAME_PARAMS_VER.
|
||||||
*/
|
*/
|
||||||
@@ -1345,8 +1323,7 @@ typedef struct _NVFBC_TOCUDA_GRAB_FRAME_PARAMS
|
|||||||
/*!
|
/*!
|
||||||
* Defines flags that can be used when capturing to an OpenGL buffer in video memory.
|
* Defines flags that can be used when capturing to an OpenGL buffer in video memory.
|
||||||
*/
|
*/
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
/*!
|
/*!
|
||||||
* Default, capturing waits for a new frame or mouse move.
|
* Default, capturing waits for a new frame or mouse move.
|
||||||
*
|
*
|
||||||
@@ -1391,8 +1368,7 @@ typedef enum
|
|||||||
/*!
|
/*!
|
||||||
* Defines parameters for the ::NvFBCToGLSetUp() API call.
|
* Defines parameters for the ::NvFBCToGLSetUp() API call.
|
||||||
*/
|
*/
|
||||||
typedef struct _NVFBC_TOGL_SETUP_PARAMS
|
typedef struct _NVFBC_TOGL_SETUP_PARAMS {
|
||||||
{
|
|
||||||
/*!
|
/*!
|
||||||
* [in] Must be set to NVFBC_TOGL_SETUP_PARAMS_VER
|
* [in] Must be set to NVFBC_TOGL_SETUP_PARAMS_VER
|
||||||
*/
|
*/
|
||||||
@@ -1458,8 +1434,7 @@ typedef struct _NVFBC_TOGL_SETUP_PARAMS
|
|||||||
/*!
|
/*!
|
||||||
* Defines parameters for the ::NvFBCToGLGrabFrame() API call.
|
* Defines parameters for the ::NvFBCToGLGrabFrame() API call.
|
||||||
*/
|
*/
|
||||||
typedef struct _NVFBC_TOGL_GRAB_FRAME_PARAMS
|
typedef struct _NVFBC_TOGL_GRAB_FRAME_PARAMS {
|
||||||
{
|
|
||||||
/*!
|
/*!
|
||||||
* [in] Must be set to NVFBC_TOGL_GRAB_FRAME_PARAMS_VER.
|
* [in] Must be set to NVFBC_TOGL_GRAB_FRAME_PARAMS_VER.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Vendored
+281
-562
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user