From 18a4dc869d16fca315df32a790843a0068c72a47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 23 Sep 2021 18:22:47 +0200 Subject: [PATCH] Cleanup: UUID, fix clang-tidy warnings Use explicit `uint32_t` instead of `uint`, add a missing end-of-namespace comment, and change `auto` to `const auto *`. No functional changes. --- source/blender/blenlib/BLI_uuid.h | 4 ++-- source/blender/blenlib/intern/uuid.cc | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/blender/blenlib/BLI_uuid.h b/source/blender/blenlib/BLI_uuid.h index 111a3d1eac3..eef37841d15 100644 --- a/source/blender/blenlib/BLI_uuid.h +++ b/source/blender/blenlib/BLI_uuid.h @@ -84,13 +84,13 @@ class bUUID : public ::bUUID { bUUID(const ::bUUID &struct_uuid); /** Initialise from 11 integers, 5 for the regular fields and 6 for the `node` array. */ - bUUID(std::initializer_list field_values); + bUUID(std::initializer_list field_values); /** Initialise by parsing the string; undefined behaviour when the string is invalid. */ explicit bUUID(const std::string &string_formatted_uuid); uint64_t hash() const; -}; +}; // namespace blender bool operator==(bUUID uuid1, bUUID uuid2); bool operator!=(bUUID uuid1, bUUID uuid2); diff --git a/source/blender/blenlib/intern/uuid.cc b/source/blender/blenlib/intern/uuid.cc index bc8f67f939c..fe237b8aae6 100644 --- a/source/blender/blenlib/intern/uuid.cc +++ b/source/blender/blenlib/intern/uuid.cc @@ -142,13 +142,13 @@ std::ostream &operator<<(std::ostream &stream, bUUID uuid) namespace blender { -bUUID::bUUID(const std::initializer_list field_values) +bUUID::bUUID(const std::initializer_list field_values) { BLI_assert_msg(field_values.size() == 11, "bUUID requires 5 regular fields + 6 `node` values"); - auto field_iter = field_values.begin(); + const auto *field_iter = field_values.begin(); - this->time_low = static_cast(*field_iter++); + this->time_low = *field_iter++; this->time_mid = static_cast(*field_iter++); this->time_hi_and_version = static_cast(*field_iter++); this->clock_seq_hi_and_reserved = static_cast(*field_iter++);