mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 15:48:06 +02:00
device: change hw_addr_type field to bitfield type
We don't want to waste a full "int" size to store the @hw_addr_type in NMDevicePrivate. Previously, that was hacked around by using guint8. Now, instead use a bitfield which has the right type.
This commit is contained in:
parent
5151a6071f
commit
cac0738723
1 changed files with 5 additions and 2 deletions
|
|
@ -222,7 +222,8 @@ typedef struct _NMDevicePrivate {
|
||||||
const guint8 hw_addr_len; /* read-only */
|
const guint8 hw_addr_len; /* read-only */
|
||||||
guint8 hw_addr_len_;
|
guint8 hw_addr_len_;
|
||||||
};
|
};
|
||||||
guint8 /*HwAddrType*/ hw_addr_type;
|
|
||||||
|
HwAddrType hw_addr_type:5;
|
||||||
|
|
||||||
bool real:1;
|
bool real:1;
|
||||||
|
|
||||||
|
|
@ -12575,7 +12576,9 @@ nm_device_hw_addr_is_explict (NMDevice *self)
|
||||||
g_return_val_if_fail (NM_IS_DEVICE (self), FALSE);
|
g_return_val_if_fail (NM_IS_DEVICE (self), FALSE);
|
||||||
|
|
||||||
priv = NM_DEVICE_GET_PRIVATE (self);
|
priv = NM_DEVICE_GET_PRIVATE (self);
|
||||||
return !NM_IN_SET (priv->hw_addr_type, HW_ADDR_TYPE_PERMANENT, HW_ADDR_TYPE_UNSET);
|
return !NM_IN_SET ((HwAddrType) priv->hw_addr_type,
|
||||||
|
HW_ADDR_TYPE_PERMANENT,
|
||||||
|
HW_ADDR_TYPE_UNSET);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue