aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/utils/data_src.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/utils/data_src.cpp')
-rw-r--r--src/lib/utils/data_src.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/utils/data_src.cpp b/src/lib/utils/data_src.cpp
index 078d3f2ea..f4645bb85 100644
--- a/src/lib/utils/data_src.cpp
+++ b/src/lib/utils/data_src.cpp
@@ -95,8 +95,8 @@ bool DataSource_Memory::end_of_data() const
* DataSource_Memory Constructor
*/
DataSource_Memory::DataSource_Memory(const std::string& in) :
- m_source(reinterpret_cast<const uint8_t*>(in.data()),
- reinterpret_cast<const uint8_t*>(in.data()) + in.length()),
+ m_source(cast_char_ptr_to_uint8(in.data()),
+ cast_char_ptr_to_uint8(in.data()) + in.length()),
m_offset(0)
{
}
@@ -106,7 +106,7 @@ DataSource_Memory::DataSource_Memory(const std::string& in) :
*/
size_t DataSource_Stream::read(uint8_t out[], size_t length)
{
- m_source.read(reinterpret_cast<char*>(out), length);
+ m_source.read(cast_uint8_ptr_to_char(out), length);
if(m_source.bad())
throw Stream_IO_Error("DataSource_Stream::read: Source failure");
@@ -137,7 +137,7 @@ size_t DataSource_Stream::peek(uint8_t out[], size_t length, size_t offset) cons
if(offset)
{
secure_vector<uint8_t> buf(offset);
- m_source.read(reinterpret_cast<char*>(buf.data()), buf.size());
+ m_source.read(cast_uint8_ptr_to_char(buf.data()), buf.size());
if(m_source.bad())
throw Stream_IO_Error("DataSource_Stream::peek: Source failure");
got = static_cast<size_t>(m_source.gcount());
@@ -145,7 +145,7 @@ size_t DataSource_Stream::peek(uint8_t out[], size_t length, size_t offset) cons
if(got == offset)
{
- m_source.read(reinterpret_cast<char*>(out), length);
+ m_source.read(cast_uint8_ptr_to_char(out), length);
if(m_source.bad())
throw Stream_IO_Error("DataSource_Stream::peek: Source failure");
got = static_cast<size_t>(m_source.gcount());