aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-09-04 05:25:37 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-09-04 05:25:37 +0200
commitf827ab10652dd7e6caa6e600821e15b0f461b52c (patch)
tree2eaea6f9e27f23389ab594bc7845bc0e9319da33
parentb0455a73abf1e6ab6c3dbb205d1308797167ecce (diff)
Minor and cosmetic changes to uuid
-rw-r--r--libbutl/uuid-windows.cxx14
-rw-r--r--libbutl/uuid.hxx14
-rw-r--r--libbutl/uuid.ixx8
3 files changed, 14 insertions, 22 deletions
diff --git a/libbutl/uuid-windows.cxx b/libbutl/uuid-windows.cxx
index 825505b..05241ba 100644
--- a/libbutl/uuid-windows.cxx
+++ b/libbutl/uuid-windows.cxx
@@ -17,14 +17,14 @@ using namespace std;
namespace butl
{
void uuid::
- assign (const _GUID& g)
+ assign (const _GUID& d)
{
- time_low = g.Data1;
- time_mid = g.Data2;
- time_hiv = g.Data3;
- clock_seq_hir = g.Data4[0];
- clock_seq_low = g.Data4[1];
- memcpy (node, &g.Data4[2], 6);
+ time_low = d.Data1;
+ time_mid = d.Data2;
+ time_hiv = d.Data3;
+ clock_seq_hir = d.Data4[0];
+ clock_seq_low = d.Data4[1];
+ memcpy (node, &d.Data4[2], 6);
}
template<>
diff --git a/libbutl/uuid.hxx b/libbutl/uuid.hxx
index 92397f6..fa27f6a 100644
--- a/libbutl/uuid.hxx
+++ b/libbutl/uuid.hxx
@@ -49,12 +49,12 @@ namespace butl
{
// Normally not accessed directly (see RFC4122 Section 4.1.2).
//
- std::uint32_t time_low;
- std::uint16_t time_mid;
- std::uint16_t time_hiv; // hi_and_version
- std::uint8_t clock_seq_hir; // hi_and_reserved
- std::uint8_t clock_seq_low;
- std::uint8_t node[6];
+ std::uint32_t time_low = 0;
+ std::uint16_t time_mid = 0;
+ std::uint16_t time_hiv = 0; // hi_and_version
+ std::uint8_t clock_seq_hir = 0; // hi_and_reserved
+ std::uint8_t clock_seq_low = 0;
+ std::uint8_t node[6] = {0, 0, 0, 0, 0, 0};
// System UUID generator. See the uuid_generator interface for details.
//
@@ -67,7 +67,7 @@ namespace butl
// Create a nil UUID (all members are 0).
//
- uuid ();
+ uuid () = default;
bool
nil () const;
diff --git a/libbutl/uuid.ixx b/libbutl/uuid.ixx
index 0208221..c5411fb 100644
--- a/libbutl/uuid.ixx
+++ b/libbutl/uuid.ixx
@@ -9,14 +9,6 @@ namespace butl
{
// NOTE: the order of definitions is important to MinGW GCC (DLL linkage).
- inline uuid::
- uuid ()
- : time_low (0), time_mid (0), time_hiv (0),
- clock_seq_hir (0), clock_seq_low (0),
- node {0, 0, 0, 0, 0, 0}
- {
- }
-
inline bool uuid::
nil () const
{