Path: blob/main/converters/mimelib/files/patch-mimelib-string.cpp
16171 views
--- mimelib/string.cpp.bak 1997-09-27 13:54:17.000000000 +02001+++ mimelib/string.cpp 2011-01-20 11:16:24.000000000 +01002@@ -29,7 +29,7 @@3#include <ctype.h>4#include <stdlib.h>5#include <string.h>6-#include <new.h>7+#include <new>8#include <mimelib/string.h>910#define DW_MIN(a,b) ((a) <= (b) ? (a) : (b))11@@ -138,9 +138,9 @@12assert(rep != 0);13#if defined(DW_DEBUG_VERSION) || defined(DW_DEVELOPMENT_VERSION)14if (rep->mRefCount <= 0) {15- cerr << "Error: attempt to delete a DwStringRep "16+ std::cerr << "Error: attempt to delete a DwStringRep "17"with ref count <= 0\n";18- cerr << "(Possibly 'delete' was called twice for same object)\n";19+ std::cerr << "(Possibly 'delete' was called twice for same object)\n";20abort();21}22#endif // defined(DW_DEBUG_VERSION) || defined(DW_DEVELOPMENT_VERSION)23@@ -173,8 +173,8 @@24{25#if defined (DW_DEBUG_VERSION) || defined (DW_DEVELOPMENT_VERSION)26if (mBuffer == 0) {27- cerr << "DwStringRep destructor called for bad DwStringRep object\n";28- cerr << "(Possibly 'delete' was called twice for same object)\n";29+ std::cerr << "DwStringRep destructor called for bad DwStringRep object\n";30+ std::cerr << "(Possibly 'delete' was called twice for same object)\n";31abort();32}33#endif // defined (DW_DEBUG_VERSION) || defined (DW_DEVELOPMENT_VERSION)34@@ -1045,7 +1045,7 @@35}363738-void DwString::WriteTo(ostream& aStrm) const39+void DwString::WriteTo(std::ostream& aStrm) const40{41const char* buf = mRep->mBuffer + mStart;42for (size_t i=0; i < mLength; ++i) {43@@ -1336,7 +1336,7 @@44}454647-void DwString::PrintDebugInfo(ostream& aStrm) const48+void DwString::PrintDebugInfo(std::ostream& aStrm) const49{50#if defined (DW_DEBUG_VERSION)51aStrm <<52@@ -1633,7 +1633,7 @@53}545556-ostream& operator << (ostream& aOstrm, const DwString& aStr)57+std::ostream& operator << (std::ostream& aOstrm, const DwString& aStr)58{59const char* buf = aStr.data();60for (size_t i=0; i < aStr.length(); ++i) {61@@ -1643,7 +1643,7 @@62}636465-istream& getline(istream& aIstrm, DwString& aStr, char aDelim)66+std::istream& getline(std::istream& aIstrm, DwString& aStr, char aDelim)67{68aStr.clear();69char ch;70@@ -1657,7 +1657,7 @@71}727374-istream& getline(istream& aIstrm, DwString& aStr)75+std::istream& getline(std::istream& aIstrm, DwString& aStr)76{77return getline(aIstrm, aStr, '\n');78}798081