mirror of
https://github.com/openvswitch/ovs
synced 2025-10-29 15:28:56 +00:00
uuid: New macro UUID_ZERO for an all-zero expression or initializer.
This is convenient in expressions, e.g. "uuid = x ? *x : UUID_ZERO;". Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Andy Zhou <azhou@ovn.org>
This commit is contained in:
@@ -115,7 +115,7 @@ uuid_set_bits_v4(struct uuid *uuid)
|
|||||||
void
|
void
|
||||||
uuid_zero(struct uuid *uuid)
|
uuid_zero(struct uuid *uuid)
|
||||||
{
|
{
|
||||||
uuid->parts[0] = uuid->parts[1] = uuid->parts[2] = uuid->parts[3] = 0;
|
*uuid = UUID_ZERO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns true if 'uuid' is all zero, otherwise false. */
|
/* Returns true if 'uuid' is all zero, otherwise false. */
|
||||||
|
|||||||
@@ -18,6 +18,9 @@
|
|||||||
|
|
||||||
#include "openvswitch/uuid.h"
|
#include "openvswitch/uuid.h"
|
||||||
|
|
||||||
|
/* An initializer or expression for an all-zero UUID. */
|
||||||
|
#define UUID_ZERO ((struct uuid) { .parts = { 0, 0, 0, 0 } })
|
||||||
|
|
||||||
/* Formats a UUID as a string, in the conventional format.
|
/* Formats a UUID as a string, in the conventional format.
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
|
|||||||
Reference in New Issue
Block a user