Skip to content

Commit ad4cabd

Browse files
committed
formatting fixes
- apply precommit hooks - make sure all files contain a newline at EOF - remove trailing whitespace (for non-markdown files)
1 parent 3bd8699 commit ad4cabd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+604
-604
lines changed

.github/workflows/cmake.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
include:
2929
- enable-vulkan: 'on'
3030
vulkan-deps: 'libvulkan-dev'
31-
31+
3232
- compiler: 'clang'
3333
clang-deps: 'clang'
3434
steps:
@@ -66,7 +66,7 @@ jobs:
6666
- name: Test
6767
working-directory: build
6868
run: ctest -C ${{ matrix.build-type }} --output-on-failure
69-
69+
7070
container:
7171
name: Build & Test in Container
7272
runs-on: ubuntu-latest
@@ -91,12 +91,12 @@ jobs:
9191
include:
9292
- enable-vulkan: 'on'
9393
vulkan-deps: 'libvulkan-dev'
94-
94+
9595
- compiler: 'clang'
9696
clang-deps: 'clang'
9797
steps:
9898
# git needs to be installed before checking out, otherwise the checkout will fallback to the REST API,
99-
# and the submodule download won't work.
99+
# and the submodule download won't work.
100100
- name: Install dependencies
101101
run: |
102102
apt-get update && apt-get install -y \
@@ -129,4 +129,3 @@ jobs:
129129
- name: Test
130130
working-directory: build
131131
run: ctest -C ${{ matrix.build-type }} --output-on-failure
132-

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@ repos:
55
- id: check-yaml
66
- id: end-of-file-fixer
77
- id: trailing-whitespace
8+
exclude_types: ['markdown']
89
- id: forbid-new-submodules
10+
- id: mixed-line-ending
11+
args: ['--fix=lf']
12+
description: Forces to replace line ending by the UNIX 'lf' character.

CMakeLists.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ target_compile_definitions(flutterpi_module PRIVATE
201201
LIBINPUT_VERSION_PATCH=${LIBINPUT_VERSION_PATCH}
202202
)
203203

204-
# TODO: Just unconditionally define those, make them optional later
204+
# TODO: Just unconditionally define those, make them optional later
205205
target_compile_definitions(flutterpi_module PRIVATE HAS_KMS HAS_GBM HAS_FBDEV)
206206

207207
pkg_check_modules(EGL IMPORTED_TARGET egl)
@@ -259,7 +259,7 @@ else()
259259
if(NOT ogl_registry_POPULATED)
260260
FetchContent_Populate(ogl_registry)
261261
endif()
262-
262+
263263
target_include_directories(flutterpi_module PRIVATE ${ogl_registry_SOURCE_DIR}/api/)
264264
endif()
265265

