mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-06 13:48:36 +02:00
glib-aux: add code comment to NM_UUID_INIT()
`NM_UUID_INIT(00, 09, 01, ...)` would look as if the values are octal numbers. That is not the case. The macro mangles them, so that the look like the UUID in string form "000901...". This is a bit odd. Maybe more confusing than helpful. Or maybe helpful?
This commit is contained in:
parent
e7582e7dd3
commit
ee32de41cf
1 changed files with 3 additions and 0 deletions
|
|
@ -9,6 +9,9 @@ typedef struct _NMUuid {
|
|||
|
||||
#define NM_UUID_INIT_ZERO() ((NMUuid){.uuid = {0}})
|
||||
|
||||
/* Beware, the 16 macro arguments are two hex-digits, not plain numbers. The macro
|
||||
* will automatically add the "0x". In particular, "09" is not an octal number, it's
|
||||
* 0x09. This oddity is so that the arguments look very much like the UUID in string form. */
|
||||
#define NM_UUID_INIT(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15) \
|
||||
((NMUuid){ \
|
||||
.uuid = {(0x##a0), \
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue