diff options
author | Thomas Haller <thaller@redhat.com> | 2021-11-09 13:28:54 +0100 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2021-11-29 09:31:09 +0000 |
commit | 615221a99cdd5059b2632cba923bc04c92165dbc (patch) | |
tree | 90f156904bc164fc413832be2246503999634681 /src/libnm-udev-aux | |
parent | e44cdc79812d82dcf24e915f440497bc503bffe4 (diff) | |
download | NetworkManager-615221a99cdd5059b2632cba923bc04c92165dbc.tar.gz |
format: reformat source tree with clang-format 13.0
We use clang-format for automatic formatting of our source files.
Since clang-format is actively maintained software, the actual
formatting depends on the used version of clang-format. That is
unfortunate and painful, but really unavoidable unless clang-format
would be strictly bug-compatible.
So the version that we must use is from the current Fedora release, which
is also tested by our gitlab-ci. Previously, we were using Fedora 34 with
clang-tools-extra-12.0.1-1.fc34.x86_64.
As Fedora 35 comes along, we need to update our formatting as Fedora 35
comes with version "13.0.0~rc1-1.fc35".
An alternative would be to freeze on version 12, but that has different
problems (like, it's cumbersome to rebuild clang 12 on Fedora 35 and it
would be cumbersome for our developers which are on Fedora 35 to use a
clang that they cannot easily install).
The (differently painful) solution is to reformat from time to time, as we
switch to a new Fedora (and thus clang) version.
Usually we would expect that such a reformatting brings minor changes.
But this time, the changes are huge. That is mentioned in the release
notes [1] as
Makes PointerAligment: Right working with AlignConsecutiveDeclarations. (Fixes https://llvm.org/PR27353)
[1] https://releases.llvm.org/13.0.0/tools/clang/docs/ReleaseNotes.html#clang-format
Diffstat (limited to 'src/libnm-udev-aux')
-rw-r--r-- | src/libnm-udev-aux/nm-udev-utils.c | 24 | ||||
-rw-r--r-- | src/libnm-udev-aux/nm-udev-utils.h | 4 |
2 files changed, 14 insertions, 14 deletions
diff --git a/src/libnm-udev-aux/nm-udev-utils.c b/src/libnm-udev-aux/nm-udev-utils.c index ef1cf26b2d..744d03ce9e 100644 --- a/src/libnm-udev-aux/nm-udev-utils.c +++ b/src/libnm-udev-aux/nm-udev-utils.c @@ -10,9 +10,9 @@ #include <libudev.h> struct _NMPUdevClient { - char ** subsystems; - GSource * watch_source; - struct udev * udev; + char **subsystems; + GSource *watch_source; + struct udev *udev; struct udev_monitor *monitor; NMUdevClientEvent event_handler; gpointer event_user_data; @@ -36,8 +36,8 @@ const char * nm_udev_utils_property_decode(const char *uproperty, char **to_free) { const char *p; - char * unescaped = NULL; - char * n = NULL; + char *unescaped = NULL; + char *n = NULL; if (!uproperty) { *to_free = NULL; @@ -87,10 +87,10 @@ nm_udev_utils_property_decode_cp(const char *uproperty) /*****************************************************************************/ static void -_subsystem_split(const char * subsystem_full, +_subsystem_split(const char *subsystem_full, const char **out_subsystem, const char **out_devtype, - char ** to_free) + char **to_free) { char *tmp, *s; @@ -124,8 +124,8 @@ nm_udev_utils_enumerate(struct udev *uclient, const char *const *subsystems) if (subsystems) { for (n = 0; subsystems[n]; n++) { - const char * subsystem; - const char * devtype; + const char *subsystem; + const char *devtype; gs_free char *to_free = NULL; _subsystem_split(subsystems[n], &subsystem, &devtype, &to_free); @@ -161,7 +161,7 @@ nm_udev_client_enumerate_new(NMUdevClient *self) static gboolean monitor_event(int fd, GIOCondition condition, gpointer user_data) { - NMUdevClient * self = user_data; + NMUdevClient *self = user_data; struct udev_device *udevice; if (!self->monitor) @@ -217,8 +217,8 @@ nm_udev_client_new(const char *const *subsystems, /* install subsystem filters to only wake up for certain events */ for (n = 0; self->subsystems[n]; n++) { gs_free char *to_free = NULL; - const char * subsystem; - const char * devtype; + const char *subsystem; + const char *devtype; _subsystem_split(self->subsystems[n], &subsystem, &devtype, &to_free); udev_monitor_filter_add_match_subsystem_devtype(self->monitor, subsystem, devtype); diff --git a/src/libnm-udev-aux/nm-udev-utils.h b/src/libnm-udev-aux/nm-udev-utils.h index 191f9a89a4..1c04fc58d4 100644 --- a/src/libnm-udev-aux/nm-udev-utils.h +++ b/src/libnm-udev-aux/nm-udev-utils.h @@ -12,11 +12,11 @@ struct udev_enumerate; gboolean nm_udev_utils_property_as_boolean(const char *uproperty); const char *nm_udev_utils_property_decode(const char *uproperty, char **to_free); -char * nm_udev_utils_property_decode_cp(const char *uproperty); +char *nm_udev_utils_property_decode_cp(const char *uproperty); typedef struct _NMPUdevClient NMUdevClient; -typedef void (*NMUdevClientEvent)(NMUdevClient * udev_client, +typedef void (*NMUdevClientEvent)(NMUdevClient *udev_client, struct udev_device *udevice, gpointer event_user_data); |