[lldb][NFC] Use static_cast instead of reinterpret_cast where possible
Summary: There are a few places in LLDB where we do a `reinterpret_cast` for conversions that we could also do with `static_cast`. This patch moves all this code to `static_cast`.
Reviewers: shafik, JDevlieghere, labath
Reviewed By: labath
Subscribers: arphaman, usaxena95, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D72161
diff --git a/lldb/source/Utility/Environment.cpp b/lldb/source/Utility/Environment.cpp
index 1405336..8cafd30 100644
--- a/lldb/source/Utility/Environment.cpp
+++ b/lldb/source/Utility/Environment.cpp
@@ -13,7 +13,7 @@
char *Environment::Envp::make_entry(llvm::StringRef Key,
llvm::StringRef Value) {
const size_t size = Key.size() + 1 /*=*/ + Value.size() + 1 /*\0*/;
- char *Result = reinterpret_cast<char *>(
+ char *Result = static_cast<char *>(
Allocator.Allocate(sizeof(char) * size, alignof(char)));
char *Next = Result;
@@ -26,7 +26,7 @@
}
Environment::Envp::Envp(const Environment &Env) {
- Data = reinterpret_cast<char **>(
+ Data = static_cast<char **>(
Allocator.Allocate(sizeof(char *) * (Env.size() + 1), alignof(char *)));
char **Next = Data;
for (const auto &KV : Env)