@@ -485,37 +485,37 @@ if(LTO AND (CMAKE_BUILD_TYPE STREQUAL Release OR CMAKE_BUILD_TYPE STREQUAL RelWi
485485
if (NOT IPO_SUPPORTED)
486486
message(WARNING "IPO/LTO was requested in the configure options, but is not supported by the toolchain. Check CMakeFiles/CMakeError.log for details.")
487487
endif()
488-
488+
489489
# Try to enable IPO with gold and lld.
490490
# Needs CMP0138.
491491
# (untested because CMP0138 required CMake 3.24, that's why it's commented out)
492492
# if (NOT IPO_SUPPORTED)
493493
# check_linker_flag(C "-fuse-ld=gold" SUPPORTS_GOLD)
494494
# if (SUPPORTS_GOLD)
495495
# set(OLD_CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
496-
#
496+
#
497497
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fuse-ld=gold")
498498
# try_compile()
499499
# check_ipo_supported(RESULT IPO_SUPPORTED_WITH_GOLD OUTPUT IPO_SUPPORT_OUTPUT)
500500
# if (IPO_SUPPORTED_WITH_GOLD)
501501
# set(IPO_SUPPORTED ON)
502502
# set(NEEDS_GOLD ON)
503503
# endif()
504-
#
504+
#
505505
# set(CMAKE_C_FLAGS "${OLD_CMAKE_C_FLAGS}")
506506
# endif()
507507
#
508508
# check_linker_flag(C "-fuse-ld=lld" SUPPORTS_LLD)
509509
# if (SUPPORTS_LLD)
510510
# set(OLD_CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
511-
#
511+
#
512512
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fuse-ld=lld")
513513
# check_ipo_supported(RESULT IPO_SUPPORTED_WITH_LLD OUTPUT IPO_SUPPORT_OUTPUT)
514514
# if (IPO_SUPPORTED_WITH_LLD)
515515
# set(IPO_SUPPORTED ON)
516516
# set(NEEDS_LLD ON)
517517
# endif()
518-
#
518+
#
519519
# set(CMAKE_C_FLAGS "${OLD_CMAKE_C_FLAGS}")
520520
# endif()
521521
# endif()
@@ -528,7 +528,7 @@ if(LTO AND (CMAKE_BUILD_TYPE STREQUAL Release OR CMAKE_BUILD_TYPE STREQUAL RelWi
528528
set(IPO_SUPPORTED OFF)
529529
endif()
530530
endif()
531-
531+
532532
if (IPO_SUPPORTED)
533533
set(USE_LTO ON)
534534
endif()

include/collection.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct concurrent_queue {
3636

3737
struct pointer_set {
3838
/**
39-
* @brief The number of non-NULL pointers currently stored in @ref pointers.
39+
* @brief The number of non-NULL pointers currently stored in @ref pointers.
4040
*/
4141
size_t count_pointers;
4242

@@ -351,7 +351,7 @@ static inline int cpset_remove_locked(
351351
struct concurrent_pointer_set *set,
352352
const void *pointer
353353
) {
354-
return pset_remove(&set->set, pointer);
354+
return pset_remove(&set->set, pointer);
355355
}
356356

357357
static inline int cpset_remove(
@@ -540,7 +540,7 @@ static inline bool refcount_is_zero(refcount_t *refcount) {
540540
}
541541

542542
/// Get the current reference count, without any memory ordering restrictions.
543-
/// Not strictly correct, should only be used for debugging.
543+
/// Not strictly correct, should only be used for debugging.
544544
static inline int refcount_get_for_debug(refcount_t *refcount) {
545545
return atomic_load_explicit(refcount, memory_order_relaxed);
546546
}
@@ -749,7 +749,7 @@ typedef void (*void_callback_t)(void *userdata);
749749

750750
/**
751751
* @brief A 2-dimensional vector with 2 float coordinates.
752-
*
752+
*
753753
*/
754754
struct vec2f {
755755
double x, y;
@@ -762,14 +762,14 @@ ATTR_CONST static inline struct vec2f vec2f_add(struct vec2f a, struct vec2f b)
762762
}
763763

764764
struct vec2i {
765-
int x, y;
765+
int x, y;
766766
};
767767

768768
#define VEC2I(_x, _y) ((struct vec2i) {.x = (_x), .y = (_y)})
769769

770770
/**
771771
* @brief A quadrilateral with 4 2-dimensional float coordinates.
772-
*
772+
*
773773
*/
774774
struct quad {
775775
struct vec2f top_left, top_right, bottom_left, bottom_right;
@@ -852,8 +852,8 @@ struct mat3f {
852852

853853
/**
854854
* @brief Returns a matrix that is the result of matrix-multiplying a with b.
855-
*
856-
* @param a The first (lhs) input matrix.
855+
*
856+
* @param a The first (lhs) input matrix.
857857
* @param b The second (rhs) input matrix.
858858
* @return struct mat3f The product of a x b.
859859
*/
@@ -873,7 +873,7 @@ ATTR_CONST static inline struct mat3f multiply_mat3f(const struct mat3f a, const
873873

874874
/**
875875
* @brief Returns a matrix that is the result of element-wise addition of a and b.
876-
*
876+
*
877877
* @param a The lhs input matrix.
878878
* @param b The rhs input matrix.
879879
* @return struct mat3f The result of a + b. (element-wise)
@@ -888,7 +888,7 @@ ATTR_CONST static inline struct mat3f add_mat3f(const struct mat3f a, const stru
888888

889889
/**
890890
* @brief Returns the transponated of a.
891-
*
891+
*
892892
* @param a The input matrix.
893893
* @return struct mat3f a transponated.
894894
*/
@@ -902,7 +902,7 @@ ATTR_CONST static inline struct mat3f transponate_mat3f(const struct mat3f a) {
902902

903903
ATTR_CONST static inline struct vec2f transform_point(const struct mat3f transform, const struct vec2f point) {
904904
return VEC2F(
905-
transform.scaleX*point.x + transform.skewX*point.y + transform.transX,
905+
transform.scaleX*point.x + transform.skewX*point.y + transform.transX,
906906
transform.skewY*point.x + transform.scaleY*point.y + transform.transY
907907
);
908908
}

include/compositor.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ struct compositor {
3434
/**
3535
* @brief Contains a struct for each existing platform view, containing the view id
3636
* and platform view callbacks.
37-
*
37+
*
3838
* @see compositor_set_view_callbacks compositor_remove_view_callbacks
3939
*/
4040
struct concurrent_pointer_set cbs;
4141

4242
/**
4343
* @brief Whether the compositor should invoke @ref rendertarget_gbm_new the next time
4444
* flutter creates a backing store. Otherwise @ref rendertarget_nogbm_new is invoked.
45-
*
45+
*
4646
* It's only possible to have at most one GBM-Surface backed backing store (== @ref rendertarget_gbm). So the first
4747
* time @ref on_create_backing_store is invoked, a GBM-Surface backed backing store is returned and after that,
4848
* only backing stores with @ref rendertarget_nogbm.
@@ -61,7 +61,7 @@ struct compositor {
6161
/**
6262
* @brief A cache of rendertargets that are not currently in use for
6363
* any flutter layers and can be reused.
64-
*
64+
*
6565
* Make sure to destroy all stale rendertargets before presentation so all the DRM planes
6666
* that are reserved by any stale rendertargets get freed.
6767
*/
@@ -77,10 +77,10 @@ struct compositor {
7777

7878
/**
7979
* If true, @ref on_present_layers will commit blockingly.
80-
*
80+
*
8181
* It will also schedule a simulated page flip event on the main thread
8282
* afterwards so the frame queue works.
83-
*
83+
*
8484
* If false, @ref on_present_layers will commit nonblocking using page flip events,
8585
* like usual.
8686
*/
@@ -160,4 +160,4 @@ int compositor_initialize(
160160
);
161161

162162

163-
#endif
163+
#endif

include/compositor_ng.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ struct compositor;
2424
struct drm_connector_config {
2525
uint32_t connector_type;
2626
uint32_t connector_type_id;
27-
27+
2828
bool disable, primary;
29-
29+
3030
bool has_mode_size;
3131
int mode_width, mode_height;
32-
32+
3333
bool has_mode_refreshrate;
3434
int mode_refreshrate_n, mode_refreshrate_d;
3535

@@ -45,7 +45,7 @@ struct drm_device_config {
4545
const char *path;
4646

4747
size_t n_connector_configs;
48-
struct drm_connector_config *connector_configs;
48+
struct drm_connector_config *connector_configs;
4949
};
5050

5151
struct fbdev_device_config {
@@ -78,7 +78,7 @@ struct clip_rect {
7878
bool is_aa;
7979

8080
struct aa_rect aa_rect;
81-
81+
8282
bool is_rounded;
8383
struct vec2f upper_left_corner_radius;
8484
struct vec2f upper_right_corner_radius;
@@ -91,7 +91,7 @@ struct fl_layer_props {
9191
* @brief True if the presentation quadrangle (the quadrangle on the target window into which the
9292
* layer should be rendered) is an axis-aligned rectangle. For example, allows us to use a plain
9393
* hardware overlay layer for this layer.
94-
*
94+
*
9595
* This should always be true for backing stores, but might be false for platform views.
9696
*/
9797
bool is_aa_rect;
@@ -100,7 +100,7 @@ struct fl_layer_props {
100100
* @brief The coords of the axis aligned rectangle if @ref is_aa_rect is true.
101101
*/
102102
struct aa_rect aa_rect;
103-
103+
104104
/**
105105
* @brief The quadrangle on the target window into which the layer should be rendered.
106106
*/
@@ -115,7 +115,7 @@ struct fl_layer_props {
115115
* @brief Rotation of the buffer in degrees clockwise, normalized to a range 0 - 360.
116116
*/
117117
double rotation;
118-
118+
119119
/**
120120
* @brief The number of clip rectangles in the @ref clip_rects array.
121121
*/

include/cursor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ struct cursor_icon {
1313
extern const struct cursor_icon cursors[5];
1414
extern int n_cursors;
1515

16-
#endif
16+
#endif

include/egl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static inline bool check_egl_extension(const char *client_ext_string, const char
3636
return true;
3737
}
3838
}
39-
39+
4040
if (display_ext_string != NULL) {
4141
const char *result = strstr(display_ext_string, extension);
4242
if (result != NULL && (result[len] == ' ' || result[len] == '\0')) {

include/flutter-pi.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
#include <stdint.h>
1111
#include <stdlib.h>
1212
#include <string.h>
13-
#include <ctype.h>
14-
#include <stdio.h>
13+
#include <ctype.h>
14+
#include <stdio.h>
1515
#include <glob.h>
1616

1717
#include <xf86drm.h>
@@ -51,7 +51,7 @@ enum device_orientation {
5151
(o) == kLandscapeLeft ? 90 : \
5252
(o) == kPortraitDown ? 180 : \
5353
(o) == kLandscapeRight ? 270 : 0)
54-
54+
5555
#define ANGLE_BETWEEN_ORIENTATIONS(o_start, o_end) \
5656
(ANGLE_FROM_ORIENTATION(o_end) \
5757
- ANGLE_FROM_ORIENTATION(o_start) \
@@ -191,4 +191,4 @@ void flutterpi_trace_event_begin(struct flutterpi *flutterpi, const char *name);
191191

192192
void flutterpi_trace_event_end(struct flutterpi *flutterpi, const char *name);
193193

194-
#endif
194+
#endif

0 commit comments

Comments
 (0)