summaryrefslogtreecommitdiff
path: root/include/tools
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-09-10 18:04:04 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-09-11 13:48:55 +0200
commit3b835b8d546ca16d7edcb06eda017e276383ea0f (patch)
tree4d691d7d4fb2756735da020cece19ee1171d9a85 /include/tools
parent3d39dad6d93c979ac64244ecb9acfbd8a5fbd6c6 (diff)
Use [[nodiscard]] in SAL_WARN_UNUSED_RESULT where available
...which required some lax placements of SAL_WARN_UNUSED_RESULT to be fixed. Also, Clang unfortunately is rather picky about the relative order of SAL_WARN_UNUSED_RESULT expanding to [[nodiscard]] and uses of the DLLPUBLIC macros (expanding to __attribute__(...) resp. __declspec(..) for clang-cl). Change-Id: Iae6ca36bef97f1864873aefdb5f05c7f5e045ad3 Reviewed-on: https://gerrit.libreoffice.org/60274 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'include/tools')
-rw-r--r--include/tools/helpers.hxx4
-rw-r--r--include/tools/stream.hxx2
2 files changed, 3 insertions, 3 deletions
diff --git a/include/tools/helpers.hxx b/include/tools/helpers.hxx
index 1e88e5725af4..2ce550c42e03 100644
--- a/include/tools/helpers.hxx
+++ b/include/tools/helpers.hxx
@@ -78,7 +78,7 @@ inline long FRound( double fVal )
//valid range: (-180,180]
template <typename T>
-inline SAL_WARN_UNUSED_RESULT typename std::enable_if<std::is_signed<T>::value, T>::type
+SAL_WARN_UNUSED_RESULT inline typename std::enable_if<std::is_signed<T>::value, T>::type
NormAngle180(T angle)
{
while (angle <= -180)
@@ -89,7 +89,7 @@ NormAngle180(T angle)
}
//valid range: [0,360)
-template <typename T> inline SAL_WARN_UNUSED_RESULT T NormAngle360(T angle)
+template <typename T> SAL_WARN_UNUSED_RESULT inline T NormAngle360(T angle)
{
while (angle < 0)
angle += 360;
diff --git a/include/tools/stream.hxx b/include/tools/stream.hxx
index 9b28c6a46f65..ce6db9ac4217 100644
--- a/include/tools/stream.hxx
+++ b/include/tools/stream.hxx
@@ -577,7 +577,7 @@ inline std::size_t write_uInt16_lenPrefixed_uInt8s_FromOUString(SvStream& rStrm,
return write_uInt16_lenPrefixed_uInt8s_FromOString(rStrm, OUStringToOString(rStr, eEnc));
}
-TOOLS_DLLPUBLIC bool checkSeek(SvStream &rSt, sal_uInt64 nOffset) SAL_WARN_UNUSED_RESULT;
+SAL_WARN_UNUSED_RESULT TOOLS_DLLPUBLIC bool checkSeek(SvStream &rSt, sal_uInt64 nOffset);
// FileStream