Change sal/osl/w32/*.h -> *.hxx

...which are now only ever included from C++ code.  Drop extern "C" where
appropriate (i.e., generally everywhere) and fix the occasional ensuing loplugin
warning.  (But no further C++'ification for now.)

Change-Id: I78830692888ee0ae0cac49878042effad2d6707f
Reviewed-on: https://gerrit.libreoffice.org/34865
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann
2017-03-03 15:00:33 +01:00
parent 798dbea63a
commit 8fdf363f59
31 changed files with 90 additions and 212 deletions

View File

@@ -37,11 +37,11 @@
#include <osl/mutex.h>
#include <osl/thread.h>
#include "file_url.h"
#include "gmutex.h"
#include "file_url.hxx"
#include "gmutex.hxx"
#include "rtllifecycle.h"
#include <thread.h>
#include <thread.hxx>
/*
This is needed because DllMain is called after static constructors. A DLL's

View File

@@ -24,8 +24,8 @@
#include "osl/file.hxx"
#include <file-impl.hxx>
#include "file_url.h"
#include "file_error.h"
#include "file_url.hxx"
#include "file_error.hxx"
#include "osl/diagnose.h"
#include "rtl/alloc.h"

View File

@@ -23,10 +23,10 @@
#include "osl/file.h"
#include "file_url.h"
#include <filetime.h>
#include "file_url.hxx"
#include <filetime.hxx>
#include <sal/macros.h>
#include "file_error.h"
#include "file_error.hxx"
#include "path_helper.hxx"

View File

@@ -21,10 +21,10 @@
#define _UNICODE
#include "systools/win32/uwinapi.h"
#include "file_error.h"
#include "file_error.hxx"
#include "osl/diagnose.h"
#include "osl/thread.h"
#include "osl/thread.hxx"
#include <sal/macros.h>
/* OS error to oslFileError values mapping table */

View File

@@ -17,21 +17,13 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_SAL_OSL_W32_FILE_ERROR_H
#define INCLUDED_SAL_OSL_W32_FILE_ERROR_H
#ifndef INCLUDED_SAL_OSL_W32_FILE_ERROR_HXX
#define INCLUDED_SAL_OSL_W32_FILE_ERROR_HXX
#include "osl/file.h"
#ifdef __cplusplus
extern "C" {
#endif
oslFileError oslTranslateFileError (/*DWORD*/ unsigned long dwError);
#ifdef __cplusplus
}
#endif
#endif // INCLUDED_SAL_OSL_W32_FILE_ERROR_H
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -21,9 +21,9 @@
#define _UNICODE
#include "systools/win32/uwinapi.h"
#include "file_url.h"
#include "file_url.hxx"
#include <sal/macros.h>
#include "file_error.h"
#include "file_error.hxx"
#include "rtl/alloc.h"
#include <rtl/ustring.hxx>
@@ -618,7 +618,7 @@ static void osl_encodeURL_( rtl_uString *strURL, rtl_String **pstrEncodedURL )
rtl_freeMemory( pszEncodedURL );
}
oslFileError osl_getSystemPathFromFileURL_( rtl_uString *strURL, rtl_uString **pustrPath, sal_Bool bAllowRelative )
oslFileError osl_getSystemPathFromFileURL_( rtl_uString *strURL, rtl_uString **pustrPath, bool bAllowRelative )
{
rtl_String *strUTF8 = nullptr;
rtl_uString *strDecodedURL = nullptr;

View File

@@ -17,8 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_SAL_OSL_W32_FILE_URL_H
#define INCLUDED_SAL_OSL_W32_FILE_URL_H
#ifndef INCLUDED_SAL_OSL_W32_FILE_URL_HXX
#define INCLUDED_SAL_OSL_W32_FILE_URL_HXX
#include "sal/types.h"
#include "rtl/ustring.h"
@@ -36,10 +36,6 @@
#pragma warning(pop)
#endif
#ifdef __cplusplus
extern "C" {
#endif
#define PATHTYPE_ERROR 0
#define PATHTYPE_RELATIVE 1
#define PATHTYPE_ABSOLUTE_UNC 2
@@ -74,7 +70,7 @@ DWORD GetCaseCorrectPathName (
oslFileError osl_getSystemPathFromFileURL_ (
rtl_uString * strURL,
rtl_uString ** pustrPath,
sal_Bool bAllowRelative
bool bAllowRelative
);
oslFileError osl_getFileURLFromSystemPath_ (
@@ -84,10 +80,6 @@ oslFileError osl_getFileURLFromSystemPath_ (
extern oslMutex g_CurrentDirectoryMutex;
#ifdef __cplusplus
}
#endif
#endif // INCLUDED_SAL_OSL_W32_FILE_URL_H
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -7,8 +7,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef INCLUDED_SAL_OSL_W32_FILETIME_H
#define INCLUDED_SAL_OSL_W32_FILETIME_H
#ifndef INCLUDED_SAL_OSL_W32_FILETIME_HXX
#define INCLUDED_SAL_OSL_W32_FILETIME_HXX
#include <sal/config.h>
@@ -16,20 +16,10 @@
#include <osl/time.h>
#if defined __cplusplus
extern "C" {
#endif
BOOL TimeValueToFileTime(TimeValue const * cpTimeVal, FILETIME * pFTime);
BOOL FileTimeToTimeValue(FILETIME const * cpFTime, TimeValue * pTimeVal);
#if defined __cplusplus
}
#endif
#if defined __cplusplus
namespace osl { namespace detail {
inline __int64 getFiletime(FILETIME const & ft) {
@@ -45,6 +35,4 @@ inline void setFiletime(FILETIME & ft, __int64 value) {
#endif
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */

View File

@@ -17,23 +17,15 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_SAL_OSL_W32_GMUTEX_H
#define INCLUDED_SAL_OSL_W32_GMUTEX_H
#ifndef INCLUDED_SAL_OSL_W32_GMUTEX_HXX
#define INCLUDED_SAL_OSL_W32_GMUTEX_HXX
#include <sal/config.h>
#include <osl/mutex.h>
#if defined __cplusplus
extern "C" {
#endif
extern oslMutex g_Mutex;
#if defined __cplusplus
}
#endif
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */

View File

@@ -20,7 +20,7 @@
#include "system.h"
#include <tlhelp32.h>
#include "file_url.h"
#include "file_url.hxx"
#include "path_helper.hxx"
#include <osl/module.h>

View File

@@ -19,7 +19,7 @@
#include <sal/config.h>
#include "gmutex.h"
#include "gmutex.hxx"
#include "system.h"
#include <osl/mutex.h>

View File

@@ -27,7 +27,7 @@
#endif
#include <wchar.h>
#include <nlsupport.h>
#include <nlsupport.hxx>
#include <osl/mutex.h>
#include <osl/nlsupport.h>

View File

@@ -7,23 +7,15 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef INCLUDED_SAL_OSL_W32_NLSUPPORT_H
#define INCLUDED_SAL_OSL_W32_NLSUPPORT_H
#ifndef INCLUDED_SAL_OSL_W32_NLSUPPORT_HXX
#define INCLUDED_SAL_OSL_W32_NLSUPPORT_HXX
#include <sal/config.h>
#include <rtl/locale.h>
#if defined __cplusplus
extern "C" {
#endif
void imp_getProcessLocale(rtl_Locale ** ppLocale);
#if defined __cplusplus
}
#endif
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */

View File

@@ -92,7 +92,7 @@ const sal_Char* const LDP_WITH_SLASH = ":/";
// API accepts this case
const sal_Char* const LDP_WITH_DOT_BACKSLASH = ":.\\";
sal_Int32 osl_systemPathIsLogicalDrivePattern(/*in*/ const rtl_uString* pustrPath)
bool osl_systemPathIsLogicalDrivePattern(/*in*/ const rtl_uString* pustrPath)
{
const sal_Unicode* p = rtl_uString_getStr(const_cast<rtl_uString*>(pustrPath));
if (iswalpha(*p++))
@@ -102,7 +102,7 @@ sal_Int32 osl_systemPathIsLogicalDrivePattern(/*in*/ const rtl_uString* pustrPat
(0 == rtl_ustr_ascii_compare(p, LDP_WITH_SLASH)) ||
(0 == rtl_ustr_ascii_compare(p, LDP_WITH_DOT_BACKSLASH)));
}
return 0;
return false;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -1,65 +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_W32_PATH_HELPER_H
#define INCLUDED_SAL_OSL_W32_PATH_HELPER_H
#include <sal/types.h>
#include <rtl/ustring.h>
#include <osl/file.h>
#include <osl/diagnose.h>
#ifdef __cplusplus
extern "C"
{
#endif
/*******************************************************************
osl_systemPathEnsureSeparator
Adds a trailing path separator to the given system path if not
already there and if the path is not the root path or a logical
drive alone
******************************************************************/
void osl_systemPathEnsureSeparator(/*inout*/ rtl_uString** ppustrPath);
/*******************************************************************
osl_systemPathRemoveSeparator
Removes the last separator from the given system path if any and
if the path is not the root path '\'
******************************************************************/
void SAL_CALL osl_systemPathRemoveSeparator(/*inout*/ rtl_uString** ppustrPath);
/*******************************************************************
osl_is_logical_drive_pattern
Returns whether a given path is only a logical drive pattern or not.
A logical drive pattern is something like "a:\", "c:\".
No logical drive pattern is something like "c:\test"
******************************************************************/
sal_Int32 osl_systemPathIsLogicalDrivePattern(/*in*/ const rtl_uString* pustrPath);
#ifdef __cplusplus
}
#endif
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -20,10 +20,41 @@
#ifndef INCLUDED_SAL_OSL_W32_PATH_HELPER_HXX
#define INCLUDED_SAL_OSL_W32_PATH_HELPER_HXX
#include "path_helper.h"
#include <sal/config.h>
#include <osl/diagnose.h>
#include <osl/diagnose.h>
#include <osl/file.h>
#include <rtl/alloc.h>
#include <rtl/ustring.h>
#include <rtl/ustring.hxx>
#include <sal/types.h>
/*******************************************************************
osl_systemPathEnsureSeparator
Adds a trailing path separator to the given system path if not
already there and if the path is not the root path or a logical
drive alone
******************************************************************/
void osl_systemPathEnsureSeparator(/*inout*/ rtl_uString** ppustrPath);
/*******************************************************************
osl_systemPathRemoveSeparator
Removes the last separator from the given system path if any and
if the path is not the root path '\'
******************************************************************/
void SAL_CALL osl_systemPathRemoveSeparator(/*inout*/ rtl_uString** ppustrPath);
/*******************************************************************
osl_is_logical_drive_pattern
Returns whether a given path is only a logical drive pattern or not.
A logical drive pattern is something like "a:\", "c:\".
No logical drive pattern is something like "c:\test"
******************************************************************/
bool osl_systemPathIsLogicalDrivePattern(/*in*/ const rtl_uString* pustrPath);
namespace osl
{

View File

@@ -37,11 +37,11 @@
#include <osl/thread.h>
#include <sal/log.hxx>
#include <filetime.h>
#include <nlsupport.h>
#include "procimpl.h"
#include "sockimpl.h"
#include "file_url.h"
#include <filetime.hxx>
#include <nlsupport.hxx>
#include "procimpl.hxx"
#include "sockimpl.hxx"
#include "file_url.hxx"
#include "path_helper.hxx"
#include <rtl/ustrbuf.h>
#include <rtl/alloc.h>

View File

@@ -34,10 +34,10 @@
#endif
#include <file-impl.hxx>
#include "procimpl.h"
#include "procimpl.hxx"
#include <rtl/ustring.hxx>
#include <rtl/ustrbuf.hxx>
#include "secimpl.h"
#include "secimpl.hxx"
#include <osl/file.hxx>
#include <vector>

View File

@@ -17,23 +17,15 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_SAL_OSL_W32_PROCIMPL_H
#define INCLUDED_SAL_OSL_W32_PROCIMPL_H
#ifndef INCLUDED_SAL_OSL_W32_PROCIMPL_HXX
#define INCLUDED_SAL_OSL_W32_PROCIMPL_HXX
#include <osl/process.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _oslProcessImpl {
struct oslProcessImpl {
HANDLE m_hProcess;
DWORD m_IdProcess;
} oslProcessImpl;
#ifdef __cplusplus
}
#endif
};
#endif

View File

@@ -19,7 +19,7 @@
#include "system.h"
#include "file_url.h"
#include "file_url.hxx"
#include "path_helper.hxx"
#include <string.h>

View File

@@ -20,7 +20,7 @@
#include "sal/config.h"
#include "system.h"
#include "time.h"
#include "time.hxx"
#include <osl/process.h>
#include <sal/main.h>

View File

@@ -17,8 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_SAL_OSL_W32_SECIMPL_H
#define INCLUDED_SAL_OSL_W32_SECIMPL_H
#ifndef INCLUDED_SAL_OSL_W32_SECIMPL_HXX
#define INCLUDED_SAL_OSL_W32_SECIMPL_HXX
#include <winnetwk.h>
@@ -26,10 +26,6 @@
#define USER_BUFFER_SIZE 256
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
HANDLE m_hProfile;
HANDLE m_hToken;
@@ -38,10 +34,6 @@ typedef struct {
NETRESOURCEW *m_pNetResource;
} oslSecurityImpl;
#ifdef __cplusplus
}
#endif
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -25,7 +25,7 @@
#include <osl/file.h>
#include <systools/win32/uwinapi.h>
#include <sal/macros.h>
#include "secimpl.h"
#include "secimpl.hxx"
/*****************************************************************************/
/* Data Type Definition */

View File

@@ -26,7 +26,7 @@
#include "system.h"
#include <tchar.h>
#include "file_url.h"
#include "file_url.hxx"
#include "path_helper.hxx"
#include <osl/diagnose.h>

View File

@@ -24,9 +24,7 @@
#include <rtl/alloc.h>
#include <sal/log.hxx>
#include "sockimpl.h"
extern "C" {
#include "sockimpl.hxx"
/*
oslSocketAddr is a pointer to a Berkeley struct sockaddr.
@@ -2024,6 +2022,4 @@ sal_Int32 SAL_CALL osl_demultiplexSocketEvents (
pTimeout ? &tv : nullptr);
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -17,16 +17,12 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_SAL_OSL_W32_SOCKIMPL_H
#define INCLUDED_SAL_OSL_W32_SOCKIMPL_H
#ifndef INCLUDED_SAL_OSL_W32_SOCKIMPL_HXX
#define INCLUDED_SAL_OSL_W32_SOCKIMPL_HXX
#include <osl/socket.h>
#include <osl/interlck.h>
#ifdef __cplusplus
extern "C" {
#endif
/*****************************************************************************/
/* oslSocketImpl */
/*****************************************************************************/
@@ -47,10 +43,6 @@ struct oslSocketAddrImpl
oslSocket osl_createSocketImpl_(SOCKET Socket);
void osl_destroySocketImpl_(oslSocket pImpl);
#ifdef __cplusplus
}
#endif
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -24,8 +24,8 @@
#include "osl/file.h"
#include <file-impl.hxx>
#include "file_error.h"
#include "file_url.h"
#include "file_error.hxx"
#include "file_url.hxx"
#include "path_helper.hxx"
#include "osl/diagnose.h"

View File

@@ -18,7 +18,7 @@
*/
#include "system.h"
#include <thread.h>
#include <thread.hxx>
#include <osl/diagnose.h>
#include <osl/thread.h>

View File

@@ -7,27 +7,19 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef INCLUDED_SAL_OSL_W32_THREAD_H
#define INCLUDED_SAL_OSL_W32_THREAD_H
#ifndef INCLUDED_SAL_OSL_W32_THREAD_HXX
#define INCLUDED_SAL_OSL_W32_THREAD_HXX
#include <sal/config.h>
#include <sal/types.h>
#if defined __cplusplus
extern "C" {
#endif
void SAL_CALL osl_callThreadKeyCallbackOnThreadDetach(void);
extern DWORD g_dwTLSTextEncodingIndex;
extern CRITICAL_SECTION g_ThreadKeyListCS;
#if defined __cplusplus
}
#endif
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */

View File

@@ -20,8 +20,8 @@
#include <sal/config.h>
#include "system.h"
#include <filetime.h>
#include <time.h>
#include <filetime.hxx>
#include <time.hxx>
#include <osl/diagnose.h>
#include <osl/time.h>

View File

@@ -7,21 +7,13 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef INCLUDED_SAL_OSL_W32_TIME_H
#define INCLUDED_SAL_OSL_W32_TIME_H
#ifndef INCLUDED_SAL_OSL_W32_TIME_HXX
#define INCLUDED_SAL_OSL_W32_TIME_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 cinoptions=b1,g0,N-s cinkeys+=0=break: */