diff options
| author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-05-23 05:12:11 +0000 |
|---|---|---|
| committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-05-23 05:12:11 +0000 |
| commit | 24374aef1b108028fdc588aa06c66b0d813d112a (patch) | |
| tree | e6c35889b1b89bad88d9af6c47bc3461f531593c /lldb/source/Utility/DataEncoder.cpp | |
| parent | 3d68a38be8d28e25160ff90ff9f35bee61173186 (diff) | |
[Utility] Modernize C-style cats
Replaces the remaining C-style casts with explicit casts in Utility. The
motivation is that they are (1) easier to spot and (2) don't have
multiple meanings.
llvm-svn: 361458
Diffstat (limited to 'lldb/source/Utility/DataEncoder.cpp')
| -rw-r--r-- | lldb/source/Utility/DataEncoder.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lldb/source/Utility/DataEncoder.cpp b/lldb/source/Utility/DataEncoder.cpp index cf4e0cde7f7f..13c505e34e82 100644 --- a/lldb/source/Utility/DataEncoder.cpp +++ b/lldb/source/Utility/DataEncoder.cpp @@ -34,8 +34,9 @@ DataEncoder::DataEncoder() // data must stay around as long as this object is valid. DataEncoder::DataEncoder(void *data, uint32_t length, ByteOrder endian, uint8_t addr_size) - : m_start((uint8_t *)data), m_end((uint8_t *)data + length), - m_byte_order(endian), m_addr_size(addr_size), m_data_sp() {} + : m_start(static_cast<uint8_t *>(data)), + m_end(static_cast<uint8_t *>(data) + length), m_byte_order(endian), + m_addr_size(addr_size), m_data_sp() {} // Make a shared pointer reference to the shared data in "data_sp" and set the // endian swapping setting to "swap", and the address size to "addr_size". The @@ -90,7 +91,7 @@ uint32_t DataEncoder::SetData(void *bytes, uint32_t length, ByteOrder endian) { m_start = nullptr; m_end = nullptr; } else { - m_start = (uint8_t *)bytes; + m_start = static_cast<uint8_t *>(bytes); m_end = m_start + length; } return GetByteSize(); |
