NetworkManager/clients/cli
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
..
agent.c clients: polkit-agent: implement polkit agent without using libpolkit 2019-12-24 10:13:51 +01:00
agent.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
common.c cli: don't use GIOChannel to watch plain file descriptor for nmc_readline_helper() 2020-01-13 15:46:04 +01:00
common.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
connections.c all: use nm_clear_pointer() instead of g_clear_pointer() 2020-03-23 11:22:38 +01:00
connections.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
devices.c cli: fix nmcli device wifi with no Wi-Fi devices available 2020-03-20 10:38:09 +01:00
devices.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
general.c cli: use async method D-Bus for nmcli radio wifi on|off 2020-03-23 09:38:23 +01:00
general.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
meson.build clients: polkit-agent: implement polkit agent without using libpolkit 2019-12-24 10:13:51 +01:00
nmcli-completion cli: make nmcli do its own command completion 2017-02-13 16:32:15 +01:00
nmcli.c cli: honor NO_COLOR environment variable to prevent automatic ASCII colors 2019-10-08 12:18:20 +02:00
nmcli.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
polkit-agent.c clients: polkit-agent: implement polkit agent without using libpolkit 2019-12-24 10:13:51 +01:00
polkit-agent.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
settings.c all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
settings.h all: unify format of our Copyright source code comments 2019-10-02 17:03:52 +02:00
utils.c cli: fix out of bounds access in _print_fill() 2020-03-16 13:44:12 +01:00
utils.h cli: expose device D-Bus path 2019-12-10 17:57:10 +01:00