diff --git a/src/core/platform/nm-fake-platform.c b/src/core/platform/nm-fake-platform.c index 10c69f637..e0d51b706 100644 --- a/src/core/platform/nm-fake-platform.c +++ b/src/core/platform/nm-fake-platform.c @@ -117,7 +117,7 @@ ip6_address_delete(NMPlatform *platform, int ifindex, struct in6_addr addr, guin const int _dirfd = (dirfd); \ const char *const _path = (path); \ \ - g_assert(_path &&_path[0]); \ + g_assert(_path && _path[0]); \ g_assert(!strstr(_path, "/../")); \ if (_dirfd < 0) { \ g_assert(!_pathid); \ diff --git a/src/core/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/src/core/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c index ea978a98a..2f3035ef7 100644 --- a/src/core/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/src/core/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -255,8 +255,8 @@ _assert_expected_content(NMConnection *connection, const char *filename, const c GError *_error = NULL; \ gboolean _success; \ \ - g_assert(_ifcfg_dir &&_ifcfg_dir[0]); \ - g_assert(_filename &&_filename[0]); \ + g_assert(_ifcfg_dir && _ifcfg_dir[0]); \ + g_assert(_filename && _filename[0]); \ \ _success = nms_ifcfg_rh_writer_write_connection(_connection, \ _ifcfg_dir, \ @@ -9533,12 +9533,10 @@ test_svUnescape(void) .exp = v_expected, \ .can_concat = !!v_expected, \ } -#define V2(v_value, v_expected) \ - { \ - .val = "" v_value "", \ - .exp = v_expected, \ - .can_concat = TRUE, \ - .needs_ascii_separator = TRUE, \ +#define V2(v_value, v_expected) \ + { \ + .val = "" v_value "", .exp = v_expected, .can_concat = TRUE, \ + .needs_ascii_separator = TRUE, \ } const UnescapeTestData data_full[] = { V1("", ""), diff --git a/src/core/settings/plugins/keyfile/tests/test-keyfile-settings.c b/src/core/settings/plugins/keyfile/tests/test-keyfile-settings.c index 6b6913c59..df5dfd402 100644 --- a/src/core/settings/plugins/keyfile/tests/test-keyfile-settings.c +++ b/src/core/settings/plugins/keyfile/tests/test-keyfile-settings.c @@ -61,7 +61,7 @@ check_ip_route(NMSettingIPConfig *config, gs_free_error GError *_error = NULL; \ NMConnection *_connection; \ \ - g_assert(full_filename &&full_filename[0] == '/'); \ + g_assert(full_filename && full_filename[0] == '/'); \ \ _connection = \ nms_keyfile_reader_from_file(full_filename, \ diff --git a/src/libnm-client-impl/nm-client.c b/src/libnm-client-impl/nm-client.c index 99d0f9530..13343cbf5 100644 --- a/src/libnm-client-impl/nm-client.c +++ b/src/libnm-client-impl/nm-client.c @@ -8205,7 +8205,7 @@ const NMLDBusMetaIface _nml_dbus_meta_iface_nm_settings = NML_DBUS_META_IFACE_IN _priv.settings.connections, nm_remote_connection_get_type, .notify_changed_ao = _property_ao_notify_changed_connections_cb, - .check_nmobj_visible_fcn = (gboolean(*)(GObject *)) nm_remote_connection_get_visible), + .check_nmobj_visible_fcn = (gboolean (*)(GObject *)) nm_remote_connection_get_visible), NML_DBUS_META_PROPERTY_INIT_S("Hostname", PROP_HOSTNAME, NMClient, diff --git a/src/libnm-core-impl/nm-keyfile.c b/src/libnm-core-impl/nm-keyfile.c index e4559e3c5..f8f735e96 100644 --- a/src/libnm-core-impl/nm-keyfile.c +++ b/src/libnm-core-impl/nm-keyfile.c @@ -1684,7 +1684,7 @@ nm_keyfile_detect_unqualified_path_scheme(const char *base_dir, const char *const _bin = (bin); \ const gsize _bin_len = (bin_len); \ \ - nm_assert(_bin &&_bin_len > 0); \ + nm_assert(_bin && _bin_len > 0); \ \ (_bin_len > NM_STRLEN(scheme) + 1 && _bin[_bin_len - 1] == '\0' \ && memcmp(_bin, scheme, NM_STRLEN(scheme)) == 0); \ diff --git a/src/libnm-core-impl/tests/test-general.c b/src/libnm-core-impl/tests/test-general.c index 6e434a9c9..870cf6b33 100644 --- a/src/libnm-core-impl/tests/test-general.c +++ b/src/libnm-core-impl/tests/test-general.c @@ -8680,11 +8680,9 @@ test_nm_utils_ascii_str_to_int64(void) static void test_nm_utils_strstrdictkey(void) { -#define _VALUES_STATIC(_v1, _v2) \ - { \ - .v1 = _v1, \ - .v2 = _v2, \ - .v_static = _nm_utils_strstrdictkey_static(_v1, _v2), \ +#define _VALUES_STATIC(_v1, _v2) \ + { \ + .v1 = _v1, .v2 = _v2, .v_static = _nm_utils_strstrdictkey_static(_v1, _v2), \ } const struct { const char *v1; diff --git a/src/libnm-glib-aux/nm-hash-utils.h b/src/libnm-glib-aux/nm-hash-utils.h index 34690eabc..9fbcbdb30 100644 --- a/src/libnm-glib-aux/nm-hash-utils.h +++ b/src/libnm-glib-aux/nm-hash-utils.h @@ -212,10 +212,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 @@ -224,7 +224,7 @@ guint nm_hash_ptr(gconstpointer ptr); #define nm_direct_hash nm_hash_ptr guint nm_hash_str(const char *str); -#define nm_str_hash ((guint(*)(gconstpointer str)) nm_hash_str) +#define nm_str_hash ((guint (*)(gconstpointer str)) nm_hash_str) #define nm_hash_vals(static_seed, ...) \ ({ \ diff --git a/src/libnm-glib-aux/nm-test-utils.h b/src/libnm-glib-aux/nm-test-utils.h index feb86301c..98b3f3d07 100644 --- a/src/libnm-glib-aux/nm-test-utils.h +++ b/src/libnm-glib-aux/nm-test-utils.h @@ -1504,7 +1504,7 @@ _nmtst_main_loop_quit_on_notify(GObject *object, GParamSpec *pspec, gpointer use (timeout_msec), \ (poll_msec), \ condition)) \ - g_assert(FALSE &&#condition); \ + g_assert(FALSE && #condition); \ } \ G_STMT_END diff --git a/src/libnm-log-core/nm-logging.c b/src/libnm-log-core/nm-logging.c index a2bd2a272..019bcf092 100644 --- a/src/libnm-log-core/nm-logging.c +++ b/src/libnm-log-core/nm-logging.c @@ -641,7 +641,7 @@ _nm_printf(3, 4) static void _iovec_set_format(struct iovec *iov, { \ const char *_str_arg = (str_arg); \ \ - nm_assert(_str_arg &&strlen(_str_arg) < (max_str_len)); \ + nm_assert(_str_arg && strlen(_str_arg) < (max_str_len)); \ _iovec_set_format_a((iov), (max_str_len), format, str_arg); \ } \ G_STMT_END diff --git a/src/libnm-platform/nm-linux-platform.c b/src/libnm-platform/nm-linux-platform.c index ff994ff5d..64209b532 100644 --- a/src/libnm-platform/nm-linux-platform.c +++ b/src/libnm-platform/nm-linux-platform.c @@ -6143,7 +6143,7 @@ nla_put_failure: const int _dirfd = (dirfd); \ const char *const _path = (path); \ \ - nm_assert(_path &&_path[0]); \ + nm_assert(_path && _path[0]); \ g_assert(!strstr(_path, "/../")); \ if (_dirfd < 0) { \ nm_assert(!_pathid); \ @@ -6151,7 +6151,7 @@ nla_put_failure: nm_assert(NM_STR_HAS_PREFIX(_path, "/proc/sys/") || NM_STR_HAS_PREFIX(_path, "/sys/") \ || NM_STR_HAS_PREFIX(_path, "/proc/net")); \ } else { \ - nm_assert(_pathid &&_pathid[0] && _pathid[0] != '/'); \ + nm_assert(_pathid && _pathid[0] && _pathid[0] != '/'); \ nm_assert(_path[0] != '/'); \ } \ } \ diff --git a/src/libnm-platform/nmp-object.c b/src/libnm-platform/nmp-object.c index 5c3f2ce4a..e11bfb3f5 100644 --- a/src/libnm-platform/nmp-object.c +++ b/src/libnm-platform/nmp-object.c @@ -2007,8 +2007,8 @@ _vt_dedup_obj_clone(const NMDedupMultiObj *obj) .obj_destroy = _vt_dedup_obj_destroy, \ .obj_full_hash_update = \ (void (*)(const NMDedupMultiObj *obj, NMHashState *h)) nmp_object_hash_update, \ - .obj_full_equal = (gboolean(*)(const NMDedupMultiObj *obj_a, \ - const NMDedupMultiObj *obj_b)) nmp_object_equal, \ + .obj_full_equal = (gboolean (*)(const NMDedupMultiObj *obj_a, \ + const NMDedupMultiObj *obj_b)) nmp_object_equal, \ } /*****************************************************************************/ diff --git a/src/nm-dispatcher/nm-dispatcher.c b/src/nm-dispatcher/nm-dispatcher.c index ce252b92b..16e35827c 100644 --- a/src/nm-dispatcher/nm-dispatcher.c +++ b/src/nm-dispatcher/nm-dispatcher.c @@ -163,7 +163,7 @@ struct Request { const ScriptInfo *const _script = (x_script); \ const Request *const _request = _script ? _script->request : NULL; \ \ - nm_assert(_script &&_request); \ + nm_assert(_script && _request); \ if (enabled_cmd) \ __LOG_print_S(print_cmd, _request, _script, ": "__VA_ARGS__); \ } \