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/devices/team/nm-device-team.c | |
parent | 2f83777054a6f811288434ee90958ce1c9128432 (diff) |
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/devices/team/nm-device-team.c')
-rw-r--r-- | src/devices/team/nm-device-team.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/devices/team/nm-device-team.c b/src/devices/team/nm-device-team.c index 65fd70c78a..0f481b8a62 100644 --- a/src/devices/team/nm-device-team.c +++ b/src/devices/team/nm-device-team.c @@ -1003,18 +1003,18 @@ constructed(GObject *object) NMDevice * nm_device_team_new(const char *iface) { - return (NMDevice *) g_object_new(NM_TYPE_DEVICE_TEAM, - NM_DEVICE_IFACE, - iface, - NM_DEVICE_DRIVER, - "team", - NM_DEVICE_TYPE_DESC, - "Team", - NM_DEVICE_DEVICE_TYPE, - NM_DEVICE_TYPE_TEAM, - NM_DEVICE_LINK_TYPE, - NM_LINK_TYPE_TEAM, - NULL); + return g_object_new(NM_TYPE_DEVICE_TEAM, + NM_DEVICE_IFACE, + iface, + NM_DEVICE_DRIVER, + "team", + NM_DEVICE_TYPE_DESC, + "Team", + NM_DEVICE_DEVICE_TYPE, + NM_DEVICE_TYPE_TEAM, + NM_DEVICE_LINK_TYPE, + NM_LINK_TYPE_TEAM, + NULL); } static void |