diff options
author | Thomas Haller <thaller@redhat.com> | 2020-11-12 15:57:06 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2020-11-12 16:03:09 +0100 |
commit | a2b5e22f82d167ca22ae99e6b8054fd8460038c1 (patch) | |
tree | 6f504ff1d296e631c99ad9dde3256c05c0d48029 /src/nm-ip6-config.c | |
parent | 2f83777054a6f811288434ee90958ce1c9128432 (diff) | |
download | NetworkManager-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/nm-ip6-config.c')
-rw-r--r-- | src/nm-ip6-config.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nm-ip6-config.c b/src/nm-ip6-config.c index 407aa1d60f..54488e37d9 100644 --- a/src/nm-ip6-config.c +++ b/src/nm-ip6-config.c @@ -2554,12 +2554,12 @@ NMIP6Config * nm_ip6_config_new(NMDedupMultiIndex *multi_idx, int ifindex) { g_return_val_if_fail(ifindex >= -1, NULL); - return (NMIP6Config *) g_object_new(NM_TYPE_IP6_CONFIG, - NM_IP6_CONFIG_MULTI_IDX, - multi_idx, - NM_IP6_CONFIG_IFINDEX, - ifindex, - NULL); + return g_object_new(NM_TYPE_IP6_CONFIG, + NM_IP6_CONFIG_MULTI_IDX, + multi_idx, + NM_IP6_CONFIG_IFINDEX, + ifindex, + NULL); } NMIP6Config * |