diff options
author | Jacques Lucke <jacques@blender.org> | 2020-08-07 19:24:59 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-08-07 19:42:21 +0300 |
commit | c50e5fcc344d00b03eb4a3141b5b45944c3570fd (patch) | |
tree | f683ae1a1f38551d160a5be2ee86561d51faca26 /source/blender/blenlib/BLI_string_ref.hh | |
parent | 28b10224346a9a2e55267f98357991a841eeda5b (diff) |
Cleanup: use C++ style casts in various places
Diffstat (limited to 'source/blender/blenlib/BLI_string_ref.hh')
-rw-r--r-- | source/blender/blenlib/BLI_string_ref.hh | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/blenlib/BLI_string_ref.hh b/source/blender/blenlib/BLI_string_ref.hh index 8bf4821f72a..a217dc4c772 100644 --- a/source/blender/blenlib/BLI_string_ref.hh +++ b/source/blender/blenlib/BLI_string_ref.hh @@ -167,7 +167,7 @@ class StringRefNull : public StringRefBase { /** * Construct a StringRefNull from a null terminated c-string. The pointer must not point to NULL. */ - StringRefNull(const char *str) : StringRefBase(str, (int64_t)strlen(str)) + StringRefNull(const char *str) : StringRefBase(str, static_cast<int64_t>(strlen(str))) { BLI_assert(str != NULL); BLI_assert(data_[size_] == '\0'); @@ -179,7 +179,7 @@ class StringRefNull : public StringRefBase { */ StringRefNull(const char *str, const int64_t size) : StringRefBase(str, size) { - BLI_assert((int64_t)strlen(str) == size); + BLI_assert(static_cast<int64_t>(strlen(str)) == size); } /** @@ -231,7 +231,7 @@ class StringRef : public StringRefBase { /** * Create a StringRef from a null-terminated c-string. */ - StringRef(const char *str) : StringRefBase(str, str ? (int64_t)strlen(str) : 0) + StringRef(const char *str) : StringRefBase(str, str ? static_cast<int64_t>(strlen(str)) : 0) { } @@ -244,7 +244,7 @@ class StringRef : public StringRefBase { * second point points to a smaller address than the first one. */ StringRef(const char *begin, const char *one_after_end) - : StringRefBase(begin, (int64_t)(one_after_end - begin)) + : StringRefBase(begin, static_cast<int64_t>(one_after_end - begin)) { BLI_assert(begin <= one_after_end); } @@ -253,7 +253,7 @@ class StringRef : public StringRefBase { * Reference a std::string. Remember that when the std::string is destructed, the StringRef * will point to uninitialized memory. */ - StringRef(const std::string &str) : StringRefBase(str.data(), (int64_t)str.size()) + StringRef(const std::string &str) : StringRefBase(str.data(), static_cast<int64_t>(str.size())) { } |