[openjk] 04/130: Remove original code of EnumerateFields

Simon McVittie smcv at debian.org
Fri Oct 28 11:09:10 UTC 2016


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian/master
in repository openjk.

commit 86a2f9ce19b13c056904312a3703b3030d30af05
Author: bibendovsky <bibendovsky at NOSTROMO>
Date:   Tue Jun 28 17:27:12 2016 +0300

    Remove original code of EnumerateFields
---
 codeJK2/game/g_savegame.cpp | 36 ++----------------------------------
 1 file changed, 2 insertions(+), 34 deletions(-)

diff --git a/codeJK2/game/g_savegame.cpp b/codeJK2/game/g_savegame.cpp
index 54a0d7e..aa07d28 100644
--- a/codeJK2/game/g_savegame.cpp
+++ b/codeJK2/game/g_savegame.cpp
@@ -442,37 +442,6 @@ void EnumerateField(const field_t *pField, byte *pbBase)
 	}
 }
 
-#if 0
-static void EnumerateFields(const field_t *pFields, byte *pbData, unsigned int ulChid, size_t iLen)
-{
-	strList = new std::list<sstring_t>;
-
-	// enumerate all the fields...
-	//
-	if (pFields)
-	{
-		for (const field_t *pField = pFields; pField->psName; pField++)
-		{
-			assert(pField->iOffset < iLen);
-			EnumerateField(pField, pbData);
-		}
-	}
-
-	// save out raw data...
-	//
-	::sg_write_no_cast(::gi, ulChid, pbData, static_cast<int>(iLen));
-
-	// save out any associated strings..
-	//
-	for (std::list<sstring_t>::iterator it = strList->begin(); it != strList->end(); ++it)
-	{
-		::sg_write_no_cast(::gi, INT_ID('S','T','R','G'), it->c_str(), static_cast<int>(it->length()+1));
-	}
-
-	delete strList;
-	strList = NULL;
-}
-#else
 template<typename T>
 static void EnumerateFields(const field_t *pFields, T* src_instance, unsigned int ulChid, size_t iLen)
 {
@@ -508,15 +477,14 @@ static void EnumerateFields(const field_t *pFields, T* src_instance, unsigned in
 
 	// save out any associated strings..
 	//
-	for (std::list<sstring_t>::iterator it = strList->begin(); it != strList->end(); ++it)
+	for (const auto& it : *strList)
 	{
-		::sg_write_no_cast(::gi, INT_ID('S','T','R','G'), it->c_str(), static_cast<int>(it->length()+1));
+		::sg_write_no_cast(::gi, INT_ID('S','T','R','G'), it.c_str(), static_cast<int>(it.length()+1));
 	}
 
 	delete strList;
 	strList = NULL;
 }
-#endif
 
 static void EvaluateField(const field_t *pField, byte *pbBase, byte *pbOriginalRefData/* may be NULL*/)
 {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/openjk.git



More information about the Pkg-games-commits mailing list