diff options
Diffstat (limited to 'sal/osl/unx')
-rw-r--r-- | sal/osl/unx/conditn.cxx | 4 | ||||
-rw-r--r-- | sal/osl/unx/file.cxx | 4 | ||||
-rw-r--r-- | sal/osl/unx/file_path_helper.cxx | 4 | ||||
-rw-r--r-- | sal/osl/unx/process.cxx | 4 | ||||
-rw-r--r-- | sal/osl/unx/process_impl.cxx | 8 | ||||
-rw-r--r-- | sal/osl/unx/profile.cxx | 4 | ||||
-rw-r--r-- | sal/osl/unx/thread.cxx | 20 |
7 files changed, 46 insertions, 2 deletions
diff --git a/sal/osl/unx/conditn.cxx b/sal/osl/unx/conditn.cxx index cede35a86d04..d73d67e91b37 100644 --- a/sal/osl/unx/conditn.cxx +++ b/sal/osl/unx/conditn.cxx @@ -29,6 +29,8 @@ #include <osl/conditn.h> #include <osl/time.h> +namespace { + struct oslConditionImpl { pthread_cond_t m_Condition; @@ -36,6 +38,8 @@ struct oslConditionImpl bool m_State; }; +} + oslCondition SAL_CALL osl_createCondition() { oslConditionImpl* pCond; diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx index b6a0acaae2c4..cfd71419d3fe 100644 --- a/sal/osl/unx/file.cxx +++ b/sal/osl/unx/file.cxx @@ -60,6 +60,8 @@ #include <android/asset_manager.h> #endif +namespace { + struct FileHandle_Impl { pthread_mutex_t m_mutex; @@ -155,6 +157,8 @@ struct FileHandle_Impl }; }; +} + FileHandle_Impl::Guard::Guard(pthread_mutex_t * pMutex) : m_mutex(pMutex) { diff --git a/sal/osl/unx/file_path_helper.cxx b/sal/osl/unx/file_path_helper.cxx index 4d629f849868..163deb0c2493 100644 --- a/sal/osl/unx/file_path_helper.cxx +++ b/sal/osl/unx/file_path_helper.cxx @@ -158,6 +158,8 @@ bool osl_systemPathIsLocalOrParentDirectoryEntry( dirent == ".."); } +namespace { + /** Simple iterator for a path list separated by the specified character */ class path_list_iterator @@ -225,6 +227,8 @@ private: const sal_Unicode* m_path_segment_end; }; +} + bool osl_searchPath( const rtl_uString* pustrFilePath, const rtl_uString* pustrSearchPathList, diff --git a/sal/osl/unx/process.cxx b/sal/osl/unx/process.cxx index 41d6de0b04ea..d479e0d40cfc 100644 --- a/sal/osl/unx/process.cxx +++ b/sal/osl/unx/process.cxx @@ -788,6 +788,8 @@ void SAL_CALL osl_freeProcessHandle(oslProcess Process) } #if defined(LINUX) +namespace { + struct osl_procStat { /* from 'stat' */ @@ -848,6 +850,8 @@ struct osl_procStat unsigned long vm_lib; /* library size */ }; +} + static bool osl_getProcStat(pid_t pid, struct osl_procStat* procstat) { int fd = 0; diff --git a/sal/osl/unx/process_impl.cxx b/sal/osl/unx/process_impl.cxx index 35a5b90ece0d..fe7dc9db5ccf 100644 --- a/sal/osl/unx/process_impl.cxx +++ b/sal/osl/unx/process_impl.cxx @@ -140,6 +140,8 @@ oslProcessError bootstrap_getExecutableFile(rtl_uString ** ppFileURL) #endif +namespace { + struct CommandArgs_Impl { pthread_mutex_t m_mutex; @@ -147,6 +149,8 @@ struct CommandArgs_Impl rtl_uString ** m_ppArgs; }; +} + static struct CommandArgs_Impl g_command_args = { PTHREAD_MUTEX_INITIALIZER, @@ -409,12 +413,16 @@ oslProcessError SAL_CALL osl_getProcessWorkingDir(rtl_uString **ppustrWorkingDir return result; } +namespace { + struct ProcessLocale_Impl { pthread_mutex_t m_mutex; rtl_Locale * m_pLocale; }; +} + static struct ProcessLocale_Impl g_process_locale = { PTHREAD_MUTEX_INITIALIZER, diff --git a/sal/osl/unx/profile.cxx b/sal/osl/unx/profile.cxx index ad8868b5490c..717316c0817c 100644 --- a/sal/osl/unx/profile.cxx +++ b/sal/osl/unx/profile.cxx @@ -58,8 +58,6 @@ enum osl_TLockMode un_lock, read_lock, write_lock }; -} - struct osl_TFile { int m_Handle; @@ -104,6 +102,8 @@ struct osl_TProfileImpl bool m_bIsValid; }; +} + static osl_TFile* openFileImpl(const sal_Char* pszFilename, oslProfileOption ProfileFlags); static osl_TStamp closeFileImpl(osl_TFile* pFile, oslProfileOption Flags); static bool OslProfile_lockFile(const osl_TFile* pFile, osl_TLockMode eMode); diff --git a/sal/osl/unx/thread.cxx b/sal/osl/unx/thread.cxx index 5ea77495daa6..fb694ebd92cd 100644 --- a/sal/osl/unx/thread.cxx +++ b/sal/osl/unx/thread.cxx @@ -75,6 +75,8 @@ #define THREADIMPL_FLAGS_ATTACHED 0x00010 #define THREADIMPL_FLAGS_DESTROYED 0x00020 +namespace { + typedef struct osl_thread_impl_st { pthread_t m_hThread; @@ -95,18 +97,26 @@ struct osl_thread_priority_st int m_Lowest; }; +} + #define OSL_THREAD_PRIORITY_INITIALIZER { 127, 96, 64, 32, 0 } static void osl_thread_priority_init_Impl(); +namespace { + struct osl_thread_textencoding_st { pthread_key_t m_key; /* key to store thread local text encoding */ rtl_TextEncoding m_default; /* the default text encoding */ }; +} + #define OSL_THREAD_TEXTENCODING_INITIALIZER { 0, RTL_TEXTENCODING_DONTKNOW } static void osl_thread_textencoding_init_Impl(); +namespace { + struct osl_thread_global_st { pthread_once_t m_once; @@ -114,6 +124,8 @@ struct osl_thread_global_st struct osl_thread_textencoding_st m_textencoding; }; +} + static struct osl_thread_global_st g_thread = { PTHREAD_ONCE_INIT, @@ -555,6 +567,8 @@ void SAL_CALL osl_setThreadName(char const * name) /* osl_getThreadIdentifier @@@ see TODO @@@ */ +namespace { + struct HashEntry { pthread_t Handle; @@ -562,6 +576,8 @@ struct HashEntry HashEntry * Next; }; +} + static HashEntry* HashTable[31]; static const int HashSize = SAL_N_ELEMENTS(HashTable); @@ -951,12 +967,16 @@ oslThreadPriority SAL_CALL osl_getThreadPriority(const oslThread Thread) return Priority; } +namespace { + struct wrapper_pthread_key { pthread_key_t m_key; oslThreadKeyCallbackFunction pfnCallback; }; +} + oslThreadKey SAL_CALL osl_createThreadKey( oslThreadKeyCallbackFunction pCallback ) { wrapper_pthread_key *pKey = static_cast<wrapper_pthread_key*>(malloc(sizeof(wrapper_pthread_key))); |