mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 00:38:07 +02:00
glib-aux: add nm_g_array_data() helper
It's annoying to do
(arr ? arr->data : NULL)
Especially, because usually you'd need to cast the above
(which would have type (char *)).
(cherry picked from commit 5ff08fbbea)
This commit is contained in:
parent
b596ad1058
commit
281b3e6473
1 changed files with 6 additions and 0 deletions
|
|
@ -2127,6 +2127,12 @@ char *nm_utils_g_slist_strlist_join(const GSList *a, const char *separator);
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
static inline gpointer
|
||||
nm_g_array_data(const GArray *arr)
|
||||
{
|
||||
return arr ? arr->data : NULL;
|
||||
}
|
||||
|
||||
static inline guint
|
||||
nm_g_array_len(const GArray *arr)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue