summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-10-09 10:28:48 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-10-09 14:47:17 +0200
commit7ceee0f1ec0e349d0df4980d7fdedbd13c7917c5 (patch)
tree616ab419fe0f01e94740de7faacb393775420589 /tools
parent664db0d945fbb23e115eeea8377e3a4e88541da1 (diff)
Extend loplugin:redundantinline to catch inline functions w/o external linkage
...where "inline" (in its meaning of "this function can be defined in multiple translation units") thus doesn't make much sense. (As discussed in compilerplugins/clang/redundantinline.cxx, exempt such "static inline" functions in include files for now.) All the rewriting has been done automatically by the plugin, except for one instance in sw/source/ui/frmdlg/column.cxx that used to involve an #if), plus some subsequent solenv/clang-format/reformat-formatted-files. Change-Id: Ib8b996b651aeafc03bbdc8890faa05ed50517224 Reviewed-on: https://gerrit.libreoffice.org/61573 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/source/datetime/tdate.cxx6
-rw-r--r--tools/source/fsys/urlobj.cxx2
-rw-r--r--tools/source/generic/poly.cxx2
-rw-r--r--tools/source/inet/inetmime.cxx12
-rw-r--r--tools/source/stream/stream.cxx16
5 files changed, 19 insertions, 19 deletions
diff --git a/tools/source/datetime/tdate.cxx b/tools/source/datetime/tdate.cxx
index b53072590585..a5f26b912254 100644
--- a/tools/source/datetime/tdate.cxx
+++ b/tools/source/datetime/tdate.cxx
@@ -49,7 +49,7 @@ const sal_Int16 kYearMin = SAL_MIN_INT16;
// Days until start of year from zero, so month and day of month can be added.
// year 1 => 0 days, year 2 => 365 days, ...
// year -1 => -366 days, year -2 => -731 days, ...
-inline sal_Int32 ImpYearToDays( sal_Int16 nYear )
+sal_Int32 ImpYearToDays( sal_Int16 nYear )
{
assert( nYear != 0 );
sal_Int32 nOffset;
@@ -67,7 +67,7 @@ inline sal_Int32 ImpYearToDays( sal_Int16 nYear )
return nOffset + nYr*365 + nYr/4 - nYr/100 + nYr/400;
}
-inline bool ImpIsLeapYear( sal_Int16 nYear )
+bool ImpIsLeapYear( sal_Int16 nYear )
{
// Leap years BCE are -1, -5, -9, ...
// See
@@ -81,7 +81,7 @@ inline bool ImpIsLeapYear( sal_Int16 nYear )
}
// All callers must have sanitized or normalized month and year values!
-inline sal_uInt16 ImplDaysInMonth( sal_uInt16 nMonth, sal_Int16 nYear )
+sal_uInt16 ImplDaysInMonth( sal_uInt16 nMonth, sal_Int16 nYear )
{
if ( nMonth != 2 )
return aDaysInMonth[nMonth-1];
diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx
index 6a53e29d9d03..2abdfff07b05 100644
--- a/tools/source/fsys/urlobj.cxx
+++ b/tools/source/fsys/urlobj.cxx
@@ -552,7 +552,7 @@ static sal_uInt32 const aMustEncodeMap[128]
/* ~ */ PA +PD+PE+PF+PG+PH+PI+PJ+PK+PL+PM+PN+PO+PP+PQ,
0 };
-inline bool mustEncode(sal_uInt32 nUTF32, INetURLObject::Part ePart)
+bool mustEncode(sal_uInt32 nUTF32, INetURLObject::Part ePart)
{
return !rtl::isAscii(nUTF32) || !(aMustEncodeMap[nUTF32] & ePart);
}
diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx
index 48cd2f4c2881..ac0510ad59f1 100644
--- a/tools/source/generic/poly.cxx
+++ b/tools/source/generic/poly.cxx
@@ -53,7 +53,7 @@
#define SMALL_DVALUE 0.0000001
#define FSQRT2 1.4142135623730950488016887242097
-static inline double ImplGetParameter( const Point& rCenter, const Point& rPt, double fWR, double fHR )
+static double ImplGetParameter( const Point& rCenter, const Point& rPt, double fWR, double fHR )
{
const long nDX = rPt.X() - rCenter.X();
double fAngle = atan2( -rPt.Y() + rCenter.Y(), ( ( nDX == 0 ) ? 0.000000001 : nDX ) );
diff --git a/tools/source/inet/inetmime.cxx b/tools/source/inet/inetmime.cxx
index d2f2f4baec6a..0b0cafc2c85f 100644
--- a/tools/source/inet/inetmime.cxx
+++ b/tools/source/inet/inetmime.cxx
@@ -44,7 +44,7 @@ rtl_TextEncoding getCharsetEncoding(const sal_Char * pBegin,
@return True if nChar is a US-ASCII white space character (US-ASCII
0x09 or 0x20).
*/
-inline bool isWhiteSpace(sal_uInt32 nChar)
+bool isWhiteSpace(sal_uInt32 nChar)
{
return nChar == '\t' || nChar == ' ';
}
@@ -58,7 +58,7 @@ inline bool isWhiteSpace(sal_uInt32 nChar)
corresponding weight (0--63); if nChar is the US-ASCII Base 64 padding
character (US-ASCII '='), return -1; otherwise, return -2.
*/
-inline int getBase64Weight(sal_uInt32 nChar)
+int getBase64Weight(sal_uInt32 nChar)
{
return rtl::isAsciiUpperCase(nChar) ? int(nChar - 'A') :
rtl::isAsciiLowerCase(nChar) ? int(nChar - 'a' + 26) :
@@ -68,7 +68,7 @@ inline int getBase64Weight(sal_uInt32 nChar)
nChar == '=' ? -1 : -2;
}
-inline bool startsWithLineFolding(const sal_Unicode * pBegin,
+bool startsWithLineFolding(const sal_Unicode * pBegin,
const sal_Unicode * pEnd)
{
DBG_ASSERT(pBegin && pBegin <= pEnd,
@@ -78,7 +78,7 @@ inline bool startsWithLineFolding(const sal_Unicode * pBegin,
&& isWhiteSpace(pBegin[2]); // CR, LF
}
-inline rtl_TextEncoding translateFromMIME(rtl_TextEncoding
+rtl_TextEncoding translateFromMIME(rtl_TextEncoding
eEncoding)
{
#if defined(_WIN32)
@@ -89,7 +89,7 @@ inline rtl_TextEncoding translateFromMIME(rtl_TextEncoding
#endif
}
-inline bool isMIMECharsetEncoding(rtl_TextEncoding eEncoding)
+bool isMIMECharsetEncoding(rtl_TextEncoding eEncoding)
{
return rtl_isOctetTextEncoding(eEncoding);
}
@@ -182,7 +182,7 @@ std::unique_ptr<sal_Char[]> convertFromUnicode(const sal_Unicode * pBegin,
@return A pointer past the UTF-16 characters put into the buffer
(i.e., pBuffer + 1 or pBuffer + 2).
*/
-inline sal_Unicode * putUTF32Character(sal_Unicode * pBuffer,
+sal_Unicode * putUTF32Character(sal_Unicode * pBuffer,
sal_uInt32 nUTF32)
{
DBG_ASSERT(rtl::isUnicodeCodePoint(nUTF32), "putUTF32Character(): Bad char");
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index a99754d972bf..f1d7269069f9 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -46,16 +46,16 @@ c |= nSwapTmp;
#include <algorithm>
// !!! Do not inline if already the operators <<,>> are inline
-inline static void SwapUShort( sal_uInt16& r )
+static void SwapUShort( sal_uInt16& r )
{ r = OSL_SWAPWORD(r); }
-inline static void SwapShort( short& r )
+static void SwapShort( short& r )
{ r = OSL_SWAPWORD(r); }
-inline static void SwapULong( sal_uInt32& r )
+static void SwapULong( sal_uInt32& r )
{ r = OSL_SWAPDWORD(r); }
-inline static void SwapLongInt( sal_Int32& r )
+static void SwapLongInt( sal_Int32& r )
{ r = OSL_SWAPDWORD(r); }
-inline static void SwapUInt64( sal_uInt64& r )
+static void SwapUInt64( sal_uInt64& r )
{
union
{
@@ -72,7 +72,7 @@ inline static void SwapUInt64( sal_uInt64& r )
s.c[1] = OSL_SWAPDWORD(s.c[1]);
r = s.n;
}
-inline static void SwapInt64( sal_Int64& r )
+static void SwapInt64( sal_Int64& r )
{
union
{
@@ -91,7 +91,7 @@ inline static void SwapInt64( sal_Int64& r )
}
#ifdef UNX
-inline static void SwapFloat( float& r )
+static void SwapFloat( float& r )
{
union
{
@@ -104,7 +104,7 @@ inline static void SwapFloat( float& r )
r = s.f;
}
-inline static void SwapDouble( double& r )
+static void SwapDouble( double& r )
{
if( sizeof(double) != 8 )
{