summaryrefslogtreecommitdiff
path: root/tools/source
diff options
context:
space:
mode:
authorPhilipp Hofer <philipp.hofer@protonmail.com>2020-11-12 13:23:10 +0100
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2020-11-18 12:04:58 +0100
commit1582d9a2c5ef9f28bc97a74e25c3948a7611fac1 (patch)
tree854893c78571f69672be4e695c3069b3cab2f1b0 /tools/source
parentf5e3b2e83ab463064f100a9cd93f09cadaae2292 (diff)
tdf#123936 Formatting files in module tools with clang-format
Change-Id: I0f66d02e67388cc4d21c5e96bf84b6848e8de63a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105721 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'tools/source')
-rw-r--r--tools/source/generic/svborder.cxx14
-rw-r--r--tools/source/misc/cpuid.cxx31
-rw-r--r--tools/source/misc/extendapplicationenvironment.cxx24
-rw-r--r--tools/source/ref/ref.cxx6
4 files changed, 39 insertions, 36 deletions
diff --git a/tools/source/generic/svborder.cxx b/tools/source/generic/svborder.cxx
index 78238b480508..a61c79b0e437 100644
--- a/tools/source/generic/svborder.cxx
+++ b/tools/source/generic/svborder.cxx
@@ -19,16 +19,16 @@
#include <tools/svborder.hxx>
#include <tools/gen.hxx>
-tools::Rectangle & operator += ( tools::Rectangle & rRect, const SvBorder & rBorder )
+tools::Rectangle& operator+=(tools::Rectangle& rRect, const SvBorder& rBorder)
{
// call GetSize first due to Empty-Rect
- Size aS( rRect.GetSize() );
- aS.AdjustWidth(rBorder.Left() + rBorder.Right() );
- aS.AdjustHeight(rBorder.Top() + rBorder.Bottom() );
+ Size aS(rRect.GetSize());
+ aS.AdjustWidth(rBorder.Left() + rBorder.Right());
+ aS.AdjustHeight(rBorder.Top() + rBorder.Bottom());
- rRect.AdjustLeft( -(rBorder.Left()) );
- rRect.AdjustTop( -(rBorder.Top()) );
- rRect.SetSize( aS );
+ rRect.AdjustLeft(-(rBorder.Left()));
+ rRect.AdjustTop(-(rBorder.Top()));
+ rRect.SetSize(aS);
return rRect;
}
diff --git a/tools/source/misc/cpuid.cxx b/tools/source/misc/cpuid.cxx
index e2a8e20a762a..0395d0e0f001 100644
--- a/tools/source/misc/cpuid.cxx
+++ b/tools/source/misc/cpuid.cxx
@@ -11,10 +11,10 @@
#include <tools/cpuid.hxx>
#include <cstdint>
-namespace cpuid {
-
-namespace {
-
+namespace cpuid
+{
+namespace
+{
#if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64))
#include <intrin.h>
void getCpuId(uint32_t array[4], uint32_t nInfoType)
@@ -30,7 +30,7 @@ void getCpuId(uint32_t array[4], uint32_t nInfoType)
#else
void getCpuId(uint32_t array[4], uint32_t /*nInfoType*/)
{
- array[0] = array[1] = array[2] = array[3] = 0;
+ array[0] = array[1] = array[2] = array[3] = 0;
}
#endif
@@ -41,7 +41,7 @@ bool checkAVXSupportInOS()
#if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64))
xcr0 = uint32_t(_xgetbv(0));
#elif (defined(__i386__) || defined(__x86_64__))
- __asm__("xgetbv" : "=a" (xcr0) : "c" (0) : "%edx");
+ __asm__("xgetbv" : "=a"(xcr0) : "c"(0) : "%edx");
#endif
return ((xcr0 & 6) == 6); /* checking if xmm and ymm state are enabled in XCR0 */
}
@@ -49,25 +49,25 @@ bool checkAVXSupportInOS()
} // end anonymous namespace
#define HYPER_bit (1 << 28)
-#define SSE2_bit (1 << 26)
-#define SSSE3_bit (1 << 9)
+#define SSE2_bit (1 << 26)
+#define SSSE3_bit (1 << 9)
#define SSE41_bit (1 << 19)
#define SSE42_bit (1 << 20)
#define XSAVE_bit (1 << 27)
-#define AVX_bit (1 << 28)
-#define AVX2_bit (1 << 5)
+#define AVX_bit (1 << 28)
+#define AVX2_bit (1 << 5)
InstructionSetFlags getCpuInstructionSetFlags()
{
InstructionSetFlags eInstructions = InstructionSetFlags::NONE;
- uint32_t info[] = {0, 0, 0, 0};
+ uint32_t info[] = { 0, 0, 0, 0 };
getCpuId(info, 0);
int nLevel = info[0];
if (nLevel >= 1)
{
- uint32_t aCpuInfoArray[] = {0, 0, 0, 0};
+ uint32_t aCpuInfoArray[] = { 0, 0, 0, 0 };
getCpuId(aCpuInfoArray, 1);
if ((aCpuInfoArray[3] & HYPER_bit) != 0)
@@ -79,14 +79,13 @@ InstructionSetFlags getCpuInstructionSetFlags()
if ((aCpuInfoArray[2] & SSSE3_bit) != 0)
eInstructions |= InstructionSetFlags::SSSE3;
- if ((aCpuInfoArray[2] & SSE41_bit ) != 0)
+ if ((aCpuInfoArray[2] & SSE41_bit) != 0)
eInstructions |= InstructionSetFlags::SSE41;
if ((aCpuInfoArray[2] & SSE42_bit) != 0)
eInstructions |= InstructionSetFlags::SSE42;
- if (((aCpuInfoArray[2] & AVX_bit) != 0) &&
- ((aCpuInfoArray[2] & XSAVE_bit) != 0))
+ if (((aCpuInfoArray[2] & AVX_bit) != 0) && ((aCpuInfoArray[2] & XSAVE_bit) != 0))
{
if (checkAVXSupportInOS())
{
@@ -94,7 +93,7 @@ InstructionSetFlags getCpuInstructionSetFlags()
if (nLevel >= 7)
{
- uint32_t aExtendedInfo[] = {0, 0, 0, 0};
+ uint32_t aExtendedInfo[] = { 0, 0, 0, 0 };
getCpuId(aExtendedInfo, 7);
if ((aExtendedInfo[1] & AVX2_bit) != 0)
diff --git a/tools/source/misc/extendapplicationenvironment.cxx b/tools/source/misc/extendapplicationenvironment.cxx
index 13171d8e70ff..ce2237a88c70 100644
--- a/tools/source/misc/extendapplicationenvironment.cxx
+++ b/tools/source/misc/extendapplicationenvironment.cxx
@@ -34,13 +34,15 @@
#include <sal/types.h>
#include <tools/extendapplicationenvironment.hxx>
-namespace tools {
-
-void extendApplicationEnvironment() {
+namespace tools
+{
+void extendApplicationEnvironment()
+{
#if defined UNX
// Try to set RLIMIT_NOFILE as large as possible (failure is harmless):
rlimit lim;
- if (getrlimit(RLIMIT_NOFILE, &lim) == 0) {
+ if (getrlimit(RLIMIT_NOFILE, &lim) == 0)
+ {
lim.rlim_cur = lim.rlim_max;
setrlimit(RLIMIT_NOFILE, &lim);
}
@@ -57,12 +59,16 @@ void extendApplicationEnvironment() {
uri = rtl::Bootstrap::encode(uri);
}
env.append(uri);
- } else {
- if (osl_getExecutableFile(&uri.pData) != osl_Process_E_None) {
+ }
+ else
+ {
+ if (osl_getExecutableFile(&uri.pData) != osl_Process_E_None)
+ {
abort();
}
sal_Int32 lastDirSeparatorPos = uri.lastIndexOf('/');
- if (lastDirSeparatorPos >= 0) {
+ if (lastDirSeparatorPos >= 0)
+ {
uri = uri.copy(0, lastDirSeparatorPos + 1);
}
env.append(rtl::Bootstrap::encode(uri));
@@ -72,11 +78,11 @@ void extendApplicationEnvironment() {
env.append(SAL_CONFIGFILE("fundamental"));
}
OUString envValue(env.makeStringAndClear());
- if (osl_setEnvironment(envVar.pData, envValue.pData) != osl_Process_E_None) {
+ if (osl_setEnvironment(envVar.pData, envValue.pData) != osl_Process_E_None)
+ {
abort();
}
}
-
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/tools/source/ref/ref.cxx b/tools/source/ref/ref.cxx
index dbb2122529e1..a84ae45e69a7 100644
--- a/tools/source/ref/ref.cxx
+++ b/tools/source/ref/ref.cxx
@@ -20,13 +20,11 @@
#include <tools/ref.hxx>
#include <tools/weakbase.hxx>
-SvRefBase::~SvRefBase() COVERITY_NOEXCEPT_FALSE
-{
-}
+SvRefBase::~SvRefBase() COVERITY_NOEXCEPT_FALSE {}
tools::WeakBase::~WeakBase()
{
- if( mpWeakConnection.is() )
+ if (mpWeakConnection.is())
mpWeakConnection->mpReference = nullptr;
}