From 4ff0e7e0a23ed34bd3603cd03ac59c945cc1a21d Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 12 Aug 2014 14:03:04 +0200 Subject: [PATCH] Silent some warnings --- csync/src/csync_exclude.c | 5 ++++- csync/src/csync_util.c | 4 +++- src/mirall/folder.cpp | 2 +- src/mirall/utility.cpp | 1 + 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/csync/src/csync_exclude.c b/csync/src/csync_exclude.c index 25cd060e0..299ae8bc5 100644 --- a/csync/src/csync_exclude.c +++ b/csync/src/csync_exclude.c @@ -208,7 +208,10 @@ CSYNC_EXCLUDE_TYPE csync_excluded(CSYNC *ctx, const char *path, int filetype) { } if (getenv("CSYNC_CONFLICT_FILE_USERNAME")) { - asprintf(&conflict, "*_conflict_%s-*", getenv("CSYNC_CONFLICT_FILE_USERNAME")); + rc = asprintf(&conflict, "*_conflict_%s-*", getenv("CSYNC_CONFLICT_FILE_USERNAME")); + if (rc < 0) { + goto out; + } rc = csync_fnmatch(conflict, path, 0); if (rc == 0) { match = CSYNC_FILE_SILENTLY_EXCLUDED; diff --git a/csync/src/csync_util.c b/csync/src/csync_util.c index ff18c3e58..c73538ac2 100644 --- a/csync/src/csync_util.c +++ b/csync/src/csync_util.c @@ -140,7 +140,9 @@ bool csync_file_locked_or_open( const char *dir, const char *fname) { if (!csync_file_locked_or_open_ext) { return false; } - asprintf(&tmp_uri, "%s/%s", dir, fname); + if (asprintf(&tmp_uri, "%s/%s", dir, fname) < 0) { + return -1; + } CSYNC_LOG(CSYNC_LOG_PRIORITY_DEBUG, "csync_file_locked_or_open %s", tmp_uri); ret = csync_file_locked_or_open_ext(tmp_uri); SAFE_FREE(tmp_uri); diff --git a/src/mirall/folder.cpp b/src/mirall/folder.cpp index 7e78fdeb7..0b5948521 100644 --- a/src/mirall/folder.cpp +++ b/src/mirall/folder.cpp @@ -711,7 +711,7 @@ void Folder::slotJobCompleted(const SyncFileItem &item) } -void Folder::slotAboutToRemoveAllFiles(SyncFileItem::Direction direction, bool *cancel) +void Folder::slotAboutToRemoveAllFiles(SyncFileItem::Direction, bool *cancel) { QString msg = tr("This sync would remove all the files in the sync folder '%1'.\n" diff --git a/src/mirall/utility.cpp b/src/mirall/utility.cpp index 9b47c8920..09f9c7544 100644 --- a/src/mirall/utility.cpp +++ b/src/mirall/utility.cpp @@ -367,6 +367,7 @@ void Utility::winShellChangeNotify( const QString& path ) SHChangeNotify(SHCNE_UPDATEITEM, SHCNF_PATH | SHCNF_FLUSHNOWAIT, reinterpret_cast(QDir::toNativeSeparators(path).utf16()), NULL ); #else + Q_UNUSED(path); qDebug() << Q_FUNC_INFO << " is not implemented on non Windows systems."; #endif }