From dac4ca5f682fdd0c3eee7f7ee1d98c9b3c8b7ce4 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 25 Jun 2014 14:57:44 +0200 Subject: new loplugin: externalandnotdefined Find "missing headers," where a function is declared directly in the .cxx (as extern) and not defined, and should arguably instead be declared in an include file. Change-Id: I6d83ee432b2ab0cd050aec2b27c3658d32ac02a2 --- sal/osl/unx/module.cxx | 4 +--- sal/osl/unx/mutex.c | 2 +- sal/osl/unx/pipe.c | 2 +- sal/osl/unx/profile.cxx | 4 +--- sal/osl/unx/secimpl.h | 2 ++ sal/osl/unx/security.cxx | 1 - 6 files changed, 6 insertions(+), 9 deletions(-) (limited to 'sal') diff --git a/sal/osl/unx/module.cxx b/sal/osl/unx/module.cxx index 30fe2abb7603..c6ae0c0e5a30 100644 --- a/sal/osl/unx/module.cxx +++ b/sal/osl/unx/module.cxx @@ -27,6 +27,7 @@ #include #include #include "system.h" +#include "file_url.h" #ifdef AIX #include @@ -36,9 +37,6 @@ #include #endif -/* implemented in file.c */ -extern "C" int UnicodeToText(char *, size_t, const sal_Unicode *, sal_Int32); - static bool getModulePathFromAddress(void * address, rtl_String ** path) { bool result = false; // We do want to have this functionality also in the diff --git a/sal/osl/unx/mutex.c b/sal/osl/unx/mutex.c index a8eb99dd7fed..f48e2e22b11c 100644 --- a/sal/osl/unx/mutex.c +++ b/sal/osl/unx/mutex.c @@ -25,7 +25,7 @@ #include #include -#if defined LINUX /* bad hack */ +#if defined LINUX && !((__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 1)) /* bad hack */ int pthread_mutexattr_setkind_np(pthread_mutexattr_t *, int); #define pthread_mutexattr_settype pthread_mutexattr_setkind_np #define PTHREAD_MUTEX_RECURSIVE PTHREAD_MUTEX_RECURSIVE_NP diff --git a/sal/osl/unx/pipe.c b/sal/osl/unx/pipe.c index b0ee4324baff..e3e08b55a469 100644 --- a/sal/osl/unx/pipe.c +++ b/sal/osl/unx/pipe.c @@ -28,6 +28,7 @@ #include #include "sockimpl.h" +#include "secimpl.h" #define PIPEDEFAULTPATH "/tmp" #define PIPEALTERNATEPATH "/var/tmp" @@ -35,7 +36,6 @@ #define PIPENAMEMASK "OSL_PIPE_%s" #define SECPIPENAMEMASK "OSL_PIPE_%s_%s" -sal_Bool SAL_CALL osl_psz_getUserIdent(oslSecurity Security, sal_Char *pszIdent, sal_uInt32 nMax); oslPipe SAL_CALL osl_psz_createPipe(const sal_Char *pszPipeName, oslPipeOptions Options, oslSecurity Security); static struct diff --git a/sal/osl/unx/profile.cxx b/sal/osl/unx/profile.cxx index 70505da6ec03..21874271dc16 100644 --- a/sal/osl/unx/profile.cxx +++ b/sal/osl/unx/profile.cxx @@ -19,6 +19,7 @@ #include "system.h" #include "readwrite_helper.h" +#include "file_url.h" #include #include @@ -131,9 +132,6 @@ static bool osl_ProfileSwapProfileNames(osl_TProfileImpl*); static void osl_ProfileGenerateExtension(const sal_Char* pszFileName, const sal_Char* pszExtension, sal_Char* pszTmpName, int BufferMaxLen); static oslProfile SAL_CALL osl_psz_openProfile(const sal_Char *pszProfileName, oslProfileOption Flags); -/* implemented in file.c */ -extern "C" oslFileError FileURLToPath( char *, size_t, rtl_uString* ); - oslProfile SAL_CALL osl_openProfile(rtl_uString *ustrProfileName, oslProfileOption Options) { char profilePath[PATH_MAX] = ""; diff --git a/sal/osl/unx/secimpl.h b/sal/osl/unx/secimpl.h index 0cbf41fcbb95..a7cadebb961e 100644 --- a/sal/osl/unx/secimpl.h +++ b/sal/osl/unx/secimpl.h @@ -31,6 +31,8 @@ typedef struct _oslSecurityImpl { 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 diff --git a/sal/osl/unx/security.cxx b/sal/osl/unx/security.cxx index c98b86564118..a7c32a963f3b 100644 --- a/sal/osl/unx/security.cxx +++ b/sal/osl/unx/security.cxx @@ -45,7 +45,6 @@ static oslSecurityError SAL_CALL osl_psz_loginUser(const sal_Char* pszUserName, const sal_Char* pszPasswd, oslSecurity* pSecurity); -extern "C" sal_Bool SAL_CALL osl_psz_getUserIdent(oslSecurity Security, sal_Char *pszIdent, sal_uInt32 nMax); static bool SAL_CALL osl_psz_getUserName(oslSecurity Security, sal_Char* pszName, sal_uInt32 nMax); static bool SAL_CALL osl_psz_getHomeDir(oslSecurity Security, sal_Char* pszDirectory, sal_uInt32 nMax); static bool SAL_CALL osl_psz_getConfigDir(oslSecurity Security, sal_Char* pszDirectory, sal_uInt32 nMax); -- cgit