From: <man...@us...> - 2013-04-24 16:17:41
|
Revision: 1964 http://sourceforge.net/p/modplug/code/1964 Author: manxorist Date: 2013-04-24 16:17:21 +0000 (Wed, 24 Apr 2013) Log Message: ----------- [Ref] Repalce deprecated std::strstream with std::stringstream Modified Paths: -------------- trunk/OpenMPT/common/serialization_utils.cpp trunk/OpenMPT/common/serialization_utils.h trunk/OpenMPT/common/stdafx.h trunk/OpenMPT/mptrack/CommandSet.cpp trunk/OpenMPT/mptrack/InputHandler.cpp trunk/OpenMPT/mptrack/TuningDialog.cpp trunk/OpenMPT/mptrack/test/test.cpp trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Sndfile.cpp Modified: trunk/OpenMPT/common/serialization_utils.cpp =================================================================== --- trunk/OpenMPT/common/serialization_utils.cpp 2013-04-24 13:53:05 UTC (rev 1963) +++ trunk/OpenMPT/common/serialization_utils.cpp 2013-04-24 16:17:21 UTC (rev 1964) @@ -875,7 +875,8 @@ { OutStream& oStrm = *m_pOstrm; const Postype posDataEnd = oStrm.tellp(); - if (m_posMapStart != Postype(0) && ((uint32)m_MapStream.pcount() > m_nMapReserveSize)) + std::string mapStreamStr = m_MapStream.str(); + if (m_posMapStart != Postype(0) && ((uint32)mapStreamStr.length() > m_nMapReserveSize)) { AddWriteNote(SNW_INSUFFICIENT_MAPSIZE); return; } if (m_posMapStart < 1) @@ -888,8 +889,7 @@ if (GetFlag(RwfRwHasMap)) //Write map { - oStrm.write(m_MapStream.str(), m_MapStream.pcount()); - m_MapStream.freeze(false); + oStrm.write(mapStreamStr.c_str(), mapStreamStr.length()); } const Postype posMapEnd = oStrm.tellp(); Modified: trunk/OpenMPT/common/serialization_utils.h =================================================================== --- trunk/OpenMPT/common/serialization_utils.h 2013-04-24 13:53:05 UTC (rev 1963) +++ trunk/OpenMPT/common/serialization_utils.h 2013-04-24 16:17:21 UTC (rev 1964) @@ -11,7 +11,7 @@ #pragma once #include <string> -#include <strstream> +#include <sstream> #include <vector> #include <bitset> #include "../common/misc_util.h" @@ -28,8 +28,8 @@ typedef std::ostream OutStream; typedef std::istream InStream; typedef std::iostream IoStream; -typedef std::istrstream IstrStream; -typedef std::ostrstream OstrStream; +typedef std::istringstream IstrStream; +typedef std::ostringstream OstrStream; typedef OutStream::off_type Offtype; typedef Offtype Postype; typedef std::streamsize Streamsize; Modified: trunk/OpenMPT/common/stdafx.h =================================================================== --- trunk/OpenMPT/common/stdafx.h 2013-04-24 13:53:05 UTC (rev 1963) +++ trunk/OpenMPT/common/stdafx.h 2013-04-24 16:17:21 UTC (rev 1964) @@ -37,7 +37,7 @@ #include <string> #include <fstream> -#include <strstream> +#include <sstream> Modified: trunk/OpenMPT/mptrack/CommandSet.cpp =================================================================== --- trunk/OpenMPT/mptrack/CommandSet.cpp 2013-04-24 13:53:05 UTC (rev 1963) +++ trunk/OpenMPT/mptrack/CommandSet.cpp 2013-04-24 16:17:21 UTC (rev 1964) @@ -1700,7 +1700,7 @@ size_t nSize = 0; if (LoadResource(MAKEINTRESOURCE(IDR_DEFAULT_KEYBINDINGS), TEXT("KEYBINDINGS"), pData, nSize, hglob) != nullptr) { - std::istrstream iStrm(pData, nSize); + std::istringstream iStrm(std::string(pData, nSize)); success = LoadFile(iStrm, TEXT("\"executable resource\"")); FreeResource(hglob); } Modified: trunk/OpenMPT/mptrack/InputHandler.cpp =================================================================== --- trunk/OpenMPT/mptrack/InputHandler.cpp 2013-04-24 13:53:05 UTC (rev 1963) +++ trunk/OpenMPT/mptrack/InputHandler.cpp 2013-04-24 16:17:21 UTC (rev 1964) @@ -17,7 +17,6 @@ #include "mainfrm.h" #include <direct.h> #include ".\inputhandler.h" -#include <strstream> #include <Shlwapi.h> #define TRANSITIONBIT 0x8000 Modified: trunk/OpenMPT/mptrack/TuningDialog.cpp =================================================================== --- trunk/OpenMPT/mptrack/TuningDialog.cpp 2013-04-24 13:53:05 UTC (rev 1963) +++ trunk/OpenMPT/mptrack/TuningDialog.cpp 2013-04-24 16:17:21 UTC (rev 1964) @@ -1492,7 +1492,7 @@ nSize = file.Read(&data[0], nSize); file.Close(); - std::istrstream iStrm(&data[0], nSize); + std::istringstream iStrm(std::string(&data[0], nSize)); return ImportScl(iStrm, pszName); } Modified: trunk/OpenMPT/mptrack/test/test.cpp =================================================================== --- trunk/OpenMPT/mptrack/test/test.cpp 2013-04-24 13:53:05 UTC (rev 1963) +++ trunk/OpenMPT/mptrack/test/test.cpp 2013-04-24 16:17:21 UTC (rev 1964) @@ -27,7 +27,7 @@ #include "../../soundlib/SampleFormatConverters.h" #include <limits> #include <fstream> -#include <strstream> +#include <sstream> #ifdef _DEBUG #define new DEBUG_NEW @@ -1041,7 +1041,7 @@ for(size_t j = 0; j < numCommands[i]; j++, iter++) pat[i][j] = *iter; } - std::strstream mem; + std::stringstream mem; WriteModPatterns(mem, sndFile.Patterns); VERIFY_EQUAL_NONCONT( mem.good(), true ); Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2013-04-24 13:53:05 UTC (rev 1963) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2013-04-24 16:17:21 UTC (rev 1964) @@ -17,7 +17,7 @@ #endif #include "../common/serialization_utils.h" #include <fstream> -#include <strstream> +#include <sstream> #include <list> #include "../common/version.h" #include "ITTools.h" @@ -913,7 +913,7 @@ const uint16 version = fileHeader.cwtv; if(version > 0x889 && file.Seek(mptStartPos)) { - std::istrstream iStrm(file.GetRawData(), file.BytesLeft()); + std::istringstream iStrm(std::string(file.GetRawData(), file.BytesLeft())); if(version >= 0x88D) { Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2013-04-24 13:53:05 UTC (rev 1963) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2013-04-24 16:17:21 UTC (rev 1964) @@ -1516,7 +1516,7 @@ size_t nSize = 0; if (LoadResource(MAKEINTRESOURCE(IDR_BUILTIN_TUNINGS), MPT_TEXT("TUNING"), pData, nSize, hglob) != nullptr) { - std::istrstream iStrm(pData, nSize); + std::istringstream iStrm(std::string(pData, nSize)); s_pTuningsSharedBuiltIn->Deserialize(iStrm); FreeResource(hglob); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |