[Scummvm-git-logs] scummvm master -> 6812ba0bad404b6d3630293c06a807f64d567985

bluegr noreply at scummvm.org
Sun Jun 1 12:31:17 UTC 2025


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
3ec466620e SCI: Simplify SegmentObjTable initializaion
6812ba0bad SCI: Fix GCC warning


Commit: 3ec466620e8638e745712f906a1cd06d8fc3f4ec
    https://github.com/scummvm/scummvm/commit/3ec466620e8638e745712f906a1cd06d8fc3f4ec
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2025-06-01T15:31:13+03:00

Commit Message:
SCI: Simplify SegmentObjTable initializaion

Changed paths:
    engines/sci/engine/segment.h


diff --git a/engines/sci/engine/segment.h b/engines/sci/engine/segment.h
index 1ca13f38153..561c56261ee 100644
--- a/engines/sci/engine/segment.h
+++ b/engines/sci/engine/segment.h
@@ -239,15 +239,14 @@ struct SegmentObjTable : public SegmentObj {
 	};
 	enum { HEAPENTRY_INVALID = -1 };
 
-	int first_free; /**< Beginning of a singly linked list for entries */
-	int entries_used; /**< Statistical information */
+	int first_free = HEAPENTRY_INVALID; /**< Beginning of a singly linked list for entries */
+	int entries_used = 0; /**< Statistical information */
 
 	typedef Common::Array<Entry> ArrayType;
 	ArrayType _table;
 
 public:
 	SegmentObjTable(SegmentType type) : SegmentObj(type) {
-		initTable();
 	}
 
 	~SegmentObjTable() override {
@@ -258,12 +257,6 @@ public:
 		}
 	}
 
-	void initTable() {
-		entries_used = 0;
-		first_free = HEAPENTRY_INVALID;
-		_table.clear();
-	}
-
 	int allocEntry() {
 		entries_used++;
 		if (first_free != HEAPENTRY_INVALID) {


Commit: 6812ba0bad404b6d3630293c06a807f64d567985
    https://github.com/scummvm/scummvm/commit/6812ba0bad404b6d3630293c06a807f64d567985
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2025-06-01T15:31:13+03:00

Commit Message:
SCI: Fix GCC warning

Use default initialization for dummy.

In file included from engines/sci/engine/savegame.cpp:26:
In member function 'void Common::Serializer::syncAsUint16LE(T&, Version, Version) [with T = short unsigned int]',
    inlined from 'void Common::Serializer::syncAsUint16LE(T&, Version, Version) [with T = short unsigned int]' at common/serializer.h:120:2,
    inlined from 'void Sci::syncWithSerializer(Common::Serializer&, reg_t&)' at engines/sci/engine/savegame.cpp:77:18,
    inlined from 'void Sci::syncWithSerializer(Common::Serializer&, Node&)' at engines/sci/engine/savegame.cpp:96:20,
    inlined from 'void Sci::SegmentObjTableEntrySyncer<T>::operator()(Common::Serializer&, typename T::Entry&, int) const [with T = Sci::NodeTable]' at engines/sci/engine/savegame.cpp:136:23,
    inlined from 'void Sci::ArraySyncer<T, Syncer>::operator()(Common::Serializer&, Common::Array<T>&) const [with T = Sci::SegmentObjTable<Sci::Node>::Entry; Syncer = Sci::SegmentObjTableEntrySyncer<Sci::NodeTable>]' at engines/sci/engine/savegame.cpp:168:8,
    inlined from 'void Sci::syncArray(Common::Serializer&, Common::Array<T>&) [with T = SegmentObjTable<Node>::Entry; Syncer = SegmentObjTableEntrySyncer<NodeTable>]' at engines/sci/engine/savegame.cpp:183:6,
    inlined from 'void Sci::sync_Table(Common::Serializer&, T&) [with T = NodeTable]' at engines/sci/engine/savegame.cpp:499:62,
    inlined from 'virtual void Sci::NodeTable::saveLoadWithSerializer(Common::Serializer&)' at engines/sci/engine/savegame.cpp:507:23:
common/serializer.h:49:30: warning: 'dummy' may be used uninitialized [-Wmaybe-uninitialized]
   49 |                         TYPE tmp = val; \
      |                              ^~~
common/serializer.h:120:9: note: in expansion of macro 'SYNC_AS'
  120 |         SYNC_AS(Uint16LE, uint16, 2)
      |         ^~~~~~~

Changed paths:
    engines/sci/engine/savegame.cpp


diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index 763f964e4e1..763ad49083c 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -132,7 +132,7 @@ struct SegmentObjTableEntrySyncer : Common::BinaryFunction<Common::Serializer, t
 			syncWithSerializer(s, *entry.data);
 		} else if (s.isLoading()) {
 			if (s.getVersion() < 37) {
-				typename T::value_type dummy;
+				typename T::value_type dummy{};
 				syncWithSerializer(s, dummy);
 			}
 			entry.data = nullptr;




More information about the Scummvm-git-logs mailing list