mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-31 18:20:10 +01: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 *)).
This commit is contained in:
parent
8b9e52b9ce
commit
5ff08fbbea
1 changed files with 6 additions and 0 deletions
|
|
@ -2165,6 +2165,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