[Scummvm-git-logs] scummvm master -> 74af7cacb5fca27d1deff9e38cd615f233b9b260

digitall noreply at scummvm.org
Fri Aug 23 22:44:46 UTC 2024


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

Summary:
74af7cacb5 QDENGINE: Fix Various GCC Compiler Warnings


Commit: 74af7cacb5fca27d1deff9e38cd615f233b9b260
    https://github.com/scummvm/scummvm/commit/74af7cacb5fca27d1deff9e38cd615f233b9b260
Author: D G Turner (digitall at scummvm.org)
Date: 2024-08-23T23:44:28+01:00

Commit Message:
QDENGINE: Fix Various GCC Compiler Warnings

Changed paths:
    engines/qdengine/parser/qdscr_parser.cpp
    engines/qdengine/qdcore/qd_game_object_animated.cpp
    engines/qdengine/qdcore/qd_game_object_moving.cpp
    engines/qdengine/qdcore/qd_interface_save.cpp
    engines/qdengine/qdcore/qd_sound.cpp
    engines/qdengine/qdcore/util/ResourceDispatcher.h


diff --git a/engines/qdengine/parser/qdscr_parser.cpp b/engines/qdengine/parser/qdscr_parser.cpp
index 09165e9604b..5eef375e7d9 100644
--- a/engines/qdengine/parser/qdscr_parser.cpp
+++ b/engines/qdengine/parser/qdscr_parser.cpp
@@ -337,7 +337,7 @@ const char *qdscr_XML_string(const char *p) {
 
 	conv_str = p;
 
-	int pos = Common::String::npos;
+	uint32 pos = Common::String::npos;
 	do {
 		pos = conv_str.find("&", pos + 1);
 		if (pos != Common::String::npos)
diff --git a/engines/qdengine/qdcore/qd_game_object_animated.cpp b/engines/qdengine/qdcore/qd_game_object_animated.cpp
index f18d8155955..1c2636a4d56 100644
--- a/engines/qdengine/qdcore/qd_game_object_animated.cpp
+++ b/engines/qdengine/qdcore/qd_game_object_animated.cpp
@@ -1165,7 +1165,7 @@ bool qdGameObjectAnimated::handle_state_end() {
 	}
 
 	if (sp->check_flag(qdGameObjectState::QD_OBJ_STATE_FLAG_MOVE_TO_INVENTORY) && !sp->check_flag(qdGameObjectState::QD_OBJ_STATE_FLAG_MOVE_TO_INVENTORY_FAILED)) {
-		if (qdGameObjectState * p = get_inventory_state()) {
+		if (/*qdGameObjectState * p = */get_inventory_state()) {
 			qdGameDispatcher *gp = qd_get_game_dispatcher();
 			if (!gp || !gp->put_to_inventory(this))
 				sp->set_flag(qdGameObjectState::QD_OBJ_STATE_FLAG_MOVE_TO_INVENTORY_FAILED);
diff --git a/engines/qdengine/qdcore/qd_game_object_moving.cpp b/engines/qdengine/qdcore/qd_game_object_moving.cpp
index 56780af4f9c..f774f9865d4 100644
--- a/engines/qdengine/qdcore/qd_game_object_moving.cpp
+++ b/engines/qdengine/qdcore/qd_game_object_moving.cpp
@@ -1979,7 +1979,7 @@ bool qdGameObjectMoving::set_walk_animation() {
 		switch (_movement_mode) {
 		case MOVEMENT_MODE_TURN:
 			if (qdAnimationSet * set = wst->animation_set()) {
-				if (qdAnimation * anm = set->get_turn_animation()) {
+				if (/*qdAnimation * anm = */set->get_turn_animation()) {
 					set_animation_info(set->get_turn_animation_info());
 					get_animation()->set_time_rel(cycleAngle(_direction_angle) / (2.f * M_PI));
 					set_flag(QD_OBJ_MOVING_FLAG);
@@ -2618,10 +2618,7 @@ const qdGameObjectStateWalk *qdGameObjectMoving::current_walk_state() const {
 	const qdGameObjectState *st = get_cur_state();
 	if (!st || st->state_type() != qdGameObjectState::STATE_WALK) {
 		st = _last_walk_state;
-		if (!st || st->state_type() != qdGameObjectState::STATE_WALK)
-			st = get_default_state();
-		else
-			st = get_default_state();
+		st = get_default_state();
 		if (!st) st = get_state(0);
 	}
 
diff --git a/engines/qdengine/qdcore/qd_interface_save.cpp b/engines/qdengine/qdcore/qd_interface_save.cpp
index 4c16d5fab86..a3abcedee2f 100644
--- a/engines/qdengine/qdcore/qd_interface_save.cpp
+++ b/engines/qdengine/qdcore/qd_interface_save.cpp
@@ -102,7 +102,7 @@ bool qdInterfaceSave::mouse_handler(int x, int y, mouseDispatcher::mouseEvent ev
 	switch (ev) {
 	case mouseDispatcher::EV_LEFT_DOWN:
 	case mouseDispatcher::EV_RIGHT_DOWN:
-		if (qdGameDispatcher *dp = qdGameDispatcher::get_dispatcher()) {
+		if (/*qdGameDispatcher *dp = */qdGameDispatcher::get_dispatcher()) {
 			debugC(1, kDebugSave, "qdInterfaceSave::mouse_handler(): _save_mode = %d", _save_mode);
 			clear_screen_region();
 
diff --git a/engines/qdengine/qdcore/qd_sound.cpp b/engines/qdengine/qdcore/qd_sound.cpp
index 435e76e7e4f..7d98f7905e6 100644
--- a/engines/qdengine/qdcore/qd_sound.cpp
+++ b/engines/qdengine/qdcore/qd_sound.cpp
@@ -100,11 +100,11 @@ bool qdSound::save_script(Common::WriteStream &fh, int indent) const {
 
 bool qdSound::play(const qdSoundHandle *handle, bool loop) const {
 	if (handle && handle->owner()) {
-		debugCN(3, kDebugSound, "[%d] sound start %p owner: %s", g_system->getMillis(), (void *)this, handle->owner()->toString().c_str());
+		debugCN(3, kDebugSound, "[%d] sound start %p owner: %s", g_system->getMillis(), (const void *)this, handle->owner()->toString().c_str());
 
 		if (loop)
 			debugCN(3, kDebugSound, " cycled");
-		debugC(3, kDebugSound, "");
+		debugC(3, kDebugSound, "%s", "");
 	}
 
 	if (sndDispatcher *p = sndDispatcher::get_dispatcher()) {
@@ -116,7 +116,7 @@ bool qdSound::play(const qdSoundHandle *handle, bool loop) const {
 }
 
 bool qdSound::stop(const qdSoundHandle *handle) const {
-	debugC(3, kDebugSound, "[%d] sound stop %p owner: %s", g_system->getMillis(), (void *)this, handle->owner()->toString().c_str());
+	debugC(3, kDebugSound, "[%d] sound stop %p owner: %s", g_system->getMillis(), (const void *)this, handle->owner()->toString().c_str());
 	if (sndDispatcher *p = sndDispatcher::get_dispatcher()) {
 		if (!handle) {
 			sndSound sound(&_sound);
diff --git a/engines/qdengine/qdcore/util/ResourceDispatcher.h b/engines/qdengine/qdcore/util/ResourceDispatcher.h
index 29dddc4da31..052234a3f4f 100644
--- a/engines/qdengine/qdcore/util/ResourceDispatcher.h
+++ b/engines/qdengine/qdcore/util/ResourceDispatcher.h
@@ -63,8 +63,8 @@ class VoidFunctionCallResourceUser : public ResourceUser {
 public:
 	typedef void (*type)();
 
-	VoidFunctionCallResourceUser(type func_, time_type dtime) :
-		ResourceUser(dtime), func(func_) {}
+	VoidFunctionCallResourceUser(type func_, time_type dtime_) :
+		ResourceUser(dtime_), func(func_) {}
 	virtual ~VoidFunctionCallResourceUser() {}
 	int quant() {
 		func();
@@ -80,8 +80,8 @@ class MemberFunctionCallResourceUser : public ResourceUser {
 public:
 	typedef void (T::*type)();
 
-	MemberFunctionCallResourceUser(T &object_, type func_, time_type dtime) :
-		ResourceUser(dtime), object(object_), func(func_) {}
+	MemberFunctionCallResourceUser(T &object_, type func_, time_type dtime_) :
+		ResourceUser(dtime_), object(object_), func(func_) {}
 	virtual ~MemberFunctionCallResourceUser() {}
 	int quant() {
 		(object.*func)();




More information about the Scummvm-git-logs mailing list