summaryrefslogtreecommitdiff
path: root/cppe/test
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2006-06-14 16:22:49 +0000
committerDwayne Boone <dwayne@zeroc.com>2006-06-14 16:22:49 +0000
commit37536109f3711dfa59ef1d89f385c5ec956da41e (patch)
treea4df0e519f6786b95f37a2a768a33dbbfb8ae1ce /cppe/test
parentbug 923 - run string converter on properties red frmo file (diff)
downloadice-37536109f3711dfa59ef1d89f385c5ec956da41e.tar.bz2
ice-37536109f3711dfa59ef1d89f385c5ec956da41e.tar.xz
ice-37536109f3711dfa59ef1d89f385c5ec956da41e.zip
Refactored a bit
Diffstat (limited to 'cppe/test')
-rw-r--r--cppe/test/IceE/custom/StringConverterI.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/cppe/test/IceE/custom/StringConverterI.cpp b/cppe/test/IceE/custom/StringConverterI.cpp
index 408b54ff962..9ce51b96348 100644
--- a/cppe/test/IceE/custom/StringConverterI.cpp
+++ b/cppe/test/IceE/custom/StringConverterI.cpp
@@ -19,10 +19,10 @@ Test::StringConverterI::toUTF8(const char* sourceStart, const char* sourceEnd, I
Ice::Byte* targetStart = buffer.getMoreBytes(size, 0);
Ice::Byte* targetEnd = targetStart + size;
- char* p = const_cast<char*>(sourceEnd);
+ unsigned int j = size;
for(unsigned int i = 0; i < size; ++i)
{
- targetStart[i] = *(--p);
+ targetStart[i] = sourceStart[--j];
}
return targetEnd;
@@ -35,10 +35,10 @@ Test::StringConverterI::fromUTF8(const Ice::Byte* sourceStart, const Ice::Byte*
size_t size = static_cast<size_t>(sourceEnd - sourceStart);
target.resize(size);
- Ice::Byte* p = const_cast<Ice::Byte*>(sourceEnd);
+ unsigned int j = size;
for(unsigned int i = 0; i < size; ++i)
{
- target[i] = *(--p);
+ target[i] = sourceStart[--j];
}
}
@@ -53,10 +53,10 @@ Test::WstringConverterI::toUTF8(const wchar_t* sourceStart, const wchar_t* sourc
Ice::Byte* targetStart = buffer.getMoreBytes(size, 0);
Ice::Byte* targetEnd = targetStart + size;
- char* p = const_cast<char*>(s.c_str() + size);
+ unsigned int j = size;
for(unsigned int i = 0; i < size; ++i)
{
- targetStart[i] = static_cast<Ice::Byte>(*(--p));
+ targetStart[i] = static_cast<Ice::Byte>(s[--j]);
}
return targetEnd;
}
@@ -69,10 +69,10 @@ Test::WstringConverterI::fromUTF8(const Ice::Byte* sourceStart, const Ice::Byte*
string s;
s.resize(size);
- Ice::Byte* p = const_cast<Ice::Byte*>(sourceEnd);
+ unsigned int j = size;
for(unsigned int i = 0; i < size; ++i)
{
- s[i] = *(--p);
+ s[i] = sourceStart[--j];
}
target = IceUtil::stringToWstring(s);