[Scummvm-git-logs] scummvm master -> 5b155fc8078ff32815d1b352174097f2205ad299

dreammaster noreply at scummvm.org
Mon Feb 27 06:37:04 UTC 2023


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:
5b155fc807 MM: MM1: Fix Coverity warnings


Commit: 5b155fc8078ff32815d1b352174097f2205ad299
    https://github.com/scummvm/scummvm/commit/5b155fc8078ff32815d1b352174097f2205ad299
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2023-02-26T22:36:52-08:00

Commit Message:
MM: MM1: Fix Coverity warnings

Changed paths:
    engines/mm/mm1/views_enh/game_messages.cpp
    engines/mm/mm1/views_enh/text_view.cpp


diff --git a/engines/mm/mm1/views_enh/game_messages.cpp b/engines/mm/mm1/views_enh/game_messages.cpp
index f25985d8eef..89d94dc4e65 100644
--- a/engines/mm/mm1/views_enh/game_messages.cpp
+++ b/engines/mm/mm1/views_enh/game_messages.cpp
@@ -78,7 +78,7 @@ bool GameMessages::msgInfo(const InfoMessage &msg) {
 
 	// Process the lines
 	clear();
-	for (auto line : msg._lines)
+	for (const auto &line : msg._lines)
 		addText(line._text, line.y, 0,
 			(line.x > 0) ? ALIGN_MIDDLE : line._align, 0);
 
diff --git a/engines/mm/mm1/views_enh/text_view.cpp b/engines/mm/mm1/views_enh/text_view.cpp
index 51556322655..e82773c48d0 100644
--- a/engines/mm/mm1/views_enh/text_view.cpp
+++ b/engines/mm/mm1/views_enh/text_view.cpp
@@ -128,7 +128,7 @@ void TextView::writeString(const Common::String &str, TextAlign align) {
 	Common::StringArray lines = splitLines(str, lineWidth);
 
 	int xStart = _textPos.x;
-	for (auto line : lines) {
+	for (const auto &line : lines) {
 		if (line != lines.front()) {
 			newLine();
 			_textPos.x = xStart;




More information about the Scummvm-git-logs mailing list