summaryrefslogtreecommitdiff
path: root/src/vpn
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-11-12 15:57:06 +0100
committerThomas Haller <thaller@redhat.com>2020-11-12 16:03:09 +0100
commita2b5e22f82d167ca22ae99e6b8054fd8460038c1 (patch)
tree6f504ff1d296e631c99ad9dde3256c05c0d48029 /src/vpn
parent2f83777054a6f811288434ee90958ce1c9128432 (diff)
downloadNetworkManager-a2b5e22f82d167ca22ae99e6b8054fd8460038c1.tar.gz
all: drop unnecessary cast for return value of g_object_new()
C casts unconditionally force the type, and as such they don't necessarily improve type safety, but rather overcome restrictions from the compiler when necessary. Casting a void pointer is unnecessary (in C), it does not make the code more readable nor more safe. In particular for g_object_new(), which is known to return a void pointer of the right type. Drop such casts. sed 's/([A-Za-z_0-9]\+ *\* *) *g_object_new/g_object_new/g' $(git grep -l g_object_new) -i ./contrib/scripts/nm-code-format-container.sh
Diffstat (limited to 'src/vpn')
-rw-r--r--src/vpn/nm-vpn-connection.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/vpn/nm-vpn-connection.c b/src/vpn/nm-vpn-connection.c
index 68c66af7d7..0d4b12bc12 100644
--- a/src/vpn/nm-vpn-connection.c
+++ b/src/vpn/nm-vpn-connection.c
@@ -862,22 +862,22 @@ nm_vpn_connection_new(NMSettingsConnection * settings_connection,
g_return_val_if_fail(NM_IS_DEVICE(parent_device), NULL);
g_return_val_if_fail(specific_object, NULL);
- return (NMVpnConnection *) g_object_new(NM_TYPE_VPN_CONNECTION,
- NM_ACTIVE_CONNECTION_INT_SETTINGS_CONNECTION,
- settings_connection,
- NM_ACTIVE_CONNECTION_INT_DEVICE,
- parent_device,
- NM_ACTIVE_CONNECTION_SPECIFIC_OBJECT,
- specific_object,
- NM_ACTIVE_CONNECTION_INT_SUBJECT,
- subject,
- NM_ACTIVE_CONNECTION_INT_ACTIVATION_REASON,
- activation_reason,
- NM_ACTIVE_CONNECTION_VPN,
- TRUE,
- NM_ACTIVE_CONNECTION_STATE_FLAGS,
- (guint) initial_state_flags,
- NULL);
+ return g_object_new(NM_TYPE_VPN_CONNECTION,
+ NM_ACTIVE_CONNECTION_INT_SETTINGS_CONNECTION,
+ settings_connection,
+ NM_ACTIVE_CONNECTION_INT_DEVICE,
+ parent_device,
+ NM_ACTIVE_CONNECTION_SPECIFIC_OBJECT,
+ specific_object,
+ NM_ACTIVE_CONNECTION_INT_SUBJECT,
+ subject,
+ NM_ACTIVE_CONNECTION_INT_ACTIVATION_REASON,
+ activation_reason,
+ NM_ACTIVE_CONNECTION_VPN,
+ TRUE,
+ NM_ACTIVE_CONNECTION_STATE_FLAGS,
+ (guint) initial_state_flags,
+ NULL);
}
const char *