diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index f38ba4de98..81e2f610a0 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -7,3 +7,4 @@ 740b092fda3d5f45102422f22884c88ea6c42858 d8a4b3bec28c48b3b9f2ed7d499922376a2e05c3 3fb8c0f614ab0cb3da649e6ca275abfa7ffc9a34 +c275d24637ce5c35c312fbff76b9adac4cbb099f diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8a637ad626..0a221f129e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,7 +13,7 @@ ######################################## -.templates_sha: &template_sha ffe4d1b10aab7534489f0c4bbc4c5899df17d3f2 # see https://docs.gitlab.com/ee/ci/yaml/#includefile +.templates_sha: &template_sha fb33e1b244ec2a0b8edf8ee5590a96369c3b4666 # see https://docs.gitlab.com/ee/ci/yaml/#includefile @@ -56,11 +56,11 @@ variables: # # This is done by running `ci-fairy generate-template` and possibly bumping # ".default_tag". - ALPINE_TAG: 'tag-372c77b49d01' - CENTOS_TAG: 'tag-ab77da6a62d5' - DEBIAN_TAG: 'tag-e7368fd611d6' - FEDORA_TAG: 'tag-ab77da6a62d5' - UBUNTU_TAG: 'tag-e7368fd611d6' + ALPINE_TAG: 'tag-8399f83819ed' + CENTOS_TAG: 'tag-a5e8e3d94c70' + DEBIAN_TAG: 'tag-f97319c5ab59' + FEDORA_TAG: 'tag-a5e8e3d94c70' + UBUNTU_TAG: 'tag-f97319c5ab59' ALPINE_EXEC: 'bash .gitlab-ci/alpine-install.sh' CENTOS_EXEC: 'bash .gitlab-ci/fedora-install.sh' @@ -96,7 +96,17 @@ variables: # Build a container for each distribution + version. The ci-templates # will re-use the containers if the tag doesn't change. -tier1:fedora:37@prep: +tier1:fedora:38@prep: + extends: + - .fdo.container-build@fedora + stage: prep + variables: + GIT_STRATEGY: none + FDO_DISTRIBUTION_VERSION: '38' + FDO_DISTRIBUTION_TAG: $FEDORA_TAG + FDO_DISTRIBUTION_EXEC: $FEDORA_EXEC + +tier2:fedora:37@prep: extends: - .fdo.container-build@fedora stage: prep @@ -105,25 +115,15 @@ tier1:fedora:37@prep: FDO_DISTRIBUTION_VERSION: '37' FDO_DISTRIBUTION_TAG: $FEDORA_TAG FDO_DISTRIBUTION_EXEC: $FEDORA_EXEC - -tier2:fedora:36@prep: - extends: - - .fdo.container-build@fedora - stage: prep - variables: - GIT_STRATEGY: none - FDO_DISTRIBUTION_VERSION: '36' - FDO_DISTRIBUTION_TAG: $FEDORA_TAG - FDO_DISTRIBUTION_EXEC: $FEDORA_EXEC when: manual -tier2:fedora:38@prep: +tier2:fedora:39@prep: extends: - .fdo.container-build@fedora stage: prep variables: GIT_STRATEGY: none - FDO_DISTRIBUTION_VERSION: '38' + FDO_DISTRIBUTION_VERSION: '39' FDO_DISTRIBUTION_TAG: $FEDORA_TAG FDO_DISTRIBUTION_EXEC: $FEDORA_EXEC when: manual @@ -194,6 +194,17 @@ tier3:fedora:35@prep: FDO_DISTRIBUTION_EXEC: $FEDORA_EXEC when: manual +tier3:fedora:36@prep: + extends: + - .fdo.container-build@fedora + stage: prep + variables: + GIT_STRATEGY: none + FDO_DISTRIBUTION_VERSION: '36' + FDO_DISTRIBUTION_TAG: $FEDORA_TAG + FDO_DISTRIBUTION_EXEC: $FEDORA_EXEC + when: manual + tier2:ubuntu:18.04@prep: extends: - .fdo.container-build@ubuntu @@ -419,7 +430,7 @@ tier2:alpine:latest@prep: dependencies: [] -t_fedora:37: +t_fedora:38: extends: - .build@template - .fdo.distribution-image@fedora @@ -436,35 +447,35 @@ t_fedora:37: - rpm+meson - tarball - subtree - variables: - FDO_DISTRIBUTION_VERSION: '37' - FDO_DISTRIBUTION_TAG: $FEDORA_TAG - needs: - - "tier1:fedora:37@prep" - -t_fedora:36: - extends: - - .build@template - - .fdo.distribution-image@fedora - - .nm_artifacts_debug - stage: tier2 - variables: - FDO_DISTRIBUTION_VERSION: '36' - FDO_DISTRIBUTION_TAG: $FEDORA_TAG - needs: - - "tier2:fedora:36@prep" - -t_fedora:38: - extends: - - .build@template - - .fdo.distribution-image@fedora - - .nm_artifacts_debug - stage: tier2 variables: FDO_DISTRIBUTION_VERSION: '38' FDO_DISTRIBUTION_TAG: $FEDORA_TAG needs: - - "tier2:fedora:38@prep" + - "tier1:fedora:38@prep" + +t_fedora:37: + extends: + - .build@template + - .fdo.distribution-image@fedora + - .nm_artifacts_debug + stage: tier2 + variables: + FDO_DISTRIBUTION_VERSION: '37' + FDO_DISTRIBUTION_TAG: $FEDORA_TAG + needs: + - "tier2:fedora:37@prep" + +t_fedora:39: + extends: + - .build@template + - .fdo.distribution-image@fedora + - .nm_artifacts_debug + stage: tier2 + variables: + FDO_DISTRIBUTION_VERSION: '39' + FDO_DISTRIBUTION_TAG: $FEDORA_TAG + needs: + - "tier2:fedora:39@prep" t_fedora:30: extends: @@ -538,6 +549,18 @@ t_fedora:35: needs: - "tier3:fedora:35@prep" +t_fedora:36: + extends: + - .build@template + - .fdo.distribution-image@fedora + - .nm_artifacts_debug + stage: tier3 + variables: + FDO_DISTRIBUTION_VERSION: '36' + FDO_DISTRIBUTION_TAG: $FEDORA_TAG + needs: + - "tier3:fedora:36@prep" + t_ubuntu:18.04: extends: - .build@template @@ -776,10 +799,10 @@ check-patch: extends: - .fdo.distribution-image@fedora variables: - FDO_DISTRIBUTION_VERSION: '37' + FDO_DISTRIBUTION_VERSION: '38' FDO_DISTRIBUTION_TAG: $FEDORA_TAG needs: - - "tier1:fedora:37@prep" + - "tier1:fedora:38@prep" stage: tier1 script: - date '+%Y%m%d-%H%M%S'; NM_CHECKPATCH_FETCH_UPSTREAM=1 contrib/scripts/checkpatch-feature-branch.sh @@ -789,10 +812,10 @@ check-tree: extends: - .fdo.distribution-image@fedora variables: - FDO_DISTRIBUTION_VERSION: '37' + FDO_DISTRIBUTION_VERSION: '38' FDO_DISTRIBUTION_TAG: $FEDORA_TAG needs: - - "tier1:fedora:37@prep" + - "tier1:fedora:38@prep" stage: tier1 script: - date '+%Y%m%d-%H%M%S'; contrib/scripts/nm-python-black-format.sh --check @@ -811,9 +834,9 @@ pages: only: - main dependencies: - - "t_fedora:37: [autotools+gcc+docs+valgrind]" + - "t_fedora:38: [autotools+gcc+docs+valgrind]" needs: - - "t_fedora:37: [autotools+gcc+docs+valgrind]" + - "t_fedora:38: [autotools+gcc+docs+valgrind]" triage:issues: stage: triage @@ -829,4 +852,4 @@ triage:issues: workflow: rules: - if: $CI_PIPELINE_SOURCE == 'merge_request_event' - - if: $CI_PIPELINE_SOURCE == 'push' \ No newline at end of file + - if: $CI_PIPELINE_SOURCE == 'push' diff --git a/.gitlab-ci/ci.template b/.gitlab-ci/ci.template index 62d88df84c..b60f21ecdb 100644 --- a/.gitlab-ci/ci.template +++ b/.gitlab-ci/ci.template @@ -15,7 +15,7 @@ ######################################## -.templates_sha: &template_sha ffe4d1b10aab7534489f0c4bbc4c5899df17d3f2 # see https://docs.gitlab.com/ee/ci/yaml/#includefile +.templates_sha: &template_sha fb33e1b244ec2a0b8edf8ee5590a96369c3b4666 # see https://docs.gitlab.com/ee/ci/yaml/#includefile {# Group distros by their common (name,) tuples.#} {% set distro_groups = [] %} diff --git a/.gitlab-ci/config.yml b/.gitlab-ci/config.yml index 8aafe0c48b..abffac8308 100644 --- a/.gitlab-ci/config.yml +++ b/.gitlab-ci/config.yml @@ -22,12 +22,12 @@ distributions: # The first tier:1 in the list is used to build the pages and check-{tree,patch} tier: 1 versions: - - '37' + - '38' - name: fedora tier: 2 versions: - - '36' - - '38' + - '37' + - '39' - name: fedora tier: 3 versions: @@ -37,6 +37,7 @@ distributions: - '33' - '34' - '35' + - '36' - name: ubuntu tier: 2 versions: diff --git a/contrib/fedora/REQUIRED_PACKAGES b/contrib/fedora/REQUIRED_PACKAGES index 644e518b1b..7084f780b8 100755 --- a/contrib/fedora/REQUIRED_PACKAGES +++ b/contrib/fedora/REQUIRED_PACKAGES @@ -85,7 +85,6 @@ install \ teamd-devel \ util-linux \ vala \ - vala-devel \ valgrind \ which \ "${EXTRA_PACKAGES[@]}" @@ -98,9 +97,11 @@ install_ignore_missing \ libasan \ libpsl-devel \ libubsan \ + libvala-devel \ pexpect \ pygobject3-base \ python-gobject-base \ python36-pexpect \ qt-devel \ + vala-devel \ #end diff --git a/contrib/scripts/nm-code-format-container.sh b/contrib/scripts/nm-code-format-container.sh index 9d9643832f..d447e203b0 100755 --- a/contrib/scripts/nm-code-format-container.sh +++ b/contrib/scripts/nm-code-format-container.sh @@ -10,7 +10,7 @@ die() { DIR="$(realpath "$(dirname "$0")/../../")" cd "$DIR" -FEDORA_VERSION=37 +FEDORA_VERSION=38 PODNAME="nm-code-format-f$FEDORA_VERSION" diff --git a/src/core/devices/nm-device-factory.h b/src/core/devices/nm-device-factory.h index ac5ae05f5a..fc3d9dd43a 100644 --- a/src/core/devices/nm-device-factory.h +++ b/src/core/devices/nm-device-factory.h @@ -208,8 +208,7 @@ NMDevice *nm_device_factory_create_device(NMDeviceFactory *factory, \ NM_DEVICE_FACTORY_DECLARE_TYPES(st_code) \ \ - static void nm_##lower##_device_factory_init(NM##mixed##DeviceFactory *self) \ - {} \ + static void nm_##lower##_device_factory_init(NM##mixed##DeviceFactory *self) {} \ \ static void nm_##lower##_device_factory_class_init(NM##mixed##DeviceFactoryClass *klass) \ { \ diff --git a/src/core/devices/nm-device-logging.h b/src/core/devices/nm-device-logging.h index ffc90c2d76..0ea332d8f4 100644 --- a/src/core/devices/nm-device-logging.h +++ b/src/core/devices/nm-device-logging.h @@ -11,12 +11,10 @@ #if !_NM_CC_SUPPORT_GENERIC #define _NM_DEVICE_CAST(self) ((NMDevice *) (self)) #elif !defined(_NMLOG_DEVICE_TYPE) -#define _NM_DEVICE_CAST(self) _Generic((self), NMDevice * : ((NMDevice *) (self))) +#define _NM_DEVICE_CAST(self) _Generic((self), NMDevice *: ((NMDevice *) (self))) #else -#define _NM_DEVICE_CAST(self) \ - _Generic((self), _NMLOG_DEVICE_TYPE * \ - : ((NMDevice *) (self)), NMDevice * \ - : ((NMDevice *) (self))) +#define _NM_DEVICE_CAST(self) \ + _Generic((self), _NMLOG_DEVICE_TYPE *: ((NMDevice *) (self)), NMDevice *: ((NMDevice *) (self))) #endif #undef _NMLOG_ENABLED diff --git a/src/core/nm-core-utils.h b/src/core/nm-core-utils.h index bc93649630..87d3559e19 100644 --- a/src/core/nm-core-utils.h +++ b/src/core/nm-core-utils.h @@ -262,18 +262,17 @@ _nmtst_auto_utils_host_id_context_pop(const char *const *unused) nmtst_utils_host_id_pop(); } -#define _NMTST_UTILS_HOST_ID_CONTEXT(uniq, host_id) \ - _nm_unused nm_auto(_nmtst_auto_utils_host_id_context_pop) const char *const NM_UNIQ_T( \ - _host_id_context_, \ - uniq) = ({ \ - const gint64 _timestamp_ns = 1631000672; \ - \ - nmtst_utils_host_id_push((const guint8 *) "" host_id "", \ - NM_STRLEN(host_id), \ - TRUE, \ - &_timestamp_ns); \ - "" host_id ""; \ - }) +#define _NMTST_UTILS_HOST_ID_CONTEXT(uniq, host_id) \ + _nm_unused nm_auto(_nmtst_auto_utils_host_id_context_pop) \ + const char *const NM_UNIQ_T(_host_id_context_, uniq) = ({ \ + const gint64 _timestamp_ns = 1631000672; \ + \ + nmtst_utils_host_id_push((const guint8 *) "" host_id "", \ + NM_STRLEN(host_id), \ + TRUE, \ + &_timestamp_ns); \ + "" host_id ""; \ + }) #define NMTST_UTILS_HOST_ID_CONTEXT(host_id) _NMTST_UTILS_HOST_ID_CONTEXT(NM_UNIQ, host_id) diff --git a/src/libnm-glib-aux/nm-glib.h b/src/libnm-glib-aux/nm-glib.h index 0436d13554..9c90d4299d 100644 --- a/src/libnm-glib-aux/nm-glib.h +++ b/src/libnm-glib-aux/nm-glib.h @@ -500,7 +500,7 @@ _nm_g_variant_new_take_string(char *string) return value; #elif !GLIB_CHECK_VERSION(2, 38, 0) GVariant *value; - GBytes *bytes; + GBytes *bytes; g_return_val_if_fail(string != NULL, NULL); g_return_val_if_fail(g_utf8_validate(string, -1, NULL), NULL); diff --git a/src/libnm-glib-aux/nm-hash-utils.h b/src/libnm-glib-aux/nm-hash-utils.h index e2707fc217..c1306200b4 100644 --- a/src/libnm-glib-aux/nm-hash-utils.h +++ b/src/libnm-glib-aux/nm-hash-utils.h @@ -185,10 +185,10 @@ nm_hash_update_str(NMHashState *state, const char *str) /* Like nm_hash_update_str(), but restricted to arrays only. nm_hash_update_str() only works * with a @str argument that cannot be NULL. If you have a string pointer, that is never NULL, use * nm_hash_update() instead. */ -#define nm_hash_update_strarr(state, str) \ - (_Generic(&(str), const char(*)[sizeof(str)] \ - : nm_hash_update_str((state), (str)), char(*)[sizeof(str)] \ - : nm_hash_update_str((state), (str)))) +#define nm_hash_update_strarr(state, str) \ + (_Generic(&(str), \ + const char(*)[sizeof(str)]: nm_hash_update_str((state), (str)), \ + char(*)[sizeof(str)]: nm_hash_update_str((state), (str)))) #else #define nm_hash_update_strarr(state, str) nm_hash_update_str((state), (str)) #endif diff --git a/src/libnm-glib-aux/nm-macros-internal.h b/src/libnm-glib-aux/nm-macros-internal.h index 03eff1cbf6..b74d732407 100644 --- a/src/libnm-glib-aux/nm-macros-internal.h +++ b/src/libnm-glib-aux/nm-macros-internal.h @@ -259,41 +259,41 @@ NM_G_ERROR_MSG(GError *error) #if _NM_CC_SUPPORT_GENERIC #define _NM_CONSTCAST_FULL_1(type, obj_expr, obj) \ - (_Generic ((obj_expr), \ - const void *: ((const type *) (obj)), \ - void *: (( type *) (obj)), \ - const type *: ((const type *) (obj)), \ - type *: (( type *) (obj)))) + (_Generic((obj_expr), \ + const void *: ((const type *) (obj)), \ + void *: ((type *) (obj)), \ + const type *: ((const type *) (obj)), \ + type *: ((type *) (obj)))) #define _NM_CONSTCAST_FULL_2(type, obj_expr, obj, alias_type2) \ - (_Generic ((obj_expr), \ - const void *: ((const type *) (obj)), \ - void *: (( type *) (obj)), \ - const alias_type2 *: ((const type *) (obj)), \ - alias_type2 *: (( type *) (obj)), \ - const type *: ((const type *) (obj)), \ - type *: (( type *) (obj)))) + (_Generic((obj_expr), \ + const void *: ((const type *) (obj)), \ + void *: ((type *) (obj)), \ + const alias_type2 *: ((const type *) (obj)), \ + alias_type2 *: ((type *) (obj)), \ + const type *: ((const type *) (obj)), \ + type *: ((type *) (obj)))) #define _NM_CONSTCAST_FULL_3(type, obj_expr, obj, alias_type2, alias_type3) \ - (_Generic ((obj_expr), \ - const void *: ((const type *) (obj)), \ - void *: (( type *) (obj)), \ - const alias_type2 *: ((const type *) (obj)), \ - alias_type2 *: (( type *) (obj)), \ - const alias_type3 *: ((const type *) (obj)), \ - alias_type3 *: (( type *) (obj)), \ - const type *: ((const type *) (obj)), \ - type *: (( type *) (obj)))) + (_Generic((obj_expr), \ + const void *: ((const type *) (obj)), \ + void *: ((type *) (obj)), \ + const alias_type2 *: ((const type *) (obj)), \ + alias_type2 *: ((type *) (obj)), \ + const alias_type3 *: ((const type *) (obj)), \ + alias_type3 *: ((type *) (obj)), \ + const type *: ((const type *) (obj)), \ + type *: ((type *) (obj)))) #define _NM_CONSTCAST_FULL_4(type, obj_expr, obj, alias_type2, alias_type3, alias_type4) \ - (_Generic ((obj_expr), \ - const void *: ((const type *) (obj)), \ - void *: (( type *) (obj)), \ - const alias_type2 *: ((const type *) (obj)), \ - alias_type2 *: (( type *) (obj)), \ - const alias_type3 *: ((const type *) (obj)), \ - alias_type3 *: (( type *) (obj)), \ - const alias_type4 *: ((const type *) (obj)), \ - alias_type4 *: (( type *) (obj)), \ - const type *: ((const type *) (obj)), \ - type *: (( type *) (obj)))) + (_Generic((obj_expr), \ + const void *: ((const type *) (obj)), \ + void *: ((type *) (obj)), \ + const alias_type2 *: ((const type *) (obj)), \ + alias_type2 *: ((type *) (obj)), \ + const alias_type3 *: ((const type *) (obj)), \ + alias_type3 *: ((type *) (obj)), \ + const alias_type4 *: ((const type *) (obj)), \ + alias_type4 *: ((type *) (obj)), \ + const type *: ((const type *) (obj)), \ + type *: ((type *) (obj)))) #define _NM_CONSTCAST_FULL_x(type, obj_expr, obj, n, ...) \ (_NM_CONSTCAST_FULL_##n(type, obj_expr, obj, ##__VA_ARGS__)) #define _NM_CONSTCAST_FULL_y(type, obj_expr, obj, n, ...) \ @@ -308,18 +308,18 @@ NM_G_ERROR_MSG(GError *error) #if _NM_CC_SUPPORT_GENERIC #define NM_UNCONST_PTR(type, arg) \ - _Generic((arg), const type * : ((type *) (arg)), type * : ((type *) (arg))) + _Generic((arg), const type *: ((type *) (arg)), type *: ((type *) (arg))) #else #define NM_UNCONST_PTR(type, arg) ((type *) (arg)) #endif #if _NM_CC_SUPPORT_GENERIC -#define NM_UNCONST_PPTR(type, arg) \ - _Generic ((arg), \ - const type * *: ((type **) (arg)), \ - type * *: ((type **) (arg)), \ - const type *const*: ((type **) (arg)), \ - type *const*: ((type **) (arg))) +#define NM_UNCONST_PPTR(type, arg) \ + _Generic((arg), \ + const type **: ((type **) (arg)), \ + type **: ((type **) (arg)), \ + const type *const *: ((type **) (arg)), \ + type *const *: ((type **) (arg))) #else #define NM_UNCONST_PPTR(type, arg) ((type **) (arg)) #endif @@ -377,30 +377,29 @@ NM_G_ERROR_MSG(GError *error) * These macros do the cast, but they only accept a compatible input * type, otherwise they will fail compilation. */ -#define NM_CAST_STRV_MC(value) \ - (_Generic ((value), \ - const char * *: (const char * *) (value), \ - char * *: (const char * *) (value), \ - void *: (const char * *) (value))) -#define NM_CAST_STRV_CC(value) \ - (_Generic ((value), \ - const char *const*: (const char *const*) (value), \ - const char * *: (const char *const*) (value), \ - char *const*: (const char *const*) (value), \ - char * *: (const char *const*) (value), \ - const void *: (const char *const*) (value), \ - void *: (const char *const*) (value))) +#define NM_CAST_STRV_MC(value) \ + (_Generic((value), \ + const char **: (const char **) (value), \ + char **: (const char **) (value), \ + void *: (const char **) (value))) +#define NM_CAST_STRV_CC(value) \ + (_Generic((value), \ + const char *const *: (const char *const *) (value), \ + const char **: (const char *const *) (value), \ + char *const *: (const char *const *) (value), \ + char **: (const char *const *) (value), \ + const void *: (const char *const *) (value), \ + void *: (const char *const *) (value))) #else #define NM_CAST_STRV_MC(value) ((const char **) (value)) #define NM_CAST_STRV_CC(value) ((const char *const *) (value)) #endif #if _NM_CC_SUPPORT_GENERIC -#define NM_PROPAGATE_CONST(test_expr, ptr) \ - (_Generic ((test_expr), \ - const typeof (*(test_expr)) *: ((const typeof (*(ptr)) *) (ptr)), \ - default: (_Generic ((test_expr), \ - typeof (*(test_expr)) *: (ptr))))) +#define NM_PROPAGATE_CONST(test_expr, ptr) \ + (_Generic((test_expr), \ + const typeof(*(test_expr)) *: ((const typeof(*(ptr)) *) (ptr)), \ + default: (_Generic((test_expr), typeof(*(test_expr)) *: (ptr))))) #else #define NM_PROPAGATE_CONST(test_expr, ptr) (ptr) #endif @@ -1499,23 +1498,21 @@ _nm_strndup_a_step(char *s, const char *str, gsize len) * * Instead, this generic macro is supposed to handle all integers correctly. */ #if _NM_CC_SUPPORT_GENERIC -#define nm_strdup_int(val) \ - _Generic((val), char \ - : g_strdup_printf("%d", (int) (val)), \ - \ - signed char \ - : g_strdup_printf("%d", (signed) (val)), signed short \ - : g_strdup_printf("%d", (signed) (val)), signed \ - : g_strdup_printf("%d", (signed) (val)), signed long \ - : g_strdup_printf("%ld", (signed long) (val)), signed long long \ - : g_strdup_printf("%lld", (signed long long) (val)), \ - \ - unsigned char \ - : g_strdup_printf("%u", (unsigned) (val)), unsigned short \ - : g_strdup_printf("%u", (unsigned) (val)), unsigned \ - : g_strdup_printf("%u", (unsigned) (val)), unsigned long \ - : g_strdup_printf("%lu", (unsigned long) (val)), unsigned long long \ - : g_strdup_printf("%llu", (unsigned long long) (val))) +#define nm_strdup_int(val) \ + _Generic((val), \ + char: g_strdup_printf("%d", (int) (val)), \ + \ + signed char: g_strdup_printf("%d", (signed) (val)), \ + signed short: g_strdup_printf("%d", (signed) (val)), \ + signed: g_strdup_printf("%d", (signed) (val)), \ + signed long: g_strdup_printf("%ld", (signed long) (val)), \ + signed long long: g_strdup_printf("%lld", (signed long long) (val)), \ + \ + unsigned char: g_strdup_printf("%u", (unsigned) (val)), \ + unsigned short: g_strdup_printf("%u", (unsigned) (val)), \ + unsigned: g_strdup_printf("%u", (unsigned) (val)), \ + unsigned long: g_strdup_printf("%lu", (unsigned long) (val)), \ + unsigned long long: g_strdup_printf("%llu", (unsigned long long) (val))) #else #define nm_strdup_int(val) \ ((sizeof(val) == sizeof(guint64) && ((typeof(val)) -1) > 0) \ diff --git a/src/libnm-glib-aux/nm-shared-utils.h b/src/libnm-glib-aux/nm-shared-utils.h index 60735d3c8d..e37cf5e654 100644 --- a/src/libnm-glib-aux/nm-shared-utils.h +++ b/src/libnm-glib-aux/nm-shared-utils.h @@ -79,7 +79,7 @@ G_STATIC_ASSERT(sizeof(int) == sizeof(gint32)); ({ \ _nm_unused typeof(value) _value = (value); \ \ - _Generic((value), int : TRUE); \ + _Generic((value), int: TRUE); \ }) #else #define _NM_INT_LE_MAXINT32(value) \ diff --git a/src/libnm-glib-aux/nm-test-utils.h b/src/libnm-glib-aux/nm-test-utils.h index d4e1e4b1f4..de6fd0f1b0 100644 --- a/src/libnm-glib-aux/nm-test-utils.h +++ b/src/libnm-glib-aux/nm-test-utils.h @@ -2887,8 +2887,7 @@ _nmtst_variant_new_vardict(int dummy, ...) G_STMT_END #else #define _nmtst_assert_variant_bytestring_cmp_str(_ptr, _ptr2, _len) \ - G_STMT_START \ - {} \ + G_STMT_START {} \ G_STMT_END #endif diff --git a/src/libnm-platform/nm-netlink.h b/src/libnm-platform/nm-netlink.h index 35e2962984..efd482adfb 100644 --- a/src/libnm-platform/nm-netlink.h +++ b/src/libnm-platform/nm-netlink.h @@ -93,19 +93,19 @@ struct nla_policy { /* static asserts that @tb and @policy are suitable arguments to nla_parse(). */ #if _NM_CC_SUPPORT_GENERIC -#define _nl_static_assert_tb(tb, policy) \ - G_STMT_START \ - { \ - G_STATIC_ASSERT_EXPR(G_N_ELEMENTS(tb) > 0); \ - \ +#define _nl_static_assert_tb(tb, policy) \ + G_STMT_START \ + { \ + G_STATIC_ASSERT_EXPR(G_N_ELEMENTS(tb) > 0); \ + \ /* We allow @policy to be either a C array or NULL. The sizeof() * must either match the expected array size or we check that * "policy" has typeof(NULL). This isn't a perfect compile time check, - * but good enough. */ \ - G_STATIC_ASSERT_EXPR( \ - _Generic((policy), typeof(NULL) : 1, default \ - : (sizeof(policy) == G_N_ELEMENTS(tb) * sizeof(struct nla_policy)))); \ - } \ + * but good enough. */ \ + G_STATIC_ASSERT_EXPR(_Generic((policy), \ + typeof(NULL): 1, \ + default: (sizeof(policy) == G_N_ELEMENTS(tb) * sizeof(struct nla_policy)))); \ + } \ G_STMT_END #else #define _nl_static_assert_tb(tb, policy) G_STATIC_ASSERT_EXPR(G_N_ELEMENTS(tb) > 0) diff --git a/src/libnm-std-aux/nm-std-aux.h b/src/libnm-std-aux/nm-std-aux.h index a146487eff..59e7a6e76c 100644 --- a/src/libnm-std-aux/nm-std-aux.h +++ b/src/libnm-std-aux/nm-std-aux.h @@ -327,9 +327,9 @@ typedef uint64_t _nm_bitwise nm_be64_t; * * It's useful to check the let the compiler ensure that @value is * of a certain type. */ -#define _NM_ENSURE_TYPE(type, value) (_Generic((value), type : (value))) +#define _NM_ENSURE_TYPE(type, value) (_Generic((value), type: (value))) #define _NM_ENSURE_TYPE_CONST(type, value) \ - (_Generic((value), const type : ((const type)(value)), type : ((const type)(value)))) + (_Generic((value), const type: ((const type)(value)), type: ((const type)(value)))) #else #define _NM_ENSURE_TYPE(type, value) (value) #define _NM_ENSURE_TYPE_CONST(type, value) ((const type)(value)) @@ -348,7 +348,7 @@ typedef uint64_t _nm_bitwise nm_be64_t; #if _NM_CC_SUPPORT_GENERIC && (!defined(__clang__) || __clang_major__ > 3) #define NM_STRUCT_OFFSET_ENSURE_TYPE(type, container, field) \ - (_Generic((&(((container *) NULL)->field))[0], type : nm_offsetof(container, field))) + (_Generic((&(((container *) NULL)->field))[0], type: nm_offsetof(container, field))) #else #define NM_STRUCT_OFFSET_ENSURE_TYPE(type, container, field) nm_offsetof(container, field) #endif