use braces for array init

This commit is contained in:
mariusbancila 2017-12-18 23:32:38 +02:00 committed by GitHub
parent d4d7a3a5a3
commit 9792260b00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -93,7 +93,7 @@ namespace uuids
::CoCreateGuid(&newId); ::CoCreateGuid(&newId);
std::array<unsigned char, 16> bytes = std::array<unsigned char, 16> bytes =
{ {{
(unsigned char)((newId.Data1 >> 24) & 0xFF), (unsigned char)((newId.Data1 >> 24) & 0xFF),
(unsigned char)((newId.Data1 >> 16) & 0xFF), (unsigned char)((newId.Data1 >> 16) & 0xFF),
(unsigned char)((newId.Data1 >> 8) & 0xFF), (unsigned char)((newId.Data1 >> 8) & 0xFF),
@ -113,7 +113,7 @@ namespace uuids
(unsigned char)newId.Data4[5], (unsigned char)newId.Data4[5],
(unsigned char)newId.Data4[6], (unsigned char)newId.Data4[6],
(unsigned char)newId.Data4[7] (unsigned char)newId.Data4[7]
}; }};
return uuid{ bytes }; return uuid{ bytes };
@ -129,7 +129,7 @@ namespace uuids
CFRelease(newId); CFRelease(newId);
std::array<unsigned char, 16> byteArray = std::array<unsigned char, 16> byteArray =
{ {{
bytes.byte0, bytes.byte0,
bytes.byte1, bytes.byte1,
bytes.byte2, bytes.byte2,
@ -146,7 +146,7 @@ namespace uuids
bytes.byte13, bytes.byte13,
bytes.byte14, bytes.byte14,
bytes.byte15 bytes.byte15
}; }};
return uuid{ byteArray }; return uuid{ byteArray };
#elif #elif
return uuid{}; return uuid{};
@ -161,4 +161,4 @@ namespace std
{ {
lhs.swap(rhs); lhs.swap(rhs);
} }
} }