libnm: change empty-GPtrArray-return semantics
authorDan Winship <danw@gnome.org>
Mon, 25 Aug 2014 14:33:53 +0000 (10:33 -0400)
committerDan Winship <danw@gnome.org>
Thu, 4 Sep 2014 13:21:05 +0000 (09:21 -0400)
commit3e5b3833aa4964f6d2224560f3ad8c7ffa1e8027
tree411d50040fa8997bcd912e1f4eebd83c364a0e4a
parent074c2093b6a733c3d5712a7c58386e1e652a8903
libnm: change empty-GPtrArray-return semantics

libnm functions that return GPtrArrays of objects had a rule that if
the array was empty, they would return NULL rather than a 0-length
array. As it turns out, this is just a nuisance to clients, since in
most places the code for the non-empty case would end up doing the
right thing for the empty case as well (and where it doesn't, we can
check "array->len == 0" just as easily as "array == NULL"). So just
return the 0-length array instead.
15 files changed:
clients/cli/connections.c
clients/cli/devices.c
clients/tui/nmt-connect-connection-list.c
clients/tui/nmt-device-entry.c
examples/C/glib/get-ap-info-libnm.c
libnm/nm-active-connection.c
libnm/nm-client.c
libnm/nm-device-bond.c
libnm/nm-device-bridge.c
libnm/nm-device-team.c
libnm/nm-device-wifi.c
libnm/nm-device-wimax.c
libnm/nm-device.c
libnm/nm-object-private.h
libnm/tests/test-nm-client.c