diff options
author | Ben Pfaff <blp@ovn.org> | 2016-11-11 15:47:54 -0800 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2017-02-08 11:41:15 -0800 |
commit | 42a1d93e290aa0c985de82c1398384dcc29f427c (patch) | |
tree | d8a745d1cc031f8bec8c12181622d5262165afd3 /lib/uuid.c | |
parent | b5f0fe21a0bd3d122f90cfd6b9daa6fcd80585e5 (diff) | |
download | openvswitch-42a1d93e290aa0c985de82c1398384dcc29f427c.tar.gz |
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>
Diffstat (limited to 'lib/uuid.c')
-rw-r--r-- | lib/uuid.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/uuid.c b/lib/uuid.c index bd98d4060..a9094d367 100644 --- a/lib/uuid.c +++ b/lib/uuid.c @@ -115,7 +115,7 @@ uuid_set_bits_v4(struct uuid *uuid) void 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. */ |