diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-11-21 01:33:15 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-11-21 01:34:47 +0100 |
| commit | 0d88ce0e3e489db5f62f0097f9461df9ccb89913 (patch) | |
| tree | 9f649754096b0fb7bee9f9aa93985488beafb5b9 /dev/CompilerKit/UUID.h | |
| parent | 56db5137ddd10f476b9820944b47ab72c6f8e019 (diff) | |
meta: Codebase improvements on CompilerKit.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/CompilerKit/UUID.h')
| -rw-r--r-- | dev/CompilerKit/UUID.h | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/dev/CompilerKit/UUID.h b/dev/CompilerKit/UUID.h index 1218fab..98733fd 100644 --- a/dev/CompilerKit/UUID.h +++ b/dev/CompilerKit/UUID.h @@ -580,25 +580,24 @@ class uuid_system_generator { uuid operator()() { #ifdef _WIN32 - - GUID newId; + GUID newId{}; /// AMLALE: Should be zero-initialized. HRESULT hr = ::CoCreateGuid(&newId); if (FAILED(hr)) { throw std::system_error(hr, std::system_category(), "CoCreateGuid failed"); } - std::array<uint8_t, 16> bytes = { - {static_cast<unsigned char>((newId.Data1 >> 24) & 0xFF), - static_cast<unsigned char>((newId.Data1 >> 16) & 0xFF), - static_cast<unsigned char>((newId.Data1 >> 8) & 0xFF), - static_cast<unsigned char>((newId.Data1) & 0xFF), - static_cast<unsigned char>((newId.Data2 >> 8) & 0xFF), - static_cast<unsigned char>((newId.Data2) & 0xFF), - static_cast<unsigned char>((newId.Data3 >> 8) & 0xFF), - static_cast<unsigned char>((newId.Data3) & 0xFF), - newId.Data4[0], newId.Data4[1], newId.Data4[2], newId.Data4[3], newId.Data4[4], - newId.Data4[5], newId.Data4[6], newId.Data4[7]}}; + std::array<uint8_t, 16> bytes = {{static_cast<unsigned char>((newId.Data1 >> 24) & 0xFF), + static_cast<unsigned char>((newId.Data1 >> 16) & 0xFF), + static_cast<unsigned char>((newId.Data1 >> 8) & 0xFF), + static_cast<unsigned char>((newId.Data1) & 0xFF), + static_cast<unsigned char>((newId.Data2 >> 8) & 0xFF), + static_cast<unsigned char>((newId.Data2) & 0xFF), + static_cast<unsigned char>((newId.Data3 >> 8) & 0xFF), + static_cast<unsigned char>((newId.Data3) & 0xFF), + newId.Data4[0], newId.Data4[1], newId.Data4[2], + newId.Data4[3], newId.Data4[4], newId.Data4[5], + newId.Data4[6], newId.Data4[7]}}; return uuid{std::begin(bytes), std::end(bytes)}; |
