From fc1c6b08d191b3ee9964bf53ea95767bc54377ee Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Sat, 1 Jan 2005 11:32:23 +0000 Subject: Converted all C-style casts to C++-style casts + added unit test for utility::md5. --- src/text.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/text.cpp') diff --git a/src/text.cpp b/src/text.cpp index 4fb5337b..fd210bab 100644 --- a/src/text.cpp +++ b/src/text.cpp @@ -490,7 +490,7 @@ void text::encodeAndFold(utility::outputStream& os, const string::size_type maxL const string::size_type maxLineLength3 = (maxLineLength == lineLengthLimits::infinite) ? maxLineLength - : std::min(maxLineLength, (const string::size_type) 76); + : std::min(maxLineLength, static_cast (76)); // Base64 if more than 60% non-ascii, quoted-printable else (default) const string::size_type asciiPercent = (100 * asciiCount) / buffer.length(); @@ -534,9 +534,10 @@ void text::encodeAndFold(utility::outputStream& os, const string::size_type maxL string::const_iterator pos = buffer.begin(); string::size_type remaining = buffer.length(); - encoder* theEncoder = ((encoding == 'B') - ? ((encoder*) new encoderB64) - : ((encoder*) new encoderQP)); + encoder* theEncoder; + + if (encoding == 'B') theEncoder == new encoderB64; + else theEncoder = new encoderQP; string qpEncodedBuffer; -- cgit v1.2.3