mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 04:50:07 +01:00
shared: add nm_g_variant_ref() and nm_g_variant_unref() helpers
Akin to nm_g_object_ref() and nm_g_object_unref().
This commit is contained in:
parent
240e2bd9f8
commit
2a6e7e917f
1 changed files with 17 additions and 0 deletions
|
|
@ -1129,6 +1129,23 @@ nm_clear_g_cancellable (GCancellable **cancellable)
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
static inline GVariant *
|
||||
nm_g_variant_ref (GVariant *v)
|
||||
{
|
||||
if (v)
|
||||
g_variant_ref (v);
|
||||
return v;
|
||||
}
|
||||
|
||||
static inline void
|
||||
nm_g_variant_unref (GVariant *v)
|
||||
{
|
||||
if (v)
|
||||
g_variant_unref (v);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/* Determine whether @x is a power of two (@x being an integer type).
|
||||
* Basically, this returns TRUE, if @x has exactly one bit set.
|
||||
* For negative values and zero, this always returns FALSE. */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue