[Scummvm-git-logs] scummvm master -> 466b162996697850872832f98e2ffbb0a3e826e9

digitall dgturner at iee.org
Sat Aug 3 15:57:47 CEST 2019


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:
466b162996 CLOUD: Fix GCC Compilation Warning in Debug Code.


Commit: 466b162996697850872832f98e2ffbb0a3e826e9
    https://github.com/scummvm/scummvm/commit/466b162996697850872832f98e2ffbb0a3e826e9
Author: D G Turner (digitall at scummvm.org)
Date: 2019-08-03T14:52:57+01:00

Commit Message:
CLOUD: Fix GCC Compilation Warning in Debug Code.

The warning emitted here was due to debug() call with an empty format
string, so this could have been fixed by replacing this with "%s", "".

However, this change should be better since it avoids the duplication
of the number of file check over several lines and reduces the string
duplication i.e. DRY improvements.

Changed paths:
    backends/cloud/savessyncrequest.cpp


diff --git a/backends/cloud/savessyncrequest.cpp b/backends/cloud/savessyncrequest.cpp
index 3a58100..b906e5b 100644
--- a/backends/cloud/savessyncrequest.cpp
+++ b/backends/cloud/savessyncrequest.cpp
@@ -137,14 +137,24 @@ void SavesSyncRequest::directoryListedCallback(Storage::ListDirectoryResponse re
 		}
 	}
 
-	debug(9, (_filesToDownload.size() > 0 ? "\nSavesSyncRequest: download files:" : "\nSavesSyncRequest: nothing to download"));
-	for (uint32 i = 0; i < _filesToDownload.size(); ++i) {
-		debug(9, " %s", _filesToDownload[i].name().c_str());
+	debug(9, "\nSavesSyncRequest: ");
+	if (_filesToDownload.size() > 0) {
+		debug(9, "nothing to download");
+	} else {
+		debug(9, "download files:");
+		for (uint32 i = 0; i < _filesToDownload.size(); ++i) {
+			debug(9, " %s", _filesToDownload[i].name().c_str());
+		}
+		debug(9, "%s", "");
 	}
-	if (_filesToDownload.size() > 0) debug(9, "");
-	debug(9, (_filesToUpload.size() > 0 ? "SavesSyncRequest: upload files:" : "SavesSyncRequest: nothing to upload"));
-	for (uint32 i = 0; i < _filesToUpload.size(); ++i) {
-		debug(9, " %s", _filesToUpload[i].c_str());
+	debug(9, "SavesSyncRequest: ");
+	if (_filesToUpload.size() > 0) {
+		debug(9, "nothing to upload");
+	} else {
+		debug(9, "upload files:");
+		for (uint32 i = 0; i < _filesToUpload.size(); ++i) {
+			debug(9, " %s", _filesToUpload[i].c_str());
+		}
 	}
 	_totalFilesToHandle = _filesToDownload.size() + _filesToUpload.size();
 





More information about the Scummvm-git-logs mailing list