[openjk] 43/130: Fix pointer reading/writing

Simon McVittie smcv at debian.org
Fri Oct 28 11:09:16 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 33ca62565fd349cbfac06ca7363c20b8967bb3a3
Author: bibendovsky <bibendovsky at hotmail.com>
Date:   Sun Jul 17 17:34:32 2016 +0300

    Fix pointer reading/writing
---
 codeJK2/game/CMakeLists.txt           | 1 -
 shared/qcommon/ojk_i_saved_game.h     | 2 +-
 shared/qcommon/ojk_i_saved_game_fwd.h | 4 ++--
 shared/qcommon/ojk_saved_game.cpp     | 6 +++---
 shared/qcommon/ojk_saved_game.h       | 2 +-
 5 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/codeJK2/game/CMakeLists.txt b/codeJK2/game/CMakeLists.txt
index f471406..faf204b 100644
--- a/codeJK2/game/CMakeLists.txt
+++ b/codeJK2/game/CMakeLists.txt
@@ -26,7 +26,6 @@ set(JK2SPGameDefines ${SharedDefines} "JK2_MODE" "SP_GAME")
 set(JK2SPGameIncludeDirectories
 	"${JK2SPDir}"
 	"${JK2SPDir}/game"
-	"${SPDir}"
 	"${SharedDir}"
 	"${GSLIncludeDirectory}"
 	)
diff --git a/shared/qcommon/ojk_i_saved_game.h b/shared/qcommon/ojk_i_saved_game.h
index 04b5353..fc246f8 100644
--- a/shared/qcommon/ojk_i_saved_game.h
+++ b/shared/qcommon/ojk_i_saved_game.h
@@ -186,7 +186,7 @@ void ISavedGame::read(
 
 template<typename TSrc, typename TDst>
 void ISavedGame::read(
-    TDst* dst_value,
+    TDst*& dst_value,
     PointerTag)
 {
     static_assert(
diff --git a/shared/qcommon/ojk_i_saved_game_fwd.h b/shared/qcommon/ojk_i_saved_game_fwd.h
index 1a989c1..3573f3b 100644
--- a/shared/qcommon/ojk_i_saved_game_fwd.h
+++ b/shared/qcommon/ojk_i_saved_game_fwd.h
@@ -117,7 +117,7 @@ public:
 
 
     // Increments buffer's offset by the specified non-negative count.
-    virtual void advance_buffer(
+    virtual void skip(
         int count) = 0;
 
 
@@ -153,7 +153,7 @@ protected:
 
     template<typename TSrc, typename TDst>
     void read(
-        TDst* dst_value,
+        TDst*& dst_value,
         PointerTag);
 
     template<typename TSrc, typename TDst>
diff --git a/shared/qcommon/ojk_saved_game.cpp b/shared/qcommon/ojk_saved_game.cpp
index 5ceeab7..936c80b 100644
--- a/shared/qcommon/ojk_saved_game.cpp
+++ b/shared/qcommon/ojk_saved_game.cpp
@@ -510,7 +510,7 @@ void SavedGame::set_preview_mode(
     is_preview_mode_ = value;
 }
 
-void SavedGame::advance_buffer(
+void SavedGame::skip(
     int count)
 {
     if (!is_readable_ && !is_writable_)
@@ -542,8 +542,6 @@ void SavedGame::advance_buffer(
         }
         else if (is_writable_)
         {
-            io_buffer_offset_ = new_offset;
-
             if (new_offset > buffer_size)
             {
                 io_buffer_.resize(
@@ -551,6 +549,8 @@ void SavedGame::advance_buffer(
             }
         }
     }
+
+    io_buffer_offset_ = new_offset;
 }
 
 const SavedGame::Buffer& SavedGame::get_buffer() const
diff --git a/shared/qcommon/ojk_saved_game.h b/shared/qcommon/ojk_saved_game.h
index d0ece43..a91515c 100644
--- a/shared/qcommon/ojk_saved_game.h
+++ b/shared/qcommon/ojk_saved_game.h
@@ -92,7 +92,7 @@ public:
         bool value);
 
     // Increments buffer's offset by the specified non-negative count.
-    void advance_buffer(
+    void skip(
         int count) override;
 
     // Returns an I/O buffer.

-- 
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