From: <man...@us...> - 2013-10-24 13:19:29
|
Revision: 3008 http://sourceforge.net/p/modplug/code/3008 Author: manxorist Date: 2013-10-24 13:19:19 +0000 (Thu, 24 Oct 2013) Log Message: ----------- Merged revision(s) 2979 from branches/manx/serialization-utils-cleanup: [Ref] Remove completely unused serialization subentry code. ........ Modified Paths: -------------- trunk/OpenMPT/common/serialization_utils.cpp trunk/OpenMPT/common/serialization_utils.h Property Changed: ---------------- trunk/OpenMPT/ Index: trunk/OpenMPT =================================================================== --- trunk/OpenMPT 2013-10-24 13:14:25 UTC (rev 3007) +++ trunk/OpenMPT 2013-10-24 13:19:19 UTC (rev 3008) Property changes on: trunk/OpenMPT ___________________________________________________________________ Modified: svn:mergeinfo ## -11,7 +11,7 ## /branches/manx/profiler:1813 /branches/manx/project-files-cleanups:1378-1382 /branches/manx/sampleformat-ref:2554-2582 -/branches/manx/serialization-utils-cleanup:2382-2386,2395 +/branches/manx/serialization-utils-cleanup:2382-2386,2395,2979 /branches/manx/snddev:2780-2788 /branches/manx/snddev-fixes:1605-1713 /branches/manx/sounddev:2923-2934 \ No newline at end of property Modified: trunk/OpenMPT/common/serialization_utils.cpp =================================================================== --- trunk/OpenMPT/common/serialization_utils.cpp 2013-10-24 13:14:25 UTC (rev 3007) +++ trunk/OpenMPT/common/serialization_utils.cpp 2013-10-24 13:19:19 UTC (rev 3008) @@ -250,7 +250,6 @@ const char tstrEndOfMap[] = "End of map(rpos): %u\n"; const char tstrReadProgress[] = "Read entry: {num, id, rpos, size, desc} = {%u, %s, %u, %s, %s}\n"; const char tstrNoEntryFound[] = "No entry with id %s found.\n"; -const char tstrCantFindSubEntry[] = "Unable to find subentry with id=%s\n"; const char strReadNote[] = "Read note: "; @@ -272,8 +271,6 @@ m_nCounter(0), \ m_nNextReadHint(0), \ m_Flags(s_DefaultFlags), \ - m_pSubEntry(nullptr), \ - m_posSubEntryStart(0), \ m_nMapReserveSize(0), \ m_posEntrycount(0), \ m_posMapPosField(0), \ @@ -423,36 +420,6 @@ } -void Ssb::CreateWriteSubEntry() -//----------------------------- -{ - m_posSubEntryStart = m_pOstrm->tellp(); - delete m_pSubEntry; - m_pSubEntry = new Ssb(*m_pOstrm); - m_pSubEntry->m_fpLogFunc = m_fpLogFunc; -} - - -Ssb* Ssb::CreateReadSubEntry(const char* pId, const size_t nLength) -//----------------------------------------------------------------- -{ - const ReadEntry* pE = Find(pId, nLength); - if (pE && pE->rposStart != 0) - { - m_nCounter++; - delete m_pSubEntry; - m_pSubEntry = new Ssb(*m_pIstrm); - m_pSubEntry->m_fpLogFunc = m_fpLogFunc; - m_pIstrm->seekg(m_posStart + Postype(pE->rposStart)); - return m_pSubEntry; - } - else if (m_fpLogFunc) - m_fpLogFunc(tstrCantFindSubEntry, IdToString(pId, nLength).c_str()); - - return nullptr; -} - - void Ssb::IncrementWriteCounter() //------------------------------- { @@ -465,18 +432,6 @@ } -void Ssb::ReleaseWriteSubEntry(const char* pId, const size_t nIdLength) -//--------------------------------------------------------------------- -{ - if ((m_pSubEntry->m_Status & SNT_FAILURE) != 0) - m_Status |= SNW_SUBENTRY_FAILURE; - - delete m_pSubEntry; m_pSubEntry = nullptr; - WriteMapItem(pId, nIdLength, static_cast<RposType>(m_posSubEntryStart - m_posStart), static_cast<DataSize>(m_pOstrm->tellp() - m_posSubEntryStart), ""); - IncrementWriteCounter(); -} - - void Ssb::BeginWrite(const char* pId, const size_t nIdSize, const uint64& nVersion) //--------------------------------------------------------------------------------- { Modified: trunk/OpenMPT/common/serialization_utils.h =================================================================== --- trunk/OpenMPT/common/serialization_utils.h 2013-10-24 13:14:25 UTC (rev 3007) +++ trunk/OpenMPT/common/serialization_utils.h 2013-10-24 13:19:19 UTC (rev 3008) @@ -67,7 +67,6 @@ SNW_INSUFFICIENT_MAPSIZE = (0x12) | SNT_FAILURE, SNW_DATASIZETYPE_OVERFLOW = (0x13) | SNT_FAILURE, SNW_MAX_WRITE_COUNT_REACHED = (0x14) | SNT_FAILURE, - SNW_SUBENTRY_FAILURE = (0x15) | SNT_FAILURE, SNW_INSUFFICIENT_DATASIZETYPE = (0x16) | SNT_FAILURE }; @@ -284,7 +283,7 @@ Ssb(std::ostream& oStrm); Ssb(std::istream& iStrm); - ~Ssb() {delete m_pSubEntry;} + ~Ssb() {} // Sets map ID size in writing. void SetIdSize(uint16 idSize); @@ -300,24 +299,6 @@ // Reserves space for map to current position. Call after BeginWrite and before writing any entries. void ReserveMapSize(uint32 nSize); - // Creates subentry for writing. Use SubEntry() to access the subentry and - // when done, call ReleaseSubEntry. Don't call WriteItem() for 'this' while - // subentry is active. - void CreateWriteSubEntry(); - - // Returns current write/read subentry. CreateWriteSubEntry/CreateReadSubEntry - // must be called before calling this. - Ssb& SubEntry() {return *m_pSubEntry;} - - // Releases write subentry and writes corresponding map information. - void ReleaseWriteSubEntry(const char* pId, const size_t nIdLength); - void ReleaseWriteSubEntry(const char* pszId) {ReleaseWriteSubEntry(pszId, strlen(pszId));} - - // If ID was found, returns pointer to Ssb object, nullptr if not found. - // Note: All reading on subentry must be done before calling ReadItem with 'this'. - Ssb* CreateReadSubEntry(const char* pId, const size_t nLength); - Ssb* CreateReadSubEntry(const char* pszId) {return CreateReadSubEntry(pszId, strlen(pszId));} - // After calling BeginRead(), this returns number of entries in the file. NumType GetNumEntries() const {return m_nReadEntrycount;} @@ -453,8 +434,6 @@ NumType m_nNextReadHint; // Read: Hint where to start looking for the next read entry. std::bitset<RwfNumFlags> m_Flags; // Read/write: Various flags. - Ssb* m_pSubEntry; // Read/Write: Pointer to SubEntry. - Postype m_posSubEntryStart; // Write: Holds data position where SubEntry started. uint32 m_nMapReserveSize; // Write: Number of bytes to reserve for map if writing it before data. Postype m_posEntrycount; // Write: Pos of entrycount field. Postype m_posMapPosField; // Write: Pos of map position field. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |