jurt/Library_jpipe.mk | 3 jurt/source/pipe/staticsalhack.cxx | 67 jurt/source/pipe/staticsalhack.h | 16 jurt/source/pipe/staticsalhack_c.c | 18 jurt/source/pipe/staticsalhack_cxx.cxx | 58 sal/Library_sal.mk | 24 sal/osl/all/filepath.c | 114 - sal/osl/all/filepath.cxx | 114 + sal/osl/unx/file.cxx | 6 sal/osl/unx/file_error_transl.cxx | 6 sal/osl/unx/file_error_transl.h | 63 sal/osl/unx/file_error_transl.hxx | 54 sal/osl/unx/file_misc.cxx | 6 sal/osl/unx/file_stat.cxx | 4 sal/osl/unx/file_url.cxx | 4 sal/osl/unx/file_url.h | 44 sal/osl/unx/file_url.hxx | 35 sal/osl/unx/file_volume.cxx | 4 sal/osl/unx/interlck.c | 103 - sal/osl/unx/interlck.cxx | 103 + sal/osl/unx/memory.c | 40 sal/osl/unx/memory.cxx | 40 sal/osl/unx/module.cxx | 2 sal/osl/unx/mutex.c | 184 -- sal/osl/unx/mutex.cxx | 184 ++ sal/osl/unx/nlsupport.c | 956 ------------ sal/osl/unx/nlsupport.cxx | 956 ++++++++++++ sal/osl/unx/nlsupport.h | 44 sal/osl/unx/nlsupport.hxx | 36 sal/osl/unx/osxlocale.cxx | 2 sal/osl/unx/pipe.c | 612 -------- sal/osl/unx/pipe.cxx | 612 ++++++++ sal/osl/unx/process.cxx | 17 sal/osl/unx/process_impl.cxx | 4 sal/osl/unx/procimpl.h | 43 sal/osl/unx/profile.cxx | 4 sal/osl/unx/readwrite_helper.c | 69 sal/osl/unx/readwrite_helper.cxx | 69 sal/osl/unx/readwrite_helper.h | 33 sal/osl/unx/readwrite_helper.hxx | 24 sal/osl/unx/salinit.cxx | 2 sal/osl/unx/saltime.h | 37 sal/osl/unx/saltime.hxx | 29 sal/osl/unx/secimpl.h | 42 sal/osl/unx/secimpl.hxx | 34 sal/osl/unx/security.cxx | 10 sal/osl/unx/socket.c | 2477 --------------------------------- sal/osl/unx/socket.cxx | 2477 +++++++++++++++++++++++++++++++++ sal/osl/unx/sockimpl.h | 67 sal/osl/unx/sockimpl.hxx | 59 sal/osl/unx/system.c | 312 ---- sal/osl/unx/system.cxx | 312 ++++ sal/osl/unx/tempfile.cxx | 2 sal/osl/unx/time.c | 321 ---- sal/osl/unx/time.cxx | 321 ++++ sal/osl/unx/uunxapi.cxx | 8 sal/osl/unx/uunxapi.h | 70 sal/osl/unx/uunxapi.hxx | 36 58 files changed, 5616 insertions(+), 5777 deletions(-)
New commits: commit 9a038e5e7b89822fb39064f63367be292999f8ea Author: Stephan Bergmann <[email protected]> Date: Wed Nov 19 13:01:08 2014 +0100 Fold uunxapi.h into uunxapi.hxx Change-Id: Ic16758e436da13684320e7e3bf07b80d8d8c7c5d diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx index 545c318..a8b004b 100644 --- a/sal/osl/unx/file.cxx +++ b/sal/osl/unx/file.cxx @@ -35,7 +35,7 @@ #include "file_error_transl.hxx" #include "file_impl.hxx" #include "file_url.hxx" -#include "uunxapi.h" +#include "uunxapi.hxx" #include <algorithm> #include <limits> diff --git a/sal/osl/unx/process_impl.cxx b/sal/osl/unx/process_impl.cxx index b632d44..749bfc0 100644 --- a/sal/osl/unx/process_impl.cxx +++ b/sal/osl/unx/process_impl.cxx @@ -33,7 +33,7 @@ #include "file_path_helper.h" -#include "uunxapi.h" +#include "uunxapi.hxx" #include "getexecutablefile.hxx" #include "nlsupport.hxx" diff --git a/sal/osl/unx/uunxapi.cxx b/sal/osl/unx/uunxapi.cxx index 995b936..c28491c 100644 --- a/sal/osl/unx/uunxapi.cxx +++ b/sal/osl/unx/uunxapi.cxx @@ -19,7 +19,7 @@ #include <config_features.h> -#include "uunxapi.h" +#include "uunxapi.hxx" #include "system.h" #include <limits.h> #include <rtl/ustring.hxx> @@ -186,19 +186,19 @@ int access_u(const rtl_uString* pustrPath, int mode) return result; } -sal_Bool realpath_u(const rtl_uString* pustrFileName, rtl_uString** ppustrResolvedName) +bool realpath_u(const rtl_uString* pustrFileName, rtl_uString** ppustrResolvedName) { rtl::OString fn = OUStringToOString(pustrFileName); #ifdef ANDROID if (fn == "/assets" || fn.startsWith("/assets/")) { if (access_u(pustrFileName, F_OK) == -1) - return sal_False; + return false; rtl_uString silly(*pustrFileName); rtl_uString_assign(ppustrResolvedName, &silly); - return sal_True; + return true; } #endif diff --git a/sal/osl/unx/uunxapi.h b/sal/osl/unx/uunxapi.h deleted file mode 100644 index 76b5e41..0000000 --- a/sal/osl/unx/uunxapi.h +++ /dev/null @@ -1,70 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SAL_OSL_UNX_UUNXAPI_H -#define INCLUDED_SAL_OSL_UNX_UUNXAPI_H - -#include <unistd.h> -#include <stdlib.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <rtl/ustring.h> - -#ifdef __cplusplus -extern "C" -{ -#endif - -int access_u(const rtl_uString* pustrPath, int mode); - -/*********************************** - @descr - The return value differs from the - realpath function - - @returns sal_True on success else - sal_False - - @see realpath - **********************************/ -sal_Bool realpath_u( - const rtl_uString* pustrFileName, - rtl_uString** ppustrResolvedName); - -int stat_c(const char *cpPath, struct stat* buf); - -int lstat_c(const char *cpPath, struct stat* buf); - -int lstat_u(const rtl_uString* pustrPath, struct stat* buf); - -int mkdir_u(const rtl_uString* path, mode_t mode); - -int open_c(const char *cpPath, int oflag, int mode); - -int utime_c(const char *cpPath, struct utimbuf *times); - -int ftruncate_with_name(int fd, sal_uInt64 uSize, rtl_String* path); - -#ifdef __cplusplus -} -#endif - -#endif // INCLUDED_SAL_OSL_UNX_UUNXAPI_H - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sal/osl/unx/uunxapi.hxx b/sal/osl/unx/uunxapi.hxx index fbacb83..4be4fbb 100644 --- a/sal/osl/unx/uunxapi.hxx +++ b/sal/osl/unx/uunxapi.hxx @@ -20,10 +20,44 @@ #ifndef INCLUDED_SAL_OSL_UNX_UUNXAPI_HXX #define INCLUDED_SAL_OSL_UNX_UUNXAPI_HXX -#include "uunxapi.h" +#include <unistd.h> +#include <stdlib.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <rtl/ustring.h> #include <rtl/ustring.hxx> +int access_u(const rtl_uString* pustrPath, int mode); + +/*********************************** + @descr + The return value differs from the + realpath function + + @returns sal_True on success else + sal_False + + @see realpath + **********************************/ +bool realpath_u( + const rtl_uString* pustrFileName, + rtl_uString** ppustrResolvedName); + +int stat_c(const char *cpPath, struct stat* buf); + +int lstat_c(const char *cpPath, struct stat* buf); + +int lstat_u(const rtl_uString* pustrPath, struct stat* buf); + +int mkdir_u(const rtl_uString* path, mode_t mode); + +int open_c(const char *cpPath, int oflag, int mode); + +int utime_c(const char *cpPath, struct utimbuf *times); + +int ftruncate_with_name(int fd, sal_uInt64 uSize, rtl_String* path); + namespace osl { inline int access(const rtl::OUString& ustrPath, int mode) commit 7b778239473f5f5eb033296828fce85c696b856b Author: Stephan Bergmann <[email protected]> Date: Wed Nov 19 12:56:33 2014 +0100 sockimpl.h -> sockimpl.hxx Change-Id: Ic11f5e0923b8b9d656b74b900f52ff154bb65971 diff --git a/sal/osl/unx/pipe.cxx b/sal/osl/unx/pipe.cxx index 654038f..12e9b6a 100644 --- a/sal/osl/unx/pipe.cxx +++ b/sal/osl/unx/pipe.cxx @@ -27,7 +27,7 @@ #include <rtl/ustring.h> #include <rtl/bootstrap.h> -#include "sockimpl.h" +#include "sockimpl.hxx" #include "secimpl.hxx" #define PIPEDEFAULTPATH "/tmp" @@ -97,10 +97,10 @@ oslPipe __osl_createPipeImpl(void) if (pPipeImpl == NULL) return NULL; pPipeImpl->m_nRefCount =1; - pPipeImpl->m_bClosed = sal_False; + pPipeImpl->m_bClosed = false; #if defined(LINUX) - pPipeImpl->m_bIsInShutdown = sal_False; - pPipeImpl->m_bIsAccepting = sal_False; + pPipeImpl->m_bIsInShutdown = false; + pPipeImpl->m_bIsAccepting = false; #endif return pPipeImpl; } @@ -386,7 +386,7 @@ void SAL_CALL osl_closePipe( oslPipe pPipe ) #if defined(LINUX) if ( pPipe->m_bIsAccepting ) { - pPipe->m_bIsInShutdown = sal_True; + pPipe->m_bIsInShutdown = true; pPipe->m_Socket = -1; fd = socket(AF_UNIX, SOCK_STREAM, 0); if ( fd < 0 ) @@ -427,7 +427,7 @@ void SAL_CALL osl_closePipe( oslPipe pPipe ) { unlink(pPipe->m_Name); } - pPipe->m_bClosed = sal_True; + pPipe->m_bClosed = true; /* OSL_TRACE("Out osl_destroyPipe"); */ } @@ -446,13 +446,13 @@ oslPipe SAL_CALL osl_acceptPipe(oslPipe pPipe) OSL_ASSERT(strlen(pPipe->m_Name) > 0); #if defined(LINUX) - pPipe->m_bIsAccepting = sal_True; + pPipe->m_bIsAccepting = true; #endif s = accept(pPipe->m_Socket, NULL, NULL); #if defined(LINUX) - pPipe->m_bIsAccepting = sal_False; + pPipe->m_bIsAccepting = false; #endif if (s < 0) diff --git a/sal/osl/unx/process.cxx b/sal/osl/unx/process.cxx index e4977e7..57af42b 100644 --- a/sal/osl/unx/process.cxx +++ b/sal/osl/unx/process.cxx @@ -59,7 +59,7 @@ #include "createfilehandlefromfd.hxx" #include "file_url.hxx" #include "readwrite_helper.hxx" -#include "sockimpl.h" +#include "sockimpl.hxx" #include "secimpl.hxx" #define MAX_ARGS 255 diff --git a/sal/osl/unx/socket.cxx b/sal/osl/unx/socket.cxx index b8ac5ea..4e65858 100644 --- a/sal/osl/unx/socket.cxx +++ b/sal/osl/unx/socket.cxx @@ -29,7 +29,7 @@ #include <ctype.h> #include <sal/types.h> -#include "sockimpl.h" +#include "sockimpl.hxx" /* defines for poll */ #ifdef HAVE_POLL_H @@ -448,7 +448,7 @@ oslSocket __osl_createSocketImpl(int Socket) pSocket->m_nRefCount = 1; #if defined(LINUX) - pSocket->m_bIsAccepting = sal_False; + pSocket->m_bIsAccepting = false; #endif #if OSL_DEBUG_LEVEL > 1 @@ -1362,7 +1362,7 @@ void SAL_CALL osl_releaseSocket( oslSocket pSocket ) if( pSocket && 0 == osl_atomic_decrement( &(pSocket->m_nRefCount) ) ) { #if defined(LINUX) - if ( pSocket->m_bIsAccepting == sal_True ) + if ( pSocket->m_bIsAccepting ) { OSL_FAIL("osl_destroySocket : attempt to destroy socket while accepting\n"); return; @@ -1391,9 +1391,9 @@ void SAL_CALL osl_closeSocket(oslSocket pSocket) pSocket->m_Socket = OSL_INVALID_SOCKET; #if defined(LINUX) - pSocket->m_bIsInShutdown = sal_True; + pSocket->m_bIsInShutdown = true; - if ( pSocket->m_bIsAccepting == sal_True ) + if ( pSocket->m_bIsAccepting ) { int nConnFD; union { @@ -1430,7 +1430,7 @@ void SAL_CALL osl_closeSocket(oslSocket pSocket) close(nConnFD); } } - pSocket->m_bIsAccepting = sal_False; + pSocket->m_bIsAccepting = false; } #endif /* LINUX */ @@ -1688,7 +1688,7 @@ oslSocket SAL_CALL osl_acceptConnectionOnSocket(oslSocket pSocket, pSocket->m_nLastError=0; #if defined(LINUX) - pSocket->m_bIsAccepting = sal_True; + pSocket->m_bIsAccepting = true; #endif /* LINUX */ if( ppAddr && *ppAddr ) @@ -1710,7 +1710,7 @@ oslSocket SAL_CALL osl_acceptConnectionOnSocket(oslSocket pSocket, OSL_TRACE("osl_acceptConnectionOnSocket : accept error '%s'",strerror(errno)); #if defined(LINUX) - pSocket->m_bIsAccepting = sal_False; + pSocket->m_bIsAccepting = false; #endif /* LINUX */ return 0; } @@ -1718,7 +1718,7 @@ oslSocket SAL_CALL osl_acceptConnectionOnSocket(oslSocket pSocket, OSL_ASSERT(AddrLen == sizeof(struct sockaddr)); #if defined(LINUX) - if ( pSocket->m_bIsInShutdown == sal_True ) + if ( pSocket->m_bIsInShutdown ) { close(Connection); OSL_TRACE("osl_acceptConnectionOnSocket : close while accept"); @@ -1751,9 +1751,9 @@ oslSocket SAL_CALL osl_acceptConnectionOnSocket(oslSocket pSocket, pConnectionSockImpl->m_Socket = Connection; pConnectionSockImpl->m_nLastError = 0; #if defined(LINUX) - pConnectionSockImpl->m_bIsAccepting = sal_False; + pConnectionSockImpl->m_bIsAccepting = false; - pSocket->m_bIsAccepting = sal_False; + pSocket->m_bIsAccepting = false; #endif /* LINUX */ return pConnectionSockImpl; } diff --git a/sal/osl/unx/sockimpl.h b/sal/osl/unx/sockimpl.hxx similarity index 84% rename from sal/osl/unx/sockimpl.h rename to sal/osl/unx/sockimpl.hxx index cfcd1a4..993c850 100644 --- a/sal/osl/unx/sockimpl.h +++ b/sal/osl/unx/sockimpl.hxx @@ -17,24 +17,20 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef _OSL_SOCKETIMPL_H_ -#define _OSL_SOCKETIMPL_H_ +#ifndef INCLUDED_SAL_OSL_UNX_SOCKIMPL_HXX +#define INCLUDED_SAL_OSL_UNX_SOCKIMPL_HXX #include <osl/pipe.h> #include <osl/socket.h> #include <osl/interlck.h> -#ifdef __cplusplus -extern "C" { -#endif - struct oslSocketImpl { int m_Socket; int m_nLastError; oslInterlockedCount m_nRefCount; #if defined(LINUX) - sal_Bool m_bIsAccepting; - sal_Bool m_bIsInShutdown; + bool m_bIsAccepting; + bool m_bIsInShutdown; #endif }; @@ -48,20 +44,16 @@ struct oslPipeImpl { int m_Socket; sal_Char m_Name[PATH_MAX + 1]; oslInterlockedCount m_nRefCount; - sal_Bool m_bClosed; + bool m_bClosed; #if defined(LINUX) - sal_Bool m_bIsAccepting; - sal_Bool m_bIsInShutdown; + bool m_bIsAccepting; + bool m_bIsInShutdown; #endif }; oslSocket __osl_createSocketImpl(int Socket); void __osl_destroySocketImpl(oslSocket pImpl); -#ifdef __cplusplus -} -#endif - #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit 5ce93720374c26611fa4fcd11997ebd8536e4ce2 Author: Stephan Bergmann <[email protected]> Date: Wed Nov 19 12:52:34 2014 +0100 secimpl.h -> secimpl.hxx Change-Id: I0fb87c5658bd02e327df8fdf3e0aa79f20bbc111 diff --git a/sal/osl/unx/pipe.cxx b/sal/osl/unx/pipe.cxx index ec78c2a..654038f 100644 --- a/sal/osl/unx/pipe.cxx +++ b/sal/osl/unx/pipe.cxx @@ -28,7 +28,7 @@ #include <rtl/bootstrap.h> #include "sockimpl.h" -#include "secimpl.h" +#include "secimpl.hxx" #define PIPEDEFAULTPATH "/tmp" #define PIPEALTERNATEPATH "/var/tmp" diff --git a/sal/osl/unx/process.cxx b/sal/osl/unx/process.cxx index c6b9d9c..e4977e7 100644 --- a/sal/osl/unx/process.cxx +++ b/sal/osl/unx/process.cxx @@ -60,7 +60,7 @@ #include "file_url.hxx" #include "readwrite_helper.hxx" #include "sockimpl.h" -#include "secimpl.h" +#include "secimpl.hxx" #define MAX_ARGS 255 #define MAX_ENVS 255 diff --git a/sal/osl/unx/secimpl.h b/sal/osl/unx/secimpl.hxx similarity index 83% rename from sal/osl/unx/secimpl.h rename to sal/osl/unx/secimpl.hxx index a7cadeb..7726d24 100644 --- a/sal/osl/unx/secimpl.h +++ b/sal/osl/unx/secimpl.hxx @@ -17,25 +17,17 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef _OSL_SECURITYIMPL_H_ -#define _OSL_SECURITYIMPL_H_ +#ifndef INCLUDED_SAL_OSL_UNX_SECIMPL_HXX +#define INCLUDED_SAL_OSL_UNX_SECIMPL_HXX #include <pwd.h> -#ifdef __cplusplus -extern "C" { -#endif - typedef struct _oslSecurityImpl { struct passwd m_pPasswd; char m_buffer[1]; /* should be a C99 flexible array member */ } oslSecurityImpl; -sal_Bool SAL_CALL osl_psz_getUserIdent(oslSecurity Security, sal_Char *pszIdent, sal_uInt32 nMax); - -#ifdef __cplusplus -} -#endif +bool SAL_CALL osl_psz_getUserIdent(oslSecurity Security, sal_Char *pszIdent, sal_uInt32 nMax); #endif diff --git a/sal/osl/unx/security.cxx b/sal/osl/unx/security.cxx index 3dff654..3e67de7 100644 --- a/sal/osl/unx/security.cxx +++ b/sal/osl/unx/security.cxx @@ -42,7 +42,7 @@ #include <crypt.h> #endif -#include "secimpl.h" +#include "secimpl.hxx" #ifdef ANDROID #define getpwuid_r(uid, pwd, buf, buflen, result) (*(result) = getpwuid(uid), (*(result) ? (memcpy (buf, *(result), sizeof (struct passwd)), 0) : errno)) @@ -227,7 +227,7 @@ sal_Bool SAL_CALL osl_getUserIdent(oslSecurity Security, rtl_uString **ustrIdent return bRet; } -sal_Bool SAL_CALL osl_psz_getUserIdent(oslSecurity Security, sal_Char *pszIdent, sal_uInt32 nMax) +bool SAL_CALL osl_psz_getUserIdent(oslSecurity Security, sal_Char *pszIdent, sal_uInt32 nMax) { sal_Char buffer[32]; sal_Int32 nChr; @@ -235,15 +235,15 @@ sal_Bool SAL_CALL osl_psz_getUserIdent(oslSecurity Security, sal_Char *pszIdent, oslSecurityImpl *pSecImpl = (oslSecurityImpl *)Security; if (pSecImpl == NULL) - return sal_False; + return false; nChr = snprintf(buffer, sizeof(buffer), "%u", pSecImpl->m_pPasswd.pw_uid); if ( nChr < 0 || sal::static_int_cast<sal_uInt32>(nChr) >= sizeof(buffer) || sal::static_int_cast<sal_uInt32>(nChr) >= nMax ) - return sal_False; /* leave *pszIdent unmodified in case of failure */ + return false; /* leave *pszIdent unmodified in case of failure */ memcpy(pszIdent, buffer, nChr+1); - return sal_True; + return true; } sal_Bool SAL_CALL osl_getUserName(oslSecurity Security, rtl_uString **ustrName) commit 299a8a50d30465d6a93b0992aaf74944404da585 Author: Stephan Bergmann <[email protected]> Date: Wed Nov 19 12:49:49 2014 +0100 saltime.h -> saltime.hxx Change-Id: I930c581525ed5b02dd8850e9781b01eed12c857f diff --git a/sal/osl/unx/salinit.cxx b/sal/osl/unx/salinit.cxx index 832fa8b..64ca6e6 100644 --- a/sal/osl/unx/salinit.cxx +++ b/sal/osl/unx/salinit.cxx @@ -32,7 +32,7 @@ #include "sal/main.h" #include "sal/types.h" -#include <saltime.h> +#include <saltime.hxx> #if HAVE_SYSLOG_H #include <string.h> diff --git a/sal/osl/unx/saltime.h b/sal/osl/unx/saltime.hxx similarity index 86% rename from sal/osl/unx/saltime.h rename to sal/osl/unx/saltime.hxx index 735be78..e72e09b 100644 --- a/sal/osl/unx/saltime.h +++ b/sal/osl/unx/saltime.hxx @@ -17,21 +17,13 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_SAL_OSL_UNX_SALTIME_H -#define INCLUDED_SAL_OSL_UNX_SALTIME_H +#ifndef INCLUDED_SAL_OSL_UNX_SALTIME_HXX +#define INCLUDED_SAL_OSL_UNX_SALTIME_HXX #include <sal/config.h> -#if defined __cplusplus -extern "C" { -#endif - void sal_initGlobalTimer(void); -#if defined __cplusplus -} -#endif - #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sal/osl/unx/time.cxx b/sal/osl/unx/time.cxx index c474af6..aba39d5 100644 --- a/sal/osl/unx/time.cxx +++ b/sal/osl/unx/time.cxx @@ -19,7 +19,7 @@ #include <sal/config.h> -#include "saltime.h" +#include "saltime.hxx" #include "system.h" #include <osl/diagnose.h> commit e5f0aceba796b6ebb84ab1b4a8fde3267e6d3e8d Author: Stephan Bergmann <[email protected]> Date: Wed Nov 19 12:48:05 2014 +0100 readwrite_helper.h -> readwrite_helper.hxx Change-Id: If0d71f0660d60e3bcea4db3906ffe600e00f69f2 diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx index b0fb22a..658e0a6 100644 --- a/sal/osl/unx/file_misc.cxx +++ b/sal/osl/unx/file_misc.cxx @@ -32,7 +32,7 @@ #include "file_path_helper.hxx" #include "file_url.hxx" #include "uunxapi.hxx" -#include "readwrite_helper.h" +#include "readwrite_helper.hxx" #include <sys/types.h> #include <errno.h> diff --git a/sal/osl/unx/process.cxx b/sal/osl/unx/process.cxx index 7b6ec07..c6b9d9c 100644 --- a/sal/osl/unx/process.cxx +++ b/sal/osl/unx/process.cxx @@ -58,7 +58,7 @@ #include "createfilehandlefromfd.hxx" #include "file_url.hxx" -#include "readwrite_helper.h" +#include "readwrite_helper.hxx" #include "sockimpl.h" #include "secimpl.h" diff --git a/sal/osl/unx/profile.cxx b/sal/osl/unx/profile.cxx index d9f4402..a47bdbc 100644 --- a/sal/osl/unx/profile.cxx +++ b/sal/osl/unx/profile.cxx @@ -18,7 +18,7 @@ */ #include "system.h" -#include "readwrite_helper.h" +#include "readwrite_helper.hxx" #include "file_url.hxx" #include <osl/diagnose.h> diff --git a/sal/osl/unx/readwrite_helper.cxx b/sal/osl/unx/readwrite_helper.cxx index 93640cc..9497128 100644 --- a/sal/osl/unx/readwrite_helper.cxx +++ b/sal/osl/unx/readwrite_helper.cxx @@ -7,12 +7,12 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "readwrite_helper.h" +#include "readwrite_helper.hxx" #include <osl/diagnose.h> #include <system.h> -sal_Bool safeWrite(int fd, void* data, sal_uInt32 dataSize) +bool safeWrite(int fd, void* data, sal_uInt32 dataSize) { sal_Int32 nToWrite = dataSize; unsigned char* dataToWrite = static_cast<unsigned char *>(data); @@ -25,7 +25,7 @@ sal_Bool safeWrite(int fd, void* data, sal_uInt32 dataSize) if ( errno == EINTR ) continue; - return sal_False; + return false; } @@ -34,10 +34,10 @@ sal_Bool safeWrite(int fd, void* data, sal_uInt32 dataSize) dataToWrite += nWritten; } - return sal_True; + return true; } -sal_Bool safeRead( int fd, void* buffer, sal_uInt32 count ) +bool safeRead( int fd, void* buffer, sal_uInt32 count ) { sal_Int32 nToRead = count; unsigned char* bufferForReading = static_cast<unsigned char *>(buffer); @@ -51,19 +51,19 @@ sal_Bool safeRead( int fd, void* buffer, sal_uInt32 count ) if (errno == EINTR) continue; - return sal_False; + return false; } // If we reach the EOF, we consider this a partial transfer and thus // an error. if ( nRead == 0 ) - return sal_False; + return false; nToRead -= nRead; bufferForReading += nRead; } - return sal_True; + return true; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sal/osl/unx/readwrite_helper.h b/sal/osl/unx/readwrite_helper.hxx similarity index 68% rename from sal/osl/unx/readwrite_helper.h rename to sal/osl/unx/readwrite_helper.hxx index 78e1e8d..9ffebe5 100644 --- a/sal/osl/unx/readwrite_helper.h +++ b/sal/osl/unx/readwrite_helper.hxx @@ -7,26 +7,17 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#ifndef INCLUDED_SAL_OSL_UNX_READWRITE_HELPER_H -#define INCLUDED_SAL_OSL_UNX_READWRITE_HELPER_H +#ifndef INCLUDED_SAL_OSL_UNX_READWRITE_HELPER_HXX +#define INCLUDED_SAL_OSL_UNX_READWRITE_HELPER_HXX #include <sal/types.h> -#ifdef __cplusplus -extern "C" -{ -#endif - -sal_Bool safeWrite( int fd, void* data, sal_uInt32 dataSize ); +bool safeWrite( int fd, void* data, sal_uInt32 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. -sal_Bool safeRead( int fd, void* buffer, sal_uInt32 count ); - -#ifdef __cplusplus -} -#endif +bool safeRead( int fd, void* buffer, sal_uInt32 count ); #endif commit 93d550d9e08bd0f38852a7df3cd47dc460d86b1a Author: Stephan Bergmann <[email protected]> Date: Wed Nov 19 12:45:24 2014 +0100 Fold procimpl.h into process.cxx Change-Id: I1adcaeea7a1a3f7a3634897821f15443dbc78e94 diff --git a/sal/osl/unx/process.cxx b/sal/osl/unx/process.cxx index 5429d7a..7b6ec07 100644 --- a/sal/osl/unx/process.cxx +++ b/sal/osl/unx/process.cxx @@ -46,6 +46,7 @@ #endif #include <osl/diagnose.h> #include <osl/mutex.h> +#include <osl/process.h> #include <osl/conditn.h> #include <osl/thread.h> #include <osl/file.h> @@ -57,7 +58,6 @@ #include "createfilehandlefromfd.hxx" #include "file_url.hxx" -#include "procimpl.h" #include "readwrite_helper.h" #include "sockimpl.h" #include "secimpl.h" @@ -68,6 +68,13 @@ namespace { +struct oslProcessImpl { + pid_t m_pid; + oslCondition m_terminated; + int m_status; + oslProcessImpl* m_pnext; +}; + struct ProcessData { const sal_Char* m_pszArgs[MAX_ARGS + 1]; diff --git a/sal/osl/unx/procimpl.h b/sal/osl/unx/procimpl.h deleted file mode 100644 index 37b5cce..0000000 --- a/sal/osl/unx/procimpl.h +++ /dev/null @@ -1,43 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef _OSL_PROCIMPL_H_ -#define _OSL_PROCIMPL_H_ - -#include <osl/process.h> -#include <osl/conditn.h> - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct _oslProcessImpl { - pid_t m_pid; - oslCondition m_terminated; - int m_status; - struct _oslProcessImpl* m_pnext; -} oslProcessImpl; - -#ifdef __cplusplus -} -#endif - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit d90784064f9b993c044615a8bb0fb7ae984d0ded Author: Stephan Bergmann <[email protected]> Date: Wed Nov 19 12:41:46 2014 +0100 nlsupport.h -> nlsupport.hxx Change-Id: Iaee3f8a43cba1d4fd02b6a51d42f73c8ef9e99b7 diff --git a/sal/osl/unx/nlsupport.cxx b/sal/osl/unx/nlsupport.cxx index 7e0eee8..03107ef 100644 --- a/sal/osl/unx/nlsupport.cxx +++ b/sal/osl/unx/nlsupport.cxx @@ -21,7 +21,7 @@ #include <osl/diagnose.h> #include <osl/process.h> -#include "nlsupport.h" +#include "nlsupport.hxx" #if defined(LINUX) || defined(SOLARIS) || defined(NETBSD) || \ defined(FREEBSD) || defined(MACOSX) || defined(IOS) || defined(OPENBSD) || \ diff --git a/sal/osl/unx/nlsupport.h b/sal/osl/unx/nlsupport.hxx similarity index 88% rename from sal/osl/unx/nlsupport.h rename to sal/osl/unx/nlsupport.hxx index 6e24385..676c00c 100644 --- a/sal/osl/unx/nlsupport.h +++ b/sal/osl/unx/nlsupport.hxx @@ -17,17 +17,13 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_SAL_OSL_UNX_NLSUPPORT_H -#define INCLUDED_SAL_OSL_UNX_NLSUPPORT_H +#ifndef INCLUDED_SAL_OSL_UNX_NLSUPPORT_HXX +#define INCLUDED_SAL_OSL_UNX_NLSUPPORT_HXX #include <sal/config.h> #include <rtl/locale.h> -#if defined __cplusplus -extern "C" { -#endif - void _imp_getProcessLocale( rtl_Locale ** ); int _imp_setProcessLocale( rtl_Locale * ); @@ -35,10 +31,6 @@ int _imp_setProcessLocale( rtl_Locale * ); int macosx_getLocale(char *locale, sal_uInt32 bufferLen); #endif -#if defined __cplusplus -} -#endif - #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sal/osl/unx/osxlocale.cxx b/sal/osl/unx/osxlocale.cxx index a64238e..d2fbdb5 100644 --- a/sal/osl/unx/osxlocale.cxx +++ b/sal/osl/unx/osxlocale.cxx @@ -27,7 +27,7 @@ #include <CoreFoundation/CoreFoundation.h> #include <postmac.h> -#include <nlsupport.h> +#include <nlsupport.hxx> namespace { diff --git a/sal/osl/unx/process_impl.cxx b/sal/osl/unx/process_impl.cxx index c70e111..b632d44 100644 --- a/sal/osl/unx/process_impl.cxx +++ b/sal/osl/unx/process_impl.cxx @@ -35,7 +35,7 @@ #include "uunxapi.h" #include "getexecutablefile.hxx" -#include "nlsupport.h" +#include "nlsupport.hxx" #ifdef ANDROID #include <osl/detail/android-bootstrap.h> commit 69770c9791590d45d24cfa100ab89e70e7e6b312 Author: Stephan Bergmann <[email protected]> Date: Wed Nov 19 12:39:54 2014 +0100 file_url.h -> file_url.hxx Change-Id: I2494779521d56edcab41f66a7c64e7dc5a9205ad diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx index e703036..545c318 100644 --- a/sal/osl/unx/file.cxx +++ b/sal/osl/unx/file.cxx @@ -34,7 +34,7 @@ #include "createfilehandlefromfd.hxx" #include "file_error_transl.hxx" #include "file_impl.hxx" -#include "file_url.h" +#include "file_url.hxx" #include "uunxapi.h" #include <algorithm> diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx index 300514c..b0fb22a 100644 --- a/sal/osl/unx/file_misc.cxx +++ b/sal/osl/unx/file_misc.cxx @@ -30,7 +30,7 @@ #include "file_impl.hxx" #include "file_error_transl.hxx" #include "file_path_helper.hxx" -#include "file_url.h" +#include "file_url.hxx" #include "uunxapi.hxx" #include "readwrite_helper.h" diff --git a/sal/osl/unx/file_stat.cxx b/sal/osl/unx/file_stat.cxx index bf2e92e..c589e40 100644 --- a/sal/osl/unx/file_stat.cxx +++ b/sal/osl/unx/file_stat.cxx @@ -31,7 +31,7 @@ #include "file_impl.hxx" #include "file_error_transl.hxx" #include "file_path_helper.hxx" -#include "file_url.h" +#include "file_url.hxx" #include "uunxapi.hxx" namespace diff --git a/sal/osl/unx/file_url.cxx b/sal/osl/unx/file_url.cxx index 1832fd6..6b1cca2 100644 --- a/sal/osl/unx/file_url.cxx +++ b/sal/osl/unx/file_url.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "file_url.h" +#include "file_url.hxx" #include "system.h" diff --git a/sal/osl/unx/file_url.h b/sal/osl/unx/file_url.hxx similarity index 87% rename from sal/osl/unx/file_url.h rename to sal/osl/unx/file_url.hxx index 1016863..d087638 100644 --- a/sal/osl/unx/file_url.h +++ b/sal/osl/unx/file_url.hxx @@ -17,16 +17,11 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_SAL_OSL_UNX_FILE_URL_H -#define INCLUDED_SAL_OSL_UNX_FILE_URL_H +#ifndef INCLUDED_SAL_OSL_UNX_FILE_URL_HXX +#define INCLUDED_SAL_OSL_UNX_FILE_URL_HXX #include "osl/file.h" -#ifdef __cplusplus -extern "C" -{ -#endif - oslFileError osl_getSystemPathFromFileURL_Ex(rtl_uString *ustrFileURL, rtl_uString **pustrSystemPath); oslFileError FileURLToPath(char * buffer, size_t bufLen, rtl_uString* ustrFileURL); @@ -35,10 +30,6 @@ int UnicodeToText(char * buffer, size_t bufLen, const sal_Unicode * uniText, sal int TextToUnicode(const char* text, size_t text_buffer_size, sal_Unicode* unic_text, sal_Int32 unic_text_buffer_size); -#ifdef __cplusplus -} #endif -#endif /* #define INCLUDED_SAL_OSL_UNX_FILE_URL_H */ - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sal/osl/unx/file_volume.cxx b/sal/osl/unx/file_volume.cxx index ee225d2..c530eb0 100644 --- a/sal/osl/unx/file_volume.cxx +++ b/sal/osl/unx/file_volume.cxx @@ -24,7 +24,7 @@ #include "rtl/alloc.h" #include "file_error_transl.hxx" -#include "file_url.h" +#include "file_url.hxx" #include "system.h" #include <errno.h> diff --git a/sal/osl/unx/module.cxx b/sal/osl/unx/module.cxx index c6ae0c0..cb0e763 100644 --- a/sal/osl/unx/module.cxx +++ b/sal/osl/unx/module.cxx @@ -27,7 +27,7 @@ #include <osl/file.h> #include <assert.h> #include "system.h" -#include "file_url.h" +#include "file_url.hxx" #ifdef AIX #include <sys/ldr.h> diff --git a/sal/osl/unx/process.cxx b/sal/osl/unx/process.cxx index e973202..5429d7a 100644 --- a/sal/osl/unx/process.cxx +++ b/sal/osl/unx/process.cxx @@ -56,7 +56,7 @@ #include <grp.h> #include "createfilehandlefromfd.hxx" -#include "file_url.h" +#include "file_url.hxx" #include "procimpl.h" #include "readwrite_helper.h" #include "sockimpl.h" diff --git a/sal/osl/unx/profile.cxx b/sal/osl/unx/profile.cxx index 2187427..d9f4402 100644 --- a/sal/osl/unx/profile.cxx +++ b/sal/osl/unx/profile.cxx @@ -19,7 +19,7 @@ #include "system.h" #include "readwrite_helper.h" -#include "file_url.h" +#include "file_url.hxx" #include <osl/diagnose.h> #include <osl/profile.h> diff --git a/sal/osl/unx/tempfile.cxx b/sal/osl/unx/tempfile.cxx index bbe3c27..204535c 100644 --- a/sal/osl/unx/tempfile.cxx +++ b/sal/osl/unx/tempfile.cxx @@ -29,7 +29,7 @@ #include <osl/diagnose.h> #include <sal/macros.h> -#include "file_url.h" +#include "file_url.hxx" #include "file_impl.hxx" oslFileError SAL_CALL osl_getTempDirURL( rtl_uString** pustrTempDir ) commit 8480c1830f30a7986c9b693de385245173355fae Author: Stephan Bergmann <[email protected]> Date: Wed Nov 19 12:36:59 2014 +0100 file_error_transl.h -> file_error_transl.hxx Change-Id: Ia71097a3d0fbeb606b1f6cfb7e6edb86bd45082a diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx index b592151..e703036 100644 --- a/sal/osl/unx/file.cxx +++ b/sal/osl/unx/file.cxx @@ -32,7 +32,7 @@ #include "system.h" #include "createfilehandlefromfd.hxx" -#include "file_error_transl.h" +#include "file_error_transl.hxx" #include "file_impl.hxx" #include "file_url.h" #include "uunxapi.h" diff --git a/sal/osl/unx/file_error_transl.cxx b/sal/osl/unx/file_error_transl.cxx index 4207746..bdeed9b 100644 --- a/sal/osl/unx/file_error_transl.cxx +++ b/sal/osl/unx/file_error_transl.cxx @@ -18,16 +18,16 @@ */ #include <errno.h> -#include "file_error_transl.h" +#include "file_error_transl.hxx" #include <osl/diagnose.h> -oslFileError oslTranslateFileError(sal_Bool bIsError, int Errno) +oslFileError oslTranslateFileError(bool bIsError, int Errno) { oslFileError osl_error = osl_File_E_invalidError; OSL_ENSURE((bIsError && (0 != Errno)) || (!bIsError && (0 == Errno)), "oslTranslateFileError strange input combination!"); - /* Have a look at file_error_transl.h for + /* Have a look at file_error_transl.hxx for the reason that we do this here */ if (bIsError && (0 == Errno)) return osl_error; diff --git a/sal/osl/unx/file_error_transl.h b/sal/osl/unx/file_error_transl.hxx similarity index 84% rename from sal/osl/unx/file_error_transl.h rename to sal/osl/unx/file_error_transl.hxx index 2548dea..33f282b 100644 --- a/sal/osl/unx/file_error_transl.h +++ b/sal/osl/unx/file_error_transl.hxx @@ -17,17 +17,12 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_SAL_OSL_UNX_FILE_ERROR_TRANSL_H -#define INCLUDED_SAL_OSL_UNX_FILE_ERROR_TRANSL_H +#ifndef INCLUDED_SAL_OSL_UNX_FILE_ERROR_TRANSL_HXX +#define INCLUDED_SAL_OSL_UNX_FILE_ERROR_TRANSL_HXX #include <osl/file.h> #include <sal/types.h> -#ifdef __cplusplus -extern "C" -{ -#endif - /********************************************* oslTranslateFileError Translate errno's to osl file errors @@ -49,14 +44,10 @@ extern "C" *********************************************/ -#define OSL_FET_SUCCESS sal_False -#define OSL_FET_ERROR sal_True +#define OSL_FET_SUCCESS false +#define OSL_FET_ERROR true -oslFileError oslTranslateFileError(sal_Bool bIsError, int Errno); - -#ifdef __cplusplus -} -#endif +oslFileError oslTranslateFileError(bool bIsError, int Errno); #endif diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx index 7873783..300514c 100644 --- a/sal/osl/unx/file_misc.cxx +++ b/sal/osl/unx/file_misc.cxx @@ -28,7 +28,7 @@ #include "system.h" #include "file_impl.hxx" -#include "file_error_transl.h" +#include "file_error_transl.hxx" #include "file_path_helper.hxx" #include "file_url.h" #include "uunxapi.hxx" diff --git a/sal/osl/unx/file_stat.cxx b/sal/osl/unx/file_stat.cxx index e35a50d..bf2e92e 100644 --- a/sal/osl/unx/file_stat.cxx +++ b/sal/osl/unx/file_stat.cxx @@ -29,7 +29,7 @@ #include <osl/diagnose.h> #include "file_impl.hxx" -#include "file_error_transl.h" +#include "file_error_transl.hxx" #include "file_path_helper.hxx" #include "file_url.h" #include "uunxapi.hxx" diff --git a/sal/osl/unx/file_url.cxx b/sal/osl/unx/file_url.cxx index dc3bf8e..1832fd6 100644 --- a/sal/osl/unx/file_url.cxx +++ b/sal/osl/unx/file_url.cxx @@ -37,7 +37,7 @@ #include <rtl/ustrbuf.h> #include "rtl/textcvt.h" -#include "file_error_transl.h" +#include "file_error_transl.hxx" #include "file_path_helper.hxx" #include "uunxapi.hxx" diff --git a/sal/osl/unx/file_volume.cxx b/sal/osl/unx/file_volume.cxx index c200217..ee225d2 100644 --- a/sal/osl/unx/file_volume.cxx +++ b/sal/osl/unx/file_volume.cxx @@ -23,7 +23,7 @@ #include "osl/thread.h" #include "rtl/alloc.h" -#include "file_error_transl.h" +#include "file_error_transl.hxx" #include "file_url.h" #include "system.h" commit e46712f4e87fc4f0fa5b1b7eed6a8a103a458af4 Author: Stephan Bergmann <[email protected]> Date: Wed Nov 19 12:31:51 2014 +0100 interlck.c -> interlck.cxx Change-Id: I90ca3ddbc2e1d4b830ec6e536e36e924ee14416a diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk index 3ae0dcb..a5ac8bc 100644 --- a/sal/Library_sal.mk +++ b/sal/Library_sal.mk @@ -206,7 +206,7 @@ $(eval $(call gb_Library_add_asmobjects,sal,\ sal/osl/unx/asm/interlck_sparc \ )) else -$(eval $(call gb_Library_add_cobjects,sal,\ +$(eval $(call gb_Library_add_exception_objects,sal,\ sal/osl/unx/interlck \ )) endif diff --git a/sal/osl/unx/interlck.c b/sal/osl/unx/interlck.cxx similarity index 100% rename from sal/osl/unx/interlck.c rename to sal/osl/unx/interlck.cxx commit dca434afb816ec0cda67bc6cbcea0147dc3ea32e Author: Stephan Bergmann <[email protected]> Date: Wed Nov 19 12:25:28 2014 +0100 time.c -> time.cxx Change-Id: If0f0e40964f7dc107e14753da49df5cdc77732be diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk index 0824410..3ae0dcb 100644 --- a/sal/Library_sal.mk +++ b/sal/Library_sal.mk @@ -173,10 +173,8 @@ $(eval $(call gb_Library_add_exception_objects,sal,\ sal/osl/unx/system \ sal/osl/unx/tempfile \ sal/osl/unx/thread \ - $(if $(filter DESKTOP,$(BUILD_TYPE)), sal/osl/unx/salinit) \ -)) -$(eval $(call gb_Library_add_cobjects,sal,\ sal/osl/unx/time \ + $(if $(filter DESKTOP,$(BUILD_TYPE)), sal/osl/unx/salinit) \ )) $(eval $(call gb_Library_add_cobject,sal,sal/osl/unx/signal, \ $(if $(ENABLE_CRASHDUMP),-DSAL_ENABLE_CRASH_REPORT) \ diff --git a/sal/osl/unx/time.c b/sal/osl/unx/time.cxx similarity index 100% rename from sal/osl/unx/time.c rename to sal/osl/unx/time.cxx commit 7b10a36f8dc2c27d881f5c47b404b2b22900ae5a Author: Stephan Bergmann <[email protected]> Date: Wed Nov 19 12:24:40 2014 +0100 system.c -> system.cxx Change-Id: I4629a01a67dd57d5915403a89da90e98b5184503 diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk index 85d7c19..0824410 100644 --- a/sal/Library_sal.mk +++ b/sal/Library_sal.mk @@ -170,12 +170,12 @@ $(eval $(call gb_Library_add_exception_objects,sal,\ sal/osl/unx/readwrite_helper \ sal/osl/unx/security \ sal/osl/unx/socket \ + sal/osl/unx/system \ sal/osl/unx/tempfile \ sal/osl/unx/thread \ $(if $(filter DESKTOP,$(BUILD_TYPE)), sal/osl/unx/salinit) \ )) $(eval $(call gb_Library_add_cobjects,sal,\ - sal/osl/unx/system \ sal/osl/unx/time \ )) $(eval $(call gb_Library_add_cobject,sal,sal/osl/unx/signal, \ diff --git a/sal/osl/unx/system.c b/sal/osl/unx/system.cxx similarity index 100% rename from sal/osl/unx/system.c rename to sal/osl/unx/system.cxx commit d0e7d020fa405ab94f19916ec96fbd4611da0031 Author: Stephan Bergmann <[email protected]> Date: Wed Nov 19 12:18:43 2014 +0100 socket.c -> socket.cxx (At least some glibc make FD_ISSET happen to be of type bool in C++, that's why we explicitly cast it to bool instead of comparing != 0 to avoid loplugin:implicitboolconversion; cf. <https://sourceware.org/ml/libc-help/2014-11/msg00018.html> "Type of FD_ISSET happens to be bool in C++.") Change-Id: I6da67620067392f5866d053b074198413da814b1 diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk index 6ae0d24..85d7c19 100644 --- a/sal/Library_sal.mk +++ b/sal/Library_sal.mk @@ -169,12 +169,12 @@ $(eval $(call gb_Library_add_exception_objects,sal,\ sal/osl/unx/profile \ sal/osl/unx/readwrite_helper \ sal/osl/unx/security \ + sal/osl/unx/socket \ sal/osl/unx/tempfile \ sal/osl/unx/thread \ $(if $(filter DESKTOP,$(BUILD_TYPE)), sal/osl/unx/salinit) \ )) $(eval $(call gb_Library_add_cobjects,sal,\ - sal/osl/unx/socket \ sal/osl/unx/system \ sal/osl/unx/time \ )) diff --git a/sal/osl/unx/socket.c b/sal/osl/unx/socket.cxx similarity index 99% rename from sal/osl/unx/socket.c rename to sal/osl/unx/socket.cxx index ceed56d..b8ac5ea 100644 --- a/sal/osl/unx/socket.c +++ b/sal/osl/unx/socket.cxx @@ -762,13 +762,13 @@ static sal_Char* _osl_getFullQualifiedDomainName (const sal_Char *pHostName) return pFullQualifiedName; } -static sal_Bool _osl_isFullQualifiedDomainName (const sal_Char *pHostName) +static bool _osl_isFullQualifiedDomainName (const sal_Char *pHostName) { /* a FQDN (aka 'hostname.domain.top_level_domain' ) * is a name which contains a dot '.' in it ( would * match as well for 'hostname.' but is good enough * for now )*/ - return (sal_Bool)( strchr( pHostName, (int)'.' ) != NULL ); + return strchr( pHostName, (int)'.' ) != NULL; } struct oslHostAddrImpl @@ -825,7 +825,7 @@ static oslHostAddr _osl_hostentToHostAddr (const struct hostent *he) /* future extensions for new families might be implemented here */ OSL_TRACE("_osl_hostentToHostAddr: unknown address family."); - OSL_ASSERT(sal_False); + OSL_ASSERT(false); __osl_destroySocketAddr( pSockAddr ); free (cn); @@ -1988,7 +1988,7 @@ sal_Int32 SAL_CALL osl_writeSocket( #ifdef HAVE_POLL_H /* poll() */ -sal_Bool __osl_socket_poll ( +bool __osl_socket_poll ( oslSocket pSocket, const TimeValue* pTimeout, short nEvent) @@ -1999,7 +1999,7 @@ sal_Bool __osl_socket_poll ( OSL_ASSERT(0 != pSocket); if (0 == pSocket) - return sal_False; /* EINVAL */ + return false; /* EINVAL */ pSocket->m_nLastError = 0; @@ -2021,12 +2021,12 @@ sal_Bool __osl_socket_poll ( pSocket->m_nLastError = errno; OSL_TRACE("__osl_socket_poll(): poll error: %d (%s)", errno, strerror(errno)); - return sal_False; + return false; } if (result == 0) { /* Timeout */ - return sal_False; + return false; } return ((fds.revents & nEvent) == nEvent); @@ -2431,7 +2431,7 @@ sal_Bool SAL_CALL osl_isInSocketSet(oslSocketSet Set, oslSocket pSocket) pSet= (TSocketSetImpl*)Set; - return (FD_ISSET(pSocket->m_Socket, &pSet->m_Set) != 0); + return bool(FD_ISSET(pSocket->m_Socket, &pSet->m_Set)); } sal_Int32 SAL_CALL osl_demultiplexSocketEvents(oslSocketSet IncomingSet, commit e814dacc817e3d2f82c5c6c705152293baeedfe4 Author: Stephan Bergmann <[email protected]> Date: Wed Nov 19 12:01:55 2014 +0100 readwrite_helper.c -> readwrite_helper.cxx Change-Id: I6d9f43a18e13cb291cb678b6faeeed7c0ec9de1a diff --git a/jurt/Library_jpipe.mk b/jurt/Library_jpipe.mk index 6d1512e..8cb8e58 100644 --- a/jurt/Library_jpipe.mk +++ b/jurt/Library_jpipe.mk @@ -48,11 +48,10 @@ else $(eval $(call gb_Library_add_cobjects,jpipe, \ jurt/source/pipe/com_sun_star_lib_connections_pipe_PipeConnection \ - jurt/source/pipe/staticsalhack_c \ )) $(eval $(call gb_Library_add_exception_objects,jpipe, \ - jurt/source/pipe/staticsalhack_cxx \ + jurt/source/pipe/staticsalhack \ )) $(eval $(call gb_Library_add_defs,jpipe, \ diff --git a/jurt/source/pipe/staticsalhack_cxx.cxx b/jurt/source/pipe/staticsalhack.cxx similarity index 92% rename from jurt/source/pipe/staticsalhack_cxx.cxx rename to jurt/source/pipe/staticsalhack.cxx index 7b056eb..b2c10d4 100644 --- a/jurt/source/pipe/staticsalhack_cxx.cxx +++ b/jurt/source/pipe/staticsalhack.cxx @@ -7,7 +7,11 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include <staticsalhack.h> +#define DISABLE_DYNLOADING +#define FORCE_SYSALLOC +#define NO_CHILD_PROCESSES +#undef SAL_LOG_INFO +#undef SAL_LOG_WARN #include <sal/rtl/string.cxx> #undef IMPL_RTL_EMPTYSTRING @@ -34,6 +38,7 @@ #include <sal/osl/unx/process.cxx> #include <sal/osl/unx/process_impl.cxx> #include <sal/osl/unx/profile.cxx> +#include <sal/osl/unx/readwrite_helper.cxx> #include <sal/osl/unx/security.cxx> #include <sal/osl/unx/thread.cxx> #include <sal/osl/unx/uunxapi.cxx> diff --git a/jurt/source/pipe/staticsalhack.h b/jurt/source/pipe/staticsalhack.h deleted file mode 100644 index f1dc083..0000000 --- a/jurt/source/pipe/staticsalhack.h +++ /dev/null @@ -1,16 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#define DISABLE_DYNLOADING -#define FORCE_SYSALLOC -#define NO_CHILD_PROCESSES -#undef SAL_LOG_INFO -#undef SAL_LOG_WARN - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/jurt/source/pipe/staticsalhack_c.c b/jurt/source/pipe/staticsalhack_c.c deleted file mode 100644 index 742b114..0000000 --- a/jurt/source/pipe/staticsalhack_c.c +++ /dev/null @@ -1,14 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#include <staticsalhack.h> - -#include <sal/osl/unx/readwrite_helper.c> - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk index 4bc6d08..6ae0d24 100644 --- a/sal/Library_sal.mk +++ b/sal/Library_sal.mk @@ -167,13 +167,13 @@ $(eval $(call gb_Library_add_exception_objects,sal,\ sal/osl/unx/process \ sal/osl/unx/process_impl \ sal/osl/unx/profile \ + sal/osl/unx/readwrite_helper \ sal/osl/unx/security \ sal/osl/unx/tempfile \ sal/osl/unx/thread \ $(if $(filter DESKTOP,$(BUILD_TYPE)), sal/osl/unx/salinit) \ )) $(eval $(call gb_Library_add_cobjects,sal,\ - sal/osl/unx/readwrite_helper \ sal/osl/unx/socket \ sal/osl/unx/system \ sal/osl/unx/time \ diff --git a/sal/osl/unx/readwrite_helper.c b/sal/osl/unx/readwrite_helper.cxx similarity index 92% rename from sal/osl/unx/readwrite_helper.c rename to sal/osl/unx/readwrite_helper.cxx index 347f632..93640cc 100644 --- a/sal/osl/unx/readwrite_helper.c +++ b/sal/osl/unx/readwrite_helper.cxx @@ -15,7 +15,7 @@ sal_Bool safeWrite(int fd, void* data, sal_uInt32 dataSize) { sal_Int32 nToWrite = dataSize; - unsigned char* dataToWrite = data; + unsigned char* dataToWrite = static_cast<unsigned char *>(data); // Check for overflow as we convert a signed to an unsigned. OSL_ASSERT(dataSize == (sal_uInt32)nToWrite); @@ -40,7 +40,7 @@ sal_Bool safeWrite(int fd, void* data, sal_uInt32 dataSize) sal_Bool safeRead( int fd, void* buffer, sal_uInt32 count ) { sal_Int32 nToRead = count; - unsigned char* bufferForReading = buffer; + unsigned char* bufferForReading = static_cast<unsigned char *>(buffer); // Check for overflow as we convert a signed to an unsigned. OSL_ASSERT(count == (sal_uInt32)nToRead); commit df451d6a539fdf3c7248e16203026bd8df423e53 Author: Stephan Bergmann <[email protected]> Date: Wed Nov 19 11:56:22 2014 +0100 pipe.c -> pipe.cxx Change-Id: I0c9659379e6120c0bf01b6436d3127b83ad01af1 diff --git a/jurt/source/pipe/staticsalhack_c.c b/jurt/source/pipe/staticsalhack_c.c index dd4dee6..742b114 100644 --- a/jurt/source/pipe/staticsalhack_c.c +++ b/jurt/source/pipe/staticsalhack_c.c @@ -9,7 +9,6 @@ #include <staticsalhack.h> -#include <sal/osl/unx/pipe.c> #include <sal/osl/unx/readwrite_helper.c> /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/jurt/source/pipe/staticsalhack_cxx.cxx b/jurt/source/pipe/staticsalhack_cxx.cxx index 0a9212c..7b056eb 100644 --- a/jurt/source/pipe/staticsalhack_cxx.cxx +++ b/jurt/source/pipe/staticsalhack_cxx.cxx @@ -30,6 +30,7 @@ #include <sal/osl/unx/module.cxx> #include <sal/osl/unx/mutex.cxx> #include <sal/osl/unx/nlsupport.cxx> +#include <sal/osl/unx/pipe.cxx> #include <sal/osl/unx/process.cxx> #include <sal/osl/unx/process_impl.cxx> #include <sal/osl/unx/profile.cxx> diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk index 6dfcfaa..4bc6d08 100644 --- a/sal/Library_sal.mk +++ b/sal/Library_sal.mk @@ -163,6 +163,7 @@ $(eval $(call gb_Library_add_exception_objects,sal,\ sal/osl/unx/module \ sal/osl/unx/mutex \ sal/osl/unx/nlsupport \ + sal/osl/unx/pipe \ sal/osl/unx/process \ sal/osl/unx/process_impl \ sal/osl/unx/profile \ @@ -172,7 +173,6 @@ $(eval $(call gb_Library_add_exception_objects,sal,\ $(if $(filter DESKTOP,$(BUILD_TYPE)), sal/osl/unx/salinit) \ )) $(eval $(call gb_Library_add_cobjects,sal,\ - sal/osl/unx/pipe \ sal/osl/unx/readwrite_helper \ sal/osl/unx/socket \ sal/osl/unx/system \ diff --git a/sal/osl/unx/pipe.c b/sal/osl/unx/pipe.cxx similarity index 99% rename from sal/osl/unx/pipe.c rename to sal/osl/unx/pipe.cxx index e3e08b5..ec78c2a 100644 --- a/sal/osl/unx/pipe.c +++ b/sal/osl/unx/pipe.cxx @@ -137,10 +137,10 @@ oslPipe SAL_CALL osl_createPipe(rtl_uString *ustrPipeName, oslPipeOptions Option } -static sal_Bool +static bool cpyBootstrapSocketPath(sal_Char *name, size_t len) { - sal_Bool bRet = sal_False; + bool bRet = false; rtl_uString *pName = 0, *pValue = 0; rtl_uString_newFromAscii(&pName, "OSL_SOCKET_PATH"); @@ -180,7 +180,7 @@ oslPipe SAL_CALL osl_psz_createPipe(const sal_Char *pszPipeName, oslPipeOptions sal_Char name[PATH_MAX + 1]; size_t nNameLength = 0; - int bNameTooLong = 0; + bool bNameTooLong = false; oslPipe pPipe; if (access(PIPEDEFAULTPATH, R_OK|W_OK) == 0) commit b64c90c1ef0067aeedc22f6a4bbe7ca243ffdc77 Author: Stephan Bergmann <[email protected]> Date: Wed Nov 19 11:53:54 2014 +0100 nlsupport.c -> nlsupport.cxx Change-Id: Ida0c3c0c521f71fd3f18a12c02cf98ac96c5b7a6 diff --git a/jurt/source/pipe/staticsalhack_c.c b/jurt/source/pipe/staticsalhack_c.c index 2fefa1b..dd4dee6 100644 --- a/jurt/source/pipe/staticsalhack_c.c +++ b/jurt/source/pipe/staticsalhack_c.c @@ -9,7 +9,6 @@ #include <staticsalhack.h> -#include <sal/osl/unx/nlsupport.c> #include <sal/osl/unx/pipe.c> #include <sal/osl/unx/readwrite_helper.c> diff --git a/jurt/source/pipe/staticsalhack_cxx.cxx b/jurt/source/pipe/staticsalhack_cxx.cxx index cee447d..0a9212c 100644 --- a/jurt/source/pipe/staticsalhack_cxx.cxx +++ b/jurt/source/pipe/staticsalhack_cxx.cxx @@ -29,6 +29,7 @@ #include <sal/osl/unx/memory.cxx> #include <sal/osl/unx/module.cxx> #include <sal/osl/unx/mutex.cxx> +#include <sal/osl/unx/nlsupport.cxx> #include <sal/osl/unx/process.cxx> #include <sal/osl/unx/process_impl.cxx> #include <sal/osl/unx/profile.cxx> diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk index b2e4a6f..6dfcfaa 100644 --- a/sal/Library_sal.mk +++ b/sal/Library_sal.mk @@ -162,6 +162,7 @@ $(eval $(call gb_Library_add_exception_objects,sal,\ sal/osl/unx/memory \ sal/osl/unx/module \ sal/osl/unx/mutex \ + sal/osl/unx/nlsupport \ sal/osl/unx/process \ sal/osl/unx/process_impl \ sal/osl/unx/profile \ @@ -171,7 +172,6 @@ $(eval $(call gb_Library_add_exception_objects,sal,\ $(if $(filter DESKTOP,$(BUILD_TYPE)), sal/osl/unx/salinit) \ )) $(eval $(call gb_Library_add_cobjects,sal,\ - sal/osl/unx/nlsupport \ sal/osl/unx/pipe \ sal/osl/unx/readwrite_helper \ sal/osl/unx/socket \ diff --git a/sal/osl/unx/nlsupport.c b/sal/osl/unx/nlsupport.cxx similarity index 99% rename from sal/osl/unx/nlsupport.c rename to sal/osl/unx/nlsupport.cxx index 29eef0a..7e0eee8 100644 --- a/sal/osl/unx/nlsupport.c +++ b/sal/osl/unx/nlsupport.cxx @@ -106,7 +106,7 @@ static char * _compose_locale( rtl_Locale * pLocale, char * buffer, size_t n ) pLocale->Language->buffer, pLocale->Language->length, RTL_TEXTENCODING_ASCII_US, OUSTRING_TO_OSTRING_CVTFLAGS ); - if( SAL_INT_CAST(sal_uInt32, pLanguage->length) < n ) + if( sal::static_int_cast<sal_uInt32>(pLanguage->length) < n ) { strcpy( buffer, pLanguage->buffer ); offset = pLanguage->length; @@ -136,7 +136,7 @@ static char * _compose_locale( rtl_Locale * pLocale, char * buffer, size_t n ) /* convert variant to ascii - check if there is enough space for the variant string */ if( pLocale->Variant && pLocale->Variant->length && - ( SAL_INT_CAST(sal_uInt32, pLocale->Variant->length) < n - 6 ) ) + ( sal::static_int_cast<sal_uInt32>(pLocale->Variant->length) < n - 6 ) ) { rtl_String *pVariant = NULL; commit 431a7c402f5ba41db1c0acbe264c50da925b05a4 Author: Stephan Bergmann <[email protected]> Date: Wed Nov 19 11:51:16 2014 +0100 mutex.c -> mutex.cxx Change-Id: I24ebffd1b055bdd6ad93d2f071d20480b549379f diff --git a/jurt/source/pipe/staticsalhack_c.c b/jurt/source/pipe/staticsalhack_c.c index 7b4a37e..2fefa1b 100644 --- a/jurt/source/pipe/staticsalhack_c.c +++ b/jurt/source/pipe/staticsalhack_c.c @@ -9,7 +9,6 @@ #include <staticsalhack.h> -#include <sal/osl/unx/mutex.c> #include <sal/osl/unx/nlsupport.c> #include <sal/osl/unx/pipe.c> #include <sal/osl/unx/readwrite_helper.c> diff --git a/jurt/source/pipe/staticsalhack_cxx.cxx b/jurt/source/pipe/staticsalhack_cxx.cxx index c21ed44..cee447d 100644 --- a/jurt/source/pipe/staticsalhack_cxx.cxx +++ b/jurt/source/pipe/staticsalhack_cxx.cxx @@ -28,6 +28,7 @@ #include <sal/osl/unx/file_url.cxx> #include <sal/osl/unx/memory.cxx> #include <sal/osl/unx/module.cxx> +#include <sal/osl/unx/mutex.cxx> #include <sal/osl/unx/process.cxx> #include <sal/osl/unx/process_impl.cxx> #include <sal/osl/unx/profile.cxx> diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk index a8075ca..b2e4a6f 100644 --- a/sal/Library_sal.mk +++ b/sal/Library_sal.mk @@ -161,6 +161,7 @@ $(eval $(call gb_Library_add_exception_objects,sal,\ sal/osl/unx/file_volume \ sal/osl/unx/memory \ sal/osl/unx/module \ + sal/osl/unx/mutex \ sal/osl/unx/process \ sal/osl/unx/process_impl \ sal/osl/unx/profile \ @@ -170,7 +171,6 @@ $(eval $(call gb_Library_add_exception_objects,sal,\ $(if $(filter DESKTOP,$(BUILD_TYPE)), sal/osl/unx/salinit) \ )) $(eval $(call gb_Library_add_cobjects,sal,\ - sal/osl/unx/mutex \ sal/osl/unx/nlsupport \ sal/osl/unx/pipe \ sal/osl/unx/readwrite_helper \ diff --git a/sal/osl/unx/mutex.c b/sal/osl/unx/mutex.cxx similarity index 100% rename from sal/osl/unx/mutex.c rename to sal/osl/unx/mutex.cxx commit 42ab57ca574307e994707ae6625e290e2e0be24e Author: Stephan Bergmann <[email protected]> Date: Wed Nov 19 11:50:00 2014 +0100 memory.c -> memory.cxx Change-Id: I87d977aabd09ff01cba0f25247dca43a2bf0dd2b diff --git a/jurt/source/pipe/staticsalhack_c.c b/jurt/source/pipe/staticsalhack_c.c index ac9a913..7b4a37e 100644 --- a/jurt/source/pipe/staticsalhack_c.c +++ b/jurt/source/pipe/staticsalhack_c.c @@ -9,7 +9,6 @@ #include <staticsalhack.h> -#include <sal/osl/unx/memory.c> #include <sal/osl/unx/mutex.c> #include <sal/osl/unx/nlsupport.c> #include <sal/osl/unx/pipe.c> diff --git a/jurt/source/pipe/staticsalhack_cxx.cxx b/jurt/source/pipe/staticsalhack_cxx.cxx index de02379..c21ed44 100644 --- a/jurt/source/pipe/staticsalhack_cxx.cxx +++ b/jurt/source/pipe/staticsalhack_cxx.cxx @@ -26,6 +26,7 @@ #include <sal/osl/unx/file_path_helper.cxx> #include <sal/osl/unx/file_stat.cxx> #include <sal/osl/unx/file_url.cxx> +#include <sal/osl/unx/memory.cxx> #include <sal/osl/unx/module.cxx> #include <sal/osl/unx/process.cxx> #include <sal/osl/unx/process_impl.cxx> diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk index 9cb47f8..a8075ca 100644 --- a/sal/Library_sal.mk +++ b/sal/Library_sal.mk @@ -159,6 +159,7 @@ $(eval $(call gb_Library_add_exception_objects,sal,\ sal/osl/unx/file_stat \ sal/osl/unx/file_url \ sal/osl/unx/file_volume \ + sal/osl/unx/memory \ sal/osl/unx/module \ sal/osl/unx/process \ sal/osl/unx/process_impl \ @@ -169,7 +170,6 @@ $(eval $(call gb_Library_add_exception_objects,sal,\ $(if $(filter DESKTOP,$(BUILD_TYPE)), sal/osl/unx/salinit) \ )) $(eval $(call gb_Library_add_cobjects,sal,\ - sal/osl/unx/memory \ sal/osl/unx/mutex \ sal/osl/unx/nlsupport \ sal/osl/unx/pipe \ diff --git a/sal/osl/unx/memory.c b/sal/osl/unx/memory.cxx similarity index 100% rename from sal/osl/unx/memory.c rename to sal/osl/unx/memory.cxx commit 061c7dd0837adfe25d31f979465bfe4fa9dbf3a3 Author: Stephan Bergmann <[email protected]> Date: Wed Nov 19 11:42:48 2014 +0100 filepath.c -> filepath.cxx Change-Id: I24545b92d7aa0898289d0dee19f34966769702a1 diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk index abeec1d..9cb47f8 100644 --- a/sal/Library_sal.mk +++ b/sal/Library_sal.mk @@ -87,6 +87,7 @@ endif $(eval $(call gb_Library_add_exception_objects,sal,\ sal/osl/all/compat \ sal/osl/all/debugbase \ + sal/osl/all/filepath \ sal/osl/all/loadmodulerelative \ sal/osl/all/log \ sal/osl/all/utility \ @@ -123,9 +124,6 @@ $(eval $(call gb_Library_add_exception_objects,sal,\ sal/textenc/textenc \ sal/textenc/unichars \ )) -$(eval $(call gb_Library_add_cobjects,sal,\ - sal/osl/all/filepath \ -)) ifeq ($(OS),IOS) $(eval $(call gb_Library_add_cxxflags,sal,\ diff --git a/sal/osl/all/filepath.c b/sal/osl/all/filepath.cxx similarity index 100% rename from sal/osl/all/filepath.c rename to sal/osl/all/filepath.cxx _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
