aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorD G Turner2019-08-03 14:52:57 +0100
committerD G Turner2019-08-03 14:52:57 +0100
commit466b162996697850872832f98e2ffbb0a3e826e9 (patch)
tree2c1f939382056fcf0d2bd81bab966e8d34d7e609 /backends
parentd638c1d384cca8b1cf0d1678c6c4f27f8c98334e (diff)
downloadscummvm-rg350-466b162996697850872832f98e2ffbb0a3e826e9.tar.gz
scummvm-rg350-466b162996697850872832f98e2ffbb0a3e826e9.tar.bz2
scummvm-rg350-466b162996697850872832f98e2ffbb0a3e826e9.zip
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.
Diffstat (limited to 'backends')
-rw-r--r--backends/cloud/savessyncrequest.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/backends/cloud/savessyncrequest.cpp b/backends/cloud/savessyncrequest.cpp
index 3a581005c6..b906e5b5d6 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();