summaryrefslogtreecommitdiff
path: root/sal/osl
diff options
context:
space:
mode:
authorPhilipp Hofer <philipp.hofer@protonmail.com>2020-11-12 13:11:00 +0100
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2020-11-21 13:16:53 +0100
commit70e36068a43cb6747232441ee67e609c86362aa0 (patch)
treeca05d17c538d3230ff904296fbb7625b2d7d5660 /sal/osl
parente8e093f14b698fc710930b2dead57c7d4fb63b8e (diff)
tdf#123936 Formatting files in module sal with clang-format
Change-Id: I04a773e8fd565f57dc0eb887fb4714b6edbb35e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105699 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Jenkins
Diffstat (limited to 'sal/osl')
-rw-r--r--sal/osl/all/signalshared.cxx15
-rw-r--r--sal/osl/unx/createfilehandlefromfd.hxx5
-rw-r--r--sal/osl/unx/file_error_transl.cxx7
-rw-r--r--sal/osl/unx/memory.cxx7
-rw-r--r--sal/osl/unx/nlsupport.hxx7
-rw-r--r--sal/osl/unx/random.cxx6
-rw-r--r--sal/osl/unx/readwrite_helper.hxx4
-rw-r--r--sal/osl/unx/secimpl.hxx5
-rw-r--r--sal/osl/w32/file-impl.hxx3
-rw-r--r--sal/osl/w32/file_error.hxx2
-rw-r--r--sal/osl/w32/filetime.hxx15
-rw-r--r--sal/osl/w32/mutex.cxx17
-rw-r--r--sal/osl/w32/nlsupport.hxx2
-rw-r--r--sal/osl/w32/procimpl.hxx5
-rw-r--r--sal/osl/w32/random.cxx15
-rw-r--r--sal/osl/w32/secimpl.hxx9
-rw-r--r--sal/osl/w32/signal.cxx7
-rw-r--r--sal/osl/w32/system.h4
18 files changed, 66 insertions, 69 deletions
diff --git a/sal/osl/all/signalshared.cxx b/sal/osl/all/signalshared.cxx
index d6998eb006ca..2fc72c478fcc 100644
--- a/sal/osl/all/signalshared.cxx
+++ b/sal/osl/all/signalshared.cxx
@@ -47,7 +47,6 @@ bool deInitSignal()
return bRet;
}
-
}
oslSignalAction callSignalHandler(oslSignalInfo* pInfo)
@@ -57,8 +56,7 @@ oslSignalAction callSignalHandler(oslSignalInfo* pInfo)
while (pHandler)
{
- if ((Action = pHandler->Handler(pHandler->pData, pInfo))
- != osl_Signal_ActCallNextHdl)
+ if ((Action = pHandler->Handler(pHandler->pData, pInfo)) != osl_Signal_ActCallNextHdl)
break;
pHandler = pHandler->pNext;
@@ -75,17 +73,18 @@ oslSignalHandler SAL_CALL osl_addSignalHandler(oslSignalHandlerFunction handler,
if (!bInitSignal)
bInitSignal = initSignal();
- oslSignalHandlerImpl* pHandler = static_cast<oslSignalHandlerImpl*>(calloc(1, sizeof(oslSignalHandlerImpl)));
+ oslSignalHandlerImpl* pHandler
+ = static_cast<oslSignalHandlerImpl*>(calloc(1, sizeof(oslSignalHandlerImpl)));
if (pHandler)
{
pHandler->Handler = handler;
- pHandler->pData = pData;
+ pHandler->pData = pData;
osl_acquireMutex(SignalListMutex);
pHandler->pNext = SignalList;
- SignalList = pHandler;
+ SignalList = pHandler;
osl_releaseMutex(SignalListMutex);
@@ -125,7 +124,7 @@ sal_Bool SAL_CALL osl_removeSignalHandler(oslSignalHandler handler)
}
pPrevious = pHandler;
- pHandler = pHandler->pNext;
+ pHandler = pHandler->pNext;
}
osl_releaseMutex(SignalListMutex);
@@ -152,7 +151,7 @@ oslSignalAction SAL_CALL osl_raiseSignal(sal_Int32 userSignal, void* userData)
return action;
}
-sal_Bool SAL_CALL osl_setErrorReporting( sal_Bool /*bEnable*/ )
+sal_Bool SAL_CALL osl_setErrorReporting(sal_Bool /*bEnable*/)
{
// this is part of the stable API
return false;
diff --git a/sal/osl/unx/createfilehandlefromfd.hxx b/sal/osl/unx/createfilehandlefromfd.hxx
index daf20e847d6f..bb8a768ef814 100644
--- a/sal/osl/unx/createfilehandlefromfd.hxx
+++ b/sal/osl/unx/createfilehandlefromfd.hxx
@@ -14,10 +14,9 @@
#include <osl/file.h>
-namespace osl::detail {
-
+namespace osl::detail
+{
oslFileHandle createFileHandleFromFD(int fd); // defined in file.cxx
-
}
#endif
diff --git a/sal/osl/unx/file_error_transl.cxx b/sal/osl/unx/file_error_transl.cxx
index 60824f71ed34..ad6e00558a40 100644
--- a/sal/osl/unx/file_error_transl.cxx
+++ b/sal/osl/unx/file_error_transl.cxx
@@ -26,7 +26,7 @@
oslFileError oslTranslateFileError(int Errno)
{
- switch(Errno)
+ switch (Errno)
{
case EPERM:
return osl_File_E_PERM;
@@ -138,7 +138,7 @@ oslFileError oslTranslateFileError(int Errno)
#if EOPNOTSUPP != ENOTSUP
case EOPNOTSUPP:
#endif
- return osl_File_E_NOSYS;
+ return osl_File_E_NOSYS;
#if !defined(AIX) || !(defined(_ALL_SOURCE) && !defined(_LINUX_SOURCE_COMPAT))
case ENOTEMPTY:
@@ -148,7 +148,8 @@ oslFileError oslTranslateFileError(int Errno)
case ELOOP:
return osl_File_E_LOOP;
-#if !(defined(MACOSX) || defined(NETBSD) || defined(FREEBSD) || defined(OPENBSD) || defined(DRAGONFLY))
+#if !(defined(MACOSX) || defined(NETBSD) || defined(FREEBSD) || defined(OPENBSD) \
+ || defined(DRAGONFLY))
case EILSEQ:
return osl_File_E_ILSEQ;
diff --git a/sal/osl/unx/memory.cxx b/sal/osl/unx/memory.cxx
index 745a7f14c3f2..be3e41fb5e8b 100644
--- a/sal/osl/unx/memory.cxx
+++ b/sal/osl/unx/memory.cxx
@@ -14,7 +14,7 @@
#include <malloc.h>
#endif
-void* osl_aligned_alloc( sal_Size align, sal_Size size )
+void* osl_aligned_alloc(sal_Size align, sal_Size size)
{
if (size == 0)
{
@@ -30,9 +30,6 @@ void* osl_aligned_alloc( sal_Size align, sal_Size size )
#endif
}
-void osl_aligned_free( void* p )
-{
- free(p);
-}
+void osl_aligned_free(void* p) { free(p); }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/osl/unx/nlsupport.hxx b/sal/osl/unx/nlsupport.hxx
index dce5d65c3df8..ba5acf23c277 100644
--- a/sal/osl/unx/nlsupport.hxx
+++ b/sal/osl/unx/nlsupport.hxx
@@ -24,9 +24,12 @@
#include <rtl/locale.h>
-namespace rtl { class OUString; }
+namespace rtl
+{
+class OUString;
+}
-void imp_getProcessLocale( rtl_Locale ** );
+void imp_getProcessLocale(rtl_Locale**);
#if defined IOS || defined MACOSX
OUString macosx_getLocale();
diff --git a/sal/osl/unx/random.cxx b/sal/osl/unx/random.cxx
index 5904e7d575b3..260aa61ba8a4 100644
--- a/sal/osl/unx/random.cxx
+++ b/sal/osl/unx/random.cxx
@@ -18,9 +18,9 @@ int osl_get_system_random_data(char* buffer, size_t desired_len)
assert(buffer);
fd = open("/dev/urandom", O_RDONLY);
- if(fd != -1)
+ if (fd != -1)
{
- while(desired_len)
+ while (desired_len)
{
ssize_t nb_read;
if ((nb_read = read(fd, buffer, desired_len)) == -1)
@@ -33,7 +33,7 @@ int osl_get_system_random_data(char* buffer, size_t desired_len)
}
else
{
- buffer += nb_read;
+ buffer += nb_read;
desired_len -= nb_read;
}
}
diff --git a/sal/osl/unx/readwrite_helper.hxx b/sal/osl/unx/readwrite_helper.hxx
index d73ce56457cb..133ccd016fc9 100644
--- a/sal/osl/unx/readwrite_helper.hxx
+++ b/sal/osl/unx/readwrite_helper.hxx
@@ -14,12 +14,12 @@
#include <cstddef>
-bool safeWrite( int fd, void* data, std::size_t dataSize );
+bool safeWrite(int fd, void* data, std::size_t dataSize);
// This function *will* read |count| bytes from |fd|, busy looping
// if needed. Don't use it when you don't know if you can request enough
// data. It will return sal_False for any partial transfer or error.
-bool safeRead( int fd, void* buffer, std::size_t count );
+bool safeRead(int fd, void* buffer, std::size_t count);
#endif
diff --git a/sal/osl/unx/secimpl.hxx b/sal/osl/unx/secimpl.hxx
index f93b85f8f505..1577d6609bc7 100644
--- a/sal/osl/unx/secimpl.hxx
+++ b/sal/osl/unx/secimpl.hxx
@@ -22,12 +22,13 @@
#include <pwd.h>
-struct oslSecurityImpl {
+struct oslSecurityImpl
+{
struct passwd m_pPasswd;
char m_buffer[1]; /* should be a C99 flexible array member */
};
-bool osl_psz_getUserIdent(oslSecurity Security, char *pszIdent, sal_uInt32 nMax);
+bool osl_psz_getUserIdent(oslSecurity Security, char* pszIdent, sal_uInt32 nMax);
#endif
diff --git a/sal/osl/w32/file-impl.hxx b/sal/osl/w32/file-impl.hxx
index 550a22dbf6f9..3f1d2136def9 100644
--- a/sal/osl/w32/file-impl.hxx
+++ b/sal/osl/w32/file-impl.hxx
@@ -18,8 +18,7 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
-extern "C" oslFileHandle osl_createFileHandleFromOSHandle(
- HANDLE hFile, sal_uInt32 uFlags);
+extern "C" oslFileHandle osl_createFileHandleFromOSHandle(HANDLE hFile, sal_uInt32 uFlags);
#endif
diff --git a/sal/osl/w32/file_error.hxx b/sal/osl/w32/file_error.hxx
index 714297c11eb9..4da87c132cfd 100644
--- a/sal/osl/w32/file_error.hxx
+++ b/sal/osl/w32/file_error.hxx
@@ -22,7 +22,7 @@
#include <osl/file.h>
-oslFileError oslTranslateFileError (/*DWORD*/ unsigned long dwError);
+oslFileError oslTranslateFileError(/*DWORD*/ unsigned long dwError);
#endif
diff --git a/sal/osl/w32/filetime.hxx b/sal/osl/w32/filetime.hxx
index db21c4ca34b8..dc355591adce 100644
--- a/sal/osl/w32/filetime.hxx
+++ b/sal/osl/w32/filetime.hxx
@@ -17,21 +17,22 @@
#include <osl/time.h>
-BOOL TimeValueToFileTime(TimeValue const * cpTimeVal, FILETIME * pFTime);
+BOOL TimeValueToFileTime(TimeValue const* cpTimeVal, FILETIME* pFTime);
-BOOL FileTimeToTimeValue(FILETIME const * cpFTime, TimeValue * pTimeVal);
+BOOL FileTimeToTimeValue(FILETIME const* cpFTime, TimeValue* pTimeVal);
-namespace osl::detail {
-
-inline __int64 getFiletime(FILETIME const & ft) {
+namespace osl::detail
+{
+inline __int64 getFiletime(FILETIME const& ft)
+{
return (DWORD64(ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
}
-inline void setFiletime(FILETIME & ft, __int64 value) {
+inline void setFiletime(FILETIME& ft, __int64 value)
+{
ft.dwHighDateTime = value >> 32;
ft.dwLowDateTime = value & 0xFFFFFFFF;
}
-
}
#endif
diff --git a/sal/osl/w32/mutex.cxx b/sal/osl/w32/mutex.cxx
index 95aca0ce5cef..31a9117a8c68 100644
--- a/sal/osl/w32/mutex.cxx
+++ b/sal/osl/w32/mutex.cxx
@@ -33,9 +33,9 @@
oslMutex SAL_CALL osl_createMutex(void)
{
- CRITICAL_SECTION *pMutexImpl;
+ CRITICAL_SECTION* pMutexImpl;
- pMutexImpl = static_cast<CRITICAL_SECTION *>(calloc(sizeof(CRITICAL_SECTION), 1));
+ pMutexImpl = static_cast<CRITICAL_SECTION*>(calloc(sizeof(CRITICAL_SECTION), 1));
OSL_ASSERT(pMutexImpl); /* alloc successful? */
@@ -46,7 +46,7 @@ oslMutex SAL_CALL osl_createMutex(void)
void SAL_CALL osl_destroyMutex(oslMutex Mutex)
{
- CRITICAL_SECTION *pMutexImpl = reinterpret_cast<CRITICAL_SECTION *>(Mutex);
+ CRITICAL_SECTION* pMutexImpl = reinterpret_cast<CRITICAL_SECTION*>(Mutex);
if (pMutexImpl)
{
@@ -57,7 +57,7 @@ void SAL_CALL osl_destroyMutex(oslMutex Mutex)
sal_Bool SAL_CALL osl_acquireMutex(oslMutex Mutex)
{
- CRITICAL_SECTION *pMutexImpl = reinterpret_cast<CRITICAL_SECTION *>(Mutex);
+ CRITICAL_SECTION* pMutexImpl = reinterpret_cast<CRITICAL_SECTION*>(Mutex);
OSL_ASSERT(Mutex);
@@ -68,7 +68,7 @@ sal_Bool SAL_CALL osl_acquireMutex(oslMutex Mutex)
sal_Bool SAL_CALL osl_tryToAcquireMutex(oslMutex Mutex)
{
- CRITICAL_SECTION *pMutexImpl = reinterpret_cast<CRITICAL_SECTION *>(Mutex);
+ CRITICAL_SECTION* pMutexImpl = reinterpret_cast<CRITICAL_SECTION*>(Mutex);
OSL_ASSERT(Mutex);
@@ -77,7 +77,7 @@ sal_Bool SAL_CALL osl_tryToAcquireMutex(oslMutex Mutex)
sal_Bool SAL_CALL osl_releaseMutex(oslMutex Mutex)
{
- CRITICAL_SECTION *pMutexImpl = reinterpret_cast<CRITICAL_SECTION *>(Mutex);
+ CRITICAL_SECTION* pMutexImpl = reinterpret_cast<CRITICAL_SECTION*>(Mutex);
OSL_ASSERT(Mutex);
@@ -89,9 +89,6 @@ sal_Bool SAL_CALL osl_releaseMutex(oslMutex Mutex)
/* initialized in dllentry.c */
oslMutex g_Mutex;
-oslMutex * SAL_CALL osl_getGlobalMutex(void)
-{
- return &g_Mutex;
-}
+oslMutex* SAL_CALL osl_getGlobalMutex(void) { return &g_Mutex; }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/osl/w32/nlsupport.hxx b/sal/osl/w32/nlsupport.hxx
index cd09babb21d1..2d818c378b3e 100644
--- a/sal/osl/w32/nlsupport.hxx
+++ b/sal/osl/w32/nlsupport.hxx
@@ -14,7 +14,7 @@
#include <rtl/locale.h>
-void imp_getProcessLocale(rtl_Locale ** ppLocale);
+void imp_getProcessLocale(rtl_Locale** ppLocale);
#endif
diff --git a/sal/osl/w32/procimpl.hxx b/sal/osl/w32/procimpl.hxx
index ee985e3229eb..fb1263fa78a3 100644
--- a/sal/osl/w32/procimpl.hxx
+++ b/sal/osl/w32/procimpl.hxx
@@ -22,9 +22,10 @@
#include <osl/process.h>
-struct oslProcessImpl {
+struct oslProcessImpl
+{
HANDLE m_hProcess;
- DWORD m_IdProcess;
+ DWORD m_IdProcess;
};
#endif
diff --git a/sal/osl/w32/random.cxx b/sal/osl/w32/random.cxx
index ce495a8e3dc4..c873a8d3b5f0 100644
--- a/sal/osl/w32/random.cxx
+++ b/sal/osl/w32/random.cxx
@@ -21,15 +21,15 @@ int osl_get_system_random_data(char* buffer, size_t desired_len)
unsigned int val;
/* if unaligned fill to alignment */
- if(reinterpret_cast<uintptr_t>(buffer) & 3)
+ if (reinterpret_cast<uintptr_t>(buffer) & 3)
{
size_t len = 4 - (reinterpret_cast<size_t>(buffer) & 3);
- if(len > desired_len)
+ if (len > desired_len)
{
len = desired_len;
}
- if(rand_s(&val))
+ if (rand_s(&val))
{
return 0;
}
@@ -38,9 +38,9 @@ int osl_get_system_random_data(char* buffer, size_t desired_len)
desired_len -= len;
}
/* fill directly into the buffer as long as we can */
- while(desired_len >= 4)
+ while (desired_len >= 4)
{
- if(rand_s(reinterpret_cast<unsigned int*>(buffer)))
+ if (rand_s(reinterpret_cast<unsigned int*>(buffer)))
{
return 0;
}
@@ -51,9 +51,9 @@ int osl_get_system_random_data(char* buffer, size_t desired_len)
}
}
/* deal with the partial int reminder to fill */
- if(desired_len)
+ if (desired_len)
{
- if(rand_s(&val))
+ if (rand_s(&val))
{
return 0;
}
@@ -62,5 +62,4 @@ int osl_get_system_random_data(char* buffer, size_t desired_len)
return 1;
}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/osl/w32/secimpl.hxx b/sal/osl/w32/secimpl.hxx
index b1f8746f912f..7c952bb64250 100644
--- a/sal/osl/w32/secimpl.hxx
+++ b/sal/osl/w32/secimpl.hxx
@@ -26,12 +26,13 @@
#define USER_BUFFER_SIZE 256
-typedef struct {
+typedef struct
+{
HANDLE m_hProfile;
HANDLE m_hToken;
- sal_Unicode m_User[USER_BUFFER_SIZE];
-/* extension by fileserver login */
- NETRESOURCEW *m_pNetResource;
+ sal_Unicode m_User[USER_BUFFER_SIZE];
+ /* extension by fileserver login */
+ NETRESOURCEW* m_pNetResource;
} oslSecurityImpl;
#endif
diff --git a/sal/osl/w32/signal.cxx b/sal/osl/w32/signal.cxx
index aa5662221c7c..dcb05beae097 100644
--- a/sal/osl/w32/signal.cxx
+++ b/sal/osl/w32/signal.cxx
@@ -71,7 +71,7 @@ long WINAPI signalHandlerFunction(LPEXCEPTION_POINTERS lpEP)
oslSignalInfo info;
info.UserSignal = lpEP->ExceptionRecord->ExceptionCode;
- info.UserData = nullptr;
+ info.UserData = nullptr;
switch (lpEP->ExceptionRecord->ExceptionCode)
{
@@ -102,7 +102,7 @@ long WINAPI signalHandlerFunction(LPEXCEPTION_POINTERS lpEP)
oslSignalAction action;
- if ( !bNested )
+ if (!bNested)
{
bNested = true;
action = callSignalHandler(&info);
@@ -110,7 +110,7 @@ long WINAPI signalHandlerFunction(LPEXCEPTION_POINTERS lpEP)
else
action = osl_Signal_ActKillApp;
- switch ( action )
+ switch (action)
{
case osl_Signal_ActCallNextHdl:
return EXCEPTION_CONTINUE_SEARCH;
@@ -128,7 +128,6 @@ long WINAPI signalHandlerFunction(LPEXCEPTION_POINTERS lpEP)
return EXCEPTION_CONTINUE_EXECUTION;
}
-
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/osl/w32/system.h b/sal/osl/w32/system.h
index e1896f13e23c..921d746fd962 100644
--- a/sal/osl/w32/system.h
+++ b/sal/osl/w32/system.h
@@ -18,7 +18,7 @@
*/
#if OSL_DEBUG_LEVEL <= 3
-# define NO_DEBUG_CRT
+#define NO_DEBUG_CRT
#endif
#include <stdio.h>
@@ -48,7 +48,7 @@
#include <ws2tcpip.h>
#include <shlobj.h>
#ifndef NO_DEBUG_CRT
- #include <crtdbg.h>
+#include <crtdbg.h>
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */