NetworkManager/src/devices
Thomas Haller 52dbab7d07 all: use nm_clear_pointer() instead of g_clear_pointer()
g_clear_pointer() would always cast the destroy notify function
pointer to GDestroyNotify. That means, it lost some type safety, like

   GPtrArray *ptr_arr = ...

   g_clear_pointer (&ptr_arr, g_array_unref);

Since glib 2.58 ([1]), g_clear_pointer() is also more type safe. But
this is not used by NetworkManager, because we don't set
GLIB_VERSION_MIN_REQUIRED to 2.58.

[1] f9a9902aac

We have nm_clear_pointer() to avoid this issue for a long time (pre
1.12.0). Possibly we should redefine in our source tree g_clear_pointer()
as nm_clear_pointer(). However, I don't like to patch glib functions
with our own variant. Arguably, we do patch g_clear_error() in
such a manner. But there the point is to make the function inlinable.

Also, nm_clear_pointer() returns a boolean that indicates whether
anything was cleared. That is sometimes useful. I think we should
just consistently use nm_clear_pointer() instead, which does always
the preferable thing.

Replace:

   sed 's/\<g_clear_pointer *(\([^;]*\), *\([a-z_A-Z0-9]\+\) *)/nm_clear_pointer (\1, \2)/g' $(git grep -l g_clear_pointer) -i
2020-03-23 11:22:38 +01:00
..
adsl all: use nm_clear_pointer() instead of g_clear_pointer() 2020-03-23 11:22:38 +01:00
bluetooth device: allow scheduling nm_device_activate_schedule_stage1_prepare() right away 2020-03-17 08:13:22 +01:00
ovs all: use nm_clear_pointer() instead of g_clear_pointer() 2020-03-23 11:22:38 +01:00
team all: use nm_clear_g_free() instead of g_clear_pointer() 2020-03-23 11:05:34 +01:00
tests all: use nm_clear_pointer() instead of g_clear_pointer() 2020-03-23 11:22:38 +01:00
wifi device: allow scheduling nm_device_activate_schedule_stage1_prepare() right away 2020-03-17 08:13:22 +01:00
wwan all: use nm_clear_pointer() instead of g_clear_pointer() 2020-03-23 11:22:38 +01:00
meson.build build: add initial support for meson build system 2017-12-13 15:48:50 +01:00
nm-acd-manager.c all: use _nm_utils_inet4_ntop() instead of nm_utils_inet4_ntop() 2020-01-28 11:17:41 +01:00
nm-acd-manager.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-6lowpan.c all: drop explicit casts from _GET_PRIVATE() macro calls 2020-02-14 11:04:46 +01:00
nm-device-6lowpan.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-bond.c bond: bond options logic rework 2020-03-06 10:39:00 +01:00
nm-device-bond.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-bridge.c device: make device stage2 reentrant for NMDeviceBridge 2020-03-17 08:13:22 +01:00
nm-device-bridge.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-dummy.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-dummy.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-ethernet-utils.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-ethernet-utils.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-ethernet.c device: allow scheduling nm_device_activate_schedule_stage1_prepare() right away 2020-03-17 08:13:22 +01:00
nm-device-ethernet.h all: manually drop code comments with file description 2019-10-01 07:50:52 +02:00
nm-device-factory.c all: use nm_clear_pointer() instead of g_clear_pointer() 2020-03-23 11:22:38 +01:00
nm-device-factory.h all: manually drop code comments with file description 2019-10-01 07:50:52 +02:00
nm-device-generic.c all: use nm_clear_g_free() instead of g_clear_pointer() 2020-03-23 11:05:34 +01:00
nm-device-generic.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-infiniband.c all: drop explicit casts from _GET_PRIVATE() macro calls 2020-02-14 11:04:46 +01:00
nm-device-infiniband.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-ip-tunnel.c all: use nm_clear_g_free() instead of g_clear_pointer() 2020-03-23 11:05:34 +01:00
nm-device-ip-tunnel.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-logging.h all: manually drop code comments with file description 2019-10-01 07:50:52 +02:00
nm-device-macsec.c device: allow scheduling nm_device_activate_schedule_stage1_prepare() right away 2020-03-17 08:13:22 +01:00
nm-device-macsec.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-macvlan.c all: drop explicit casts from _GET_PRIVATE() macro calls 2020-02-14 11:04:46 +01:00
nm-device-macvlan.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-ppp.c device: various code cleanups in devices 2020-03-17 08:09:32 +01:00
nm-device-ppp.h all: manually drop code comments with file description 2019-10-01 07:50:52 +02:00
nm-device-private.h device: allow scheduling nm_device_activate_schedule_stage2_device_config() right away 2020-03-17 08:13:22 +01:00
nm-device-tun.c all: drop explicit casts from _GET_PRIVATE() macro calls 2020-02-14 11:04:46 +01:00
nm-device-tun.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-veth.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-veth.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-vlan.c all: drop explicit casts from _GET_PRIVATE() macro calls 2020-02-14 11:04:46 +01:00
nm-device-vlan.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-vrf.c core,libnm: add VRF support 2020-01-14 09:51:56 +01:00
nm-device-vrf.h core,libnm: add VRF support 2020-01-14 09:51:56 +01:00
nm-device-vxlan.c all: drop explicit casts from _GET_PRIVATE() macro calls 2020-02-14 11:04:46 +01:00
nm-device-vxlan.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-wireguard.c device: allow scheduling nm_device_activate_schedule_stage1_prepare() right away 2020-03-17 08:13:22 +01:00
nm-device-wireguard.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-wpan.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device-wpan.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
nm-device.c all: use nm_clear_pointer() instead of g_clear_pointer() 2020-03-23 11:22:38 +01:00
nm-device.h device: merge nm_device_get_dhcp[46]_config() to nm_device_get_dhcp_config() 2020-02-21 15:59:44 +01:00
nm-lldp-listener.c all: use nm_clear_pointer() instead of g_clear_pointer() 2020-03-23 11:22:38 +01:00
nm-lldp-listener.h all: manually drop code comments with file description 2019-10-01 07:50:52 +02:00