aboutsummaryrefslogtreecommitdiffstats
path: root/src/data_src.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2007-07-23 15:44:04 +0000
committerlloyd <[email protected]>2007-07-23 15:44:04 +0000
commite2f1f734277146d817ab284dea21e4013cb5b937 (patch)
tree21ad6ee775e36aa7fb24a504077200c22b1f15b8 /src/data_src.cpp
parent211c4929ae92106794984d872a0cae1a873baa29 (diff)
Avoid C-style casts (as detected by GCC's -Wold-style-cast) and instead use
static_cast or reinterpret_cast, as needed.
Diffstat (limited to 'src/data_src.cpp')
-rw-r--r--src/data_src.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/data_src.cpp b/src/data_src.cpp
index 9ed7dc6c9..2a83a3860 100644
--- a/src/data_src.cpp
+++ b/src/data_src.cpp
@@ -93,7 +93,7 @@ DataSource_Memory::DataSource_Memory(const MemoryRegion<byte>& in)
*************************************************/
DataSource_Memory::DataSource_Memory(const std::string& in)
{
- source.set((const byte*)in.data(), in.length());
+ source.set(reinterpret_cast<const byte*>(in.data()), in.length());
offset = 0;
}
@@ -102,13 +102,13 @@ DataSource_Memory::DataSource_Memory(const std::string& in)
*************************************************/
u32bit DataSource_Stream::read(byte out[], u32bit length)
{
- source->read((char*)out, length);
+ source->read(reinterpret_cast<char*>(out), length);
if(source->bad())
throw Stream_IO_Error("DataSource_Stream::read: Source failure");
u32bit got = source->gcount();
total_read += got;
- return (u32bit)got;
+ return got;
}
/*************************************************
@@ -124,7 +124,7 @@ u32bit DataSource_Stream::peek(byte out[], u32bit length, u32bit offset) const
if(offset)
{
SecureVector<byte> buf(offset);
- source->read((char*)buf.begin(), buf.size());
+ source->read(reinterpret_cast<char*>(buf.begin()), buf.size());
if(source->bad())
throw Stream_IO_Error("DataSource_Stream::peek: Source failure");
got = source->gcount();
@@ -132,7 +132,7 @@ u32bit DataSource_Stream::peek(byte out[], u32bit length, u32bit offset) const
if(got == offset)
{
- source->read((char*)out, length);
+ source->read(reinterpret_cast<char*>(out), length);
if(source->bad())
throw Stream_IO_Error("DataSource_Stream::peek: Source failure");
got = source->gcount();