This is an automated email from the git hooks/post-receive script. smcv pushed a commit to branch debian/master in repository openjk.
commit 1911228834f22a40e0292d8a6282a46406f54df7 Author: bibendovsky <[email protected]> Date: Mon Jul 4 23:09:02 2016 +0300 Add return value to read_chunk and write_chunk --- shared/qcommon/ojk_sg_archive.cpp | 16 +++++++++------- shared/qcommon/ojk_sg_archive.h | 20 ++++++++++++-------- shared/qcommon/ojk_sg_archive_fwd.h | 15 +++++++++------ 3 files changed, 30 insertions(+), 21 deletions(-) diff --git a/shared/qcommon/ojk_sg_archive.cpp b/shared/qcommon/ojk_sg_archive.cpp index 0311e01..2446717 100644 --- a/shared/qcommon/ojk_sg_archive.cpp +++ b/shared/qcommon/ojk_sg_archive.cpp @@ -11,7 +11,9 @@ namespace sg { Archive::Archive() : file_handle_(), io_buffer_(), - io_buffer_offset_() + io_buffer_offset_(), + rle_buffer_(), + is_testing_read_chunk_() { } @@ -51,9 +53,9 @@ bool Archive::open( int sg_version = -1; if (is_succeed) { - read_chunk<int32_t>( + static_cast<void>(read_chunk<int32_t>( INT_ID('_', 'V', 'E', 'R'), - sg_version); + sg_version)); if (sg_version != iSAVEGAME_VERSION) { is_succeed = false; @@ -99,9 +101,9 @@ bool Archive::create( int sg_version = iSAVEGAME_VERSION; - write_chunk<int32_t>( + static_cast<void>(write_chunk<int32_t>( INT_ID('_', 'V', 'E', 'R'), - sg_version); + sg_version)); return true; } @@ -117,14 +119,14 @@ void Archive::close() io_buffer_offset_ = 0; } -void Archive::read_chunk( +bool Archive::read_chunk( const Archive::ChunkId chunk_id) { throw ArchiveException( "Not implemented."); } -void Archive::write_chunk( +bool Archive::write_chunk( const Archive::ChunkId chunk_id) { throw ArchiveException( diff --git a/shared/qcommon/ojk_sg_archive.h b/shared/qcommon/ojk_sg_archive.h index d18ac03..a9aa961 100644 --- a/shared/qcommon/ojk_sg_archive.h +++ b/shared/qcommon/ojk_sg_archive.h @@ -82,29 +82,33 @@ void Archive::advance_io_buffer( // read_chunk template<typename TSrc, typename TDst> -void Archive::read_chunk( +bool Archive::read_chunk( const ChunkId chunk_id, TDst& dst_value) { - read_chunk( + auto result = read_chunk( chunk_id); read<TSrc>( dst_value); + + return result; } template<typename TSrc, typename TDst> -void Archive::read_chunk( +bool Archive::read_chunk( const ChunkId chunk_id, TDst* dst_values, int dst_count) { - read_chunk( + auto result = read_chunk( chunk_id); read<TSrc>( dst_values, dst_count); + + return result; } // read_chunk @@ -115,7 +119,7 @@ void Archive::read_chunk( // write_chunk template<typename TDst, typename TSrc> -void Archive::write_chunk( +bool Archive::write_chunk( const ChunkId chunk_id, const TSrc& src_value) { @@ -124,12 +128,12 @@ void Archive::write_chunk( write<TDst>( src_value); - write_chunk( + return write_chunk( chunk_id); } template<typename TDst, typename TSrc> -void Archive::write_chunk( +bool Archive::write_chunk( const ChunkId chunk_id, const TSrc* src_values, int src_count) @@ -140,7 +144,7 @@ void Archive::write_chunk( src_values, src_count); - write_chunk( + return write_chunk( chunk_id); } diff --git a/shared/qcommon/ojk_sg_archive_fwd.h b/shared/qcommon/ojk_sg_archive_fwd.h index 99ae628..03868fd 100644 --- a/shared/qcommon/ojk_sg_archive_fwd.h +++ b/shared/qcommon/ojk_sg_archive_fwd.h @@ -48,40 +48,40 @@ public: // Reads a chunk from the file into the internal buffer. - void read_chunk( + bool read_chunk( const ChunkId chunk_id); // Reads a value or an array of values from the file via // the internal buffer. template<typename TSrc = void, typename TDst = void> - void read_chunk( + bool read_chunk( const ChunkId chunk_id, TDst& dst_value); // Reads an array of values with specified count from // the file via the internal buffer. template<typename TSrc = void, typename TDst = void> - void read_chunk( + bool read_chunk( const ChunkId chunk_id, TDst* dst_values, int dst_count); // Writes a chunk into the file from the internal buffer. - void write_chunk( + bool write_chunk( const ChunkId chunk_id); // Writes a value or an array of values into the file via // the internal buffer. template<typename TDst = void, typename TSrc = void> - void write_chunk( + bool write_chunk( const ChunkId chunk_id, const TSrc& src_value); // Writes an array of values with specified count into // the file via the internal buffer. template<typename TDst = void, typename TSrc = void> - void write_chunk( + bool write_chunk( const ChunkId chunk_id, const TSrc* src_values, int src_count); @@ -152,6 +152,9 @@ private: // RLE codec buffer. Buffer rle_buffer_; + // Does not throws an exception on chunk reading if true. + bool is_testing_read_chunk_; + // Compresses I/O buffer into RLE one. // Returns a size of compressed data. -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/openjk.git _______________________________________________ Pkg-games-commits mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-games-commits

