[Scummvm-git-logs] scummvm master -> 18ff31bc929f8c0c162edbae7aaca1670e95dd02

eriktorbjorn noreply at scummvm.org
Fri Feb 9 17:55:09 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:
18ff31bc92 COMMON: Flag some Path functions as WARN_UNUSED_RESULT


Commit: 18ff31bc929f8c0c162edbae7aaca1670e95dd02
    https://github.com/scummvm/scummvm/commit/18ff31bc929f8c0c162edbae7aaca1670e95dd02
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-02-09T18:54:54+01:00

Commit Message:
COMMON: Flag some Path functions as WARN_UNUSED_RESULT

This would have caught the recent Hopkins regression. It also warns
about a few other things at the moment, so that has to be looked into at
some point.

Changed paths:
    common/path.h


diff --git a/common/path.h b/common/path.h
index 7002656ad1e..05e95d336e1 100644
--- a/common/path.h
+++ b/common/path.h
@@ -397,19 +397,19 @@ public:
 	 * Returns this path with the given path appended (out-of-place).
 	 * Does not automatically add a directory separator.
 	 */
-	Path append(const Path &x) const {
+	WARN_UNUSED_RESULT Path append(const Path &x) const {
 		Path temp(*this);
 		temp.appendInPlace(x);
 		return temp;
 	}
 
 	/** @overload */
-	Path append(const String &str, char separator = '/') const {
+	WARN_UNUSED_RESULT Path append(const String &str, char separator = '/') const {
 		return append(str.c_str(), separator);
 	}
 
 	/** @overload */
-	Path append(const char *str, char separator = '/') const {
+	WARN_UNUSED_RESULT Path append(const char *str, char separator = '/') const {
 		Path temp(*this);
 		temp.appendInPlace(str, separator);
 		return temp;
@@ -419,10 +419,10 @@ public:
 	 * Appends exactly one component, without any separators
 	 * and prepends a separator if necessarry
 	 */
-	Path appendComponent(const char *str) const;
+	WARN_UNUSED_RESULT Path appendComponent(const char *str) const;
 
 	/** @overload */
-	Path appendComponent(const String &x) const {
+	WARN_UNUSED_RESULT Path appendComponent(const String &x) const {
 		return appendComponent(x.c_str());
 	}
 
@@ -444,19 +444,19 @@ public:
 	 * Returns this path joined with the given path (out-of-place).
 	 * Automatically adds a directory separator.
 	 */
-	Path join(const Path &x) const {
+	WARN_UNUSED_RESULT Path join(const Path &x) const {
 		Path temp(*this);
 		temp.joinInPlace(x);
 		return temp;
 	}
 
 	/** @overload */
-	Path join(const String &str, char separator = '/') const {
+	WARN_UNUSED_RESULT Path join(const String &str, char separator = '/') const {
 		return join(str.c_str(), separator);
 	}
 
 	/** @overload */
-	Path join(const char *str, char separator = '/') const {
+	WARN_UNUSED_RESULT Path join(const char *str, char separator = '/') const {
 		Path temp(*this);
 		temp.joinInPlace(str, separator);
 		return temp;




More information about the Scummvm-git-logs mailing list