[Libreoffice-commits] core.git: 13 commits - canvas/source compilerplugins/clang connectivity/source dtrans/source embeddedobj/source embedserv/source extensions/source fpicker/source hwpfilter/source sal/osl setup_native/source shell/inc shell/source winaccessibility/source xmlsecurity/source

Stephan Bergmann sbergman at redhat.com
Wed Jan 11 12:43:12 UTC 2017


 canvas/source/directx/dx_canvas.cxx                                               |    4 -
 canvas/source/directx/dx_spritecanvas.cxx                                         |    2 
 compilerplugins/clang/externvar.cxx                                               |   12 ++++
 connectivity/source/drivers/ado/Awrapado.cxx                                      |    8 ---
 dtrans/source/win32/dnd/globals.hxx                                               |    9 +++
 dtrans/source/win32/dnd/source.cxx                                                |    2 
 dtrans/source/win32/dnd/target.cxx                                                |    1 
 embeddedobj/source/msole/olecomponent.cxx                                         |    2 
 embedserv/source/embed/servprov.cxx                                               |    2 
 embedserv/source/embed/tracker.cxx                                                |   10 +--
 extensions/source/activex/so_activex.cxx                                          |   26 +++++-----
 extensions/source/ole/oledll.cxx                                                  |    2 
 fpicker/source/win32/folderpicker/MtaFop.cxx                                      |    4 -
 fpicker/source/win32/misc/resourceprovider.cxx                                    |    2 
 hwpfilter/source/fontmap.cxx                                                      |    2 
 hwpfilter/source/grammar.h                                                        |    2 
 hwpfilter/source/lexer.cxx                                                        |    3 -
 sal/osl/w32/dllentry.c                                                            |    3 -
 sal/osl/w32/file_url.cxx                                                          |    3 -
 sal/osl/w32/file_url.h                                                            |    3 +
 sal/osl/w32/path_helper.cxx                                                       |    8 +--
 sal/osl/w32/process.cxx                                                           |    2 
 sal/osl/w32/procimpl.cxx                                                          |    4 -
 sal/osl/w32/socket.cxx                                                            |    2 
 sal/osl/w32/thread.h                                                              |    2 
 setup_native/source/win32/customactions/indexingfilter/restartindexingservice.cxx |   12 ++--
 shell/inc/shlxthdl.hxx                                                            |    2 
 shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx                           |    4 -
 shell/source/win32/shlxthandler/shlxthdl.cxx                                      |   24 ++++-----
 shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx                       |    2 
 shell/source/win32/simplemail/senddoc.cxx                                         |    2 
 winaccessibility/source/UAccCOM/MAccessible.cxx                                   |    4 -
 xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx             |    2 
 33 files changed, 89 insertions(+), 83 deletions(-)

New commits:
commit 33c81a4580230cc64667d98cacda8c484248a781
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jan 11 13:42:18 2017 +0100

    loplugin:externvar (clang-cl)
    
    Change-Id: I6f4c294cb15a4426545d05be7b0a7f26f580563c

diff --git a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
index 599cebf..39f52f7 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
@@ -64,7 +64,7 @@ struct CertErrorToString{
     char const * name;
 };
 
-CertErrorToString arErrStrings[] =
+CertErrorToString const arErrStrings[] =
 {
     { 0x00000000, "CERT_TRUST_NO_ERROR"},
     { 0x00000001, "CERT_TRUST_IS_NOT_TIME_VALID"},
commit db5cfb790f38b9cfbff67d49ec4f7104634f8628
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jan 11 13:42:10 2017 +0100

    loplugin:externvar (clang-cl)
    
    Change-Id: I0f967f75dc41b3dc65790cf97bdac992033d1c92

diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx b/winaccessibility/source/UAccCOM/MAccessible.cxx
index b832c53..f08cd83 100644
--- a/winaccessibility/source/UAccCOM/MAccessible.cxx
+++ b/winaccessibility/source/UAccCOM/MAccessible.cxx
@@ -88,7 +88,7 @@ enum XInterfaceIndex {
 
 // IA2 states mapping, and name
 // maintenance the consistency, change one array, change the three all
-long IA2_STATES[] =
+long const IA2_STATES[] =
 {
     IA2_STATE_ACTIVE,                   // =                    0x1;
     IA2_STATE_ARMED,                    // =                    0x2;
@@ -114,7 +114,7 @@ long IA2_STATES[] =
 <=== map ===>
 
 */
-short UNO_STATES[] =
+short const UNO_STATES[] =
 {
     ACTIVE,         // = (sal_Int16)1;
     ARMED,          // = (sal_Int16)2;
commit 556f1eab63555019865803c055454b7b69c2d75b
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jan 11 13:41:56 2017 +0100

    loplugin:externvar (clang-cl)
    
    Change-Id: I9efdd5136fdf793e0075b91fcfae4fed42050109

diff --git a/shell/inc/shlxthdl.hxx b/shell/inc/shlxthdl.hxx
index b972c57..3591ca9 100644
--- a/shell/inc/shlxthdl.hxx
+++ b/shell/inc/shlxthdl.hxx
@@ -44,6 +44,8 @@ const CLSID CLSID_PROPERTYSHEET_HANDLER =
 const CLSID CLSID_THUMBVIEWER_HANDLER =
 { 0x3b092f0c, 0x7696, 0x40e3, { 0xa8, 0xf, 0x68, 0xd7, 0x4d, 0xa8, 0x42, 0x10 } };
 
+extern HINSTANCE g_hModule;
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx b/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx
index edb7ab2..1dd38a0 100644
--- a/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx
+++ b/shell/source/win32/shlxthandler/prophdl/propertyhdl.cxx
@@ -37,7 +37,7 @@
 // Module global
 
 long g_DllRefCnt = 0;
-HINSTANCE g_hModule = nullptr;
+static HINSTANCE g_hModule = nullptr;
 
 // Map of property keys to the locations of their value(s) in the .??? XML schema
 struct PROPERTYMAP
@@ -56,7 +56,7 @@ const PROPERTYMAP g_rgPROPERTYMAP[] =
     { PKEY_Comment,        L"LibreOffice",          L"Comments" },
 };
 
-size_t gPropertyMapTableSize = SAL_N_ELEMENTS(g_rgPROPERTYMAP);
+size_t const gPropertyMapTableSize = SAL_N_ELEMENTS(g_rgPROPERTYMAP);
 
 
 CPropertyHdl::CPropertyHdl( long nRefCnt ) :
diff --git a/shell/source/win32/shlxthandler/shlxthdl.cxx b/shell/source/win32/shlxthandler/shlxthdl.cxx
index cba73c4..2483381 100644
--- a/shell/source/win32/shlxthandler/shlxthdl.cxx
+++ b/shell/source/win32/shlxthandler/shlxthdl.cxx
@@ -37,18 +37,18 @@ HINSTANCE g_hModule = nullptr;
 
 namespace /* private */
 {
-    const char* GUID_PLACEHOLDER       = "{GUID}";
-    const char* EXTENSION_PLACEHOLDER  = "{EXT}";
-    const char* FORWARDKEY_PLACEHOLDER = "{FWDKEY}";
-
-    const char* CLSID_ENTRY                         = "CLSID\\{GUID}\\InProcServer32";
-    const char* SHELLEX_IID_ENTRY                   = "{EXT}\\shellex\\{GUID}";
-    const char* SHELLEX_ENTRY                       = "{EXT}\\shellex";
-    const char* FORWARD_PROPSHEET_MYPROPSHEET_ENTRY = "{FWDKEY}\\shellex\\PropertySheetHandlers\\MyPropSheet1";
-    const char* FORWARD_PROPSHEET_ENTRY             = "{FWDKEY}\\shellex\\PropertySheetHandlers";
-    const char* FORWARD_SHELLEX_ENTRY               = "{FWDKEY}\\shellex";
-
-    const char* SHELL_EXTENSION_APPROVED_KEY_NAME   = "Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved";
+    const char* const GUID_PLACEHOLDER       = "{GUID}";
+    const char* const EXTENSION_PLACEHOLDER  = "{EXT}";
+    const char* const FORWARDKEY_PLACEHOLDER = "{FWDKEY}";
+
+    const char* const CLSID_ENTRY                         = "CLSID\\{GUID}\\InProcServer32";
+    const char* const SHELLEX_IID_ENTRY                   = "{EXT}\\shellex\\{GUID}";
+    const char* const SHELLEX_ENTRY                       = "{EXT}\\shellex";
+    const char* const FORWARD_PROPSHEET_MYPROPSHEET_ENTRY = "{FWDKEY}\\shellex\\PropertySheetHandlers\\MyPropSheet1";
+    const char* const FORWARD_PROPSHEET_ENTRY             = "{FWDKEY}\\shellex\\PropertySheetHandlers";
+    const char* const FORWARD_SHELLEX_ENTRY               = "{FWDKEY}\\shellex";
+
+    const char* const SHELL_EXTENSION_APPROVED_KEY_NAME   = "Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved";
 
 
     // "String Placeholder" ->
diff --git a/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx b/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx
index f7ddd61..740ae57 100644
--- a/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx
+++ b/shell/source/win32/shlxthandler/thumbviewer/thumbviewer.cxx
@@ -48,8 +48,6 @@
 #endif
 #include <memory>
 
-extern HINSTANCE g_hModule;
-
 namespace internal
 {
     /* The signet.png used for thumbnails of signed documents
diff --git a/shell/source/win32/simplemail/senddoc.cxx b/shell/source/win32/simplemail/senddoc.cxx
index cb25d7c..1b0327d 100644
--- a/shell/source/win32/simplemail/senddoc.cxx
+++ b/shell/source/win32/simplemail/senddoc.cxx
@@ -170,7 +170,7 @@ void initMapiMessage(
     pMapiMessage->nFileCount = aMapiAttachmentList.size();
 }
 
-const char* KnownParameter[] =
+const char* const KnownParameter[] =
 {
     "--to",
     "--cc",
commit b58b241f3a42255cce56ff14b5ce8fc7245d11ca
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jan 11 13:41:30 2017 +0100

    loplugin:externvar (clang-cl)
    
    Change-Id: Iebf83ccfb9e7128fd328a548ce77cdee4ef7ca4b

diff --git a/setup_native/source/win32/customactions/indexingfilter/restartindexingservice.cxx b/setup_native/source/win32/customactions/indexingfilter/restartindexingservice.cxx
index fcae22f..1e94223 100644
--- a/setup_native/source/win32/customactions/indexingfilter/restartindexingservice.cxx
+++ b/setup_native/source/win32/customactions/indexingfilter/restartindexingservice.cxx
@@ -47,12 +47,12 @@ typedef SC_HANDLE (__stdcall * OpenService_t)(SC_HANDLE, LPCSTR, DWORD);
 typedef BOOL (__stdcall * QueryServiceStatus_t)(SC_HANDLE, LPSERVICE_STATUS);
 typedef BOOL (__stdcall * StartService_t)(SC_HANDLE, DWORD, LPCSTR*);
 
-CloseServiceHandle_t CloseServiceHandle_ = nullptr;
-ControlService_t ControlService_ = nullptr;
-OpenSCManager_t OpenSCManager_ = nullptr;
-OpenService_t OpenService_ = nullptr;
-QueryServiceStatus_t QueryServiceStatus_ = nullptr;
-StartService_t StartService_ = nullptr;
+static CloseServiceHandle_t CloseServiceHandle_ = nullptr;
+static ControlService_t ControlService_ = nullptr;
+static OpenSCManager_t OpenSCManager_ = nullptr;
+static OpenService_t OpenService_ = nullptr;
+static QueryServiceStatus_t QueryServiceStatus_ = nullptr;
+static StartService_t StartService_ = nullptr;
 
 const char * const INDEXING_SERVICE_NAME = "cisvc";
 
commit a9d06182f8bc6ad79f72ec3d604d28d232c62ccc
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jan 11 13:41:01 2017 +0100

    loplugin:externvar (clang-cl)
    
    Change-Id: I81877e46cf95dcc7de16b797fca33658036bf9e8

diff --git a/compilerplugins/clang/externvar.cxx b/compilerplugins/clang/externvar.cxx
index b9b5648..fc4bd7a 100644
--- a/compilerplugins/clang/externvar.cxx
+++ b/compilerplugins/clang/externvar.cxx
@@ -73,6 +73,9 @@ public:
             // not needed and will not be emitted"
             return true;
         }
+        if (loplugin::DeclCheck(def).Var("_pRawDllMain").GlobalNamespace()) {
+            return true;
+        }
         SourceLocation argLoc;
         if (compat::isMacroArgExpansion(compiler, def->getLocation(), &argLoc)
             && (Lexer::getImmediateMacroName(
diff --git a/sal/osl/w32/dllentry.c b/sal/osl/w32/dllentry.c
index 54133b5..355c6b8 100644
--- a/sal/osl/w32/dllentry.c
+++ b/sal/osl/w32/dllentry.c
@@ -34,16 +34,15 @@
 #include <osl/mutex.h>
 #include <osl/thread.h>
 
+#include "file_url.h"
 #include "rtllifecycle.h"
 
 #include <thread.h>
 
 // externals
 
-extern DWORD            g_dwTLSTextEncodingIndex;
 extern CRITICAL_SECTION g_ThreadKeyListCS;
 extern oslMutex         g_Mutex;
-extern oslMutex         g_CurrentDirectoryMutex;
 
 #ifdef __MINGW32__
 
diff --git a/sal/osl/w32/file_url.cxx b/sal/osl/w32/file_url.cxx
index ca41be6..1a5a188 100644
--- a/sal/osl/w32/file_url.cxx
+++ b/sal/osl/w32/file_url.cxx
@@ -42,8 +42,7 @@
 
 // FileURL functions
 
-extern "C" oslMutex g_CurrentDirectoryMutex; /* Initialized in dllentry.c */
-oslMutex g_CurrentDirectoryMutex = nullptr;
+oslMutex g_CurrentDirectoryMutex = nullptr; /* Initialized in dllentry.c */
 
 static BOOL IsValidFilePathComponent(
     LPCWSTR lpComponent, LPCWSTR *lppComponentEnd, DWORD dwFlags)
diff --git a/sal/osl/w32/file_url.h b/sal/osl/w32/file_url.h
index ccb99fc..29dfa8f 100644
--- a/sal/osl/w32/file_url.h
+++ b/sal/osl/w32/file_url.h
@@ -23,6 +23,7 @@
 #include "sal/types.h"
 #include "rtl/ustring.h"
 #include "osl/file.h"
+#include "osl/mutex.h"
 
 #ifdef _MSC_VER
 #pragma warning(push,1)
@@ -81,6 +82,8 @@ oslFileError osl_getFileURLFromSystemPath_ (
     rtl_uString ** pstrURL
 );
 
+extern oslMutex g_CurrentDirectoryMutex;
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/sal/osl/w32/path_helper.cxx b/sal/osl/w32/path_helper.cxx
index c778b15..1327265 100644
--- a/sal/osl/w32/path_helper.cxx
+++ b/sal/osl/w32/path_helper.cxx
@@ -83,14 +83,14 @@ void SAL_CALL osl_systemPathRemoveSeparator(/*inout*/ rtl_uString** ppustrPath)
  ******************************************************************/
 
 // is [A-Za-z]:[/|\]\0
-const sal_Char* LDP                    = ":";
-const sal_Char* LDP_WITH_BACKSLASH     = ":\\";
-const sal_Char* LDP_WITH_SLASH         = ":/";
+const sal_Char* const LDP                = ":";
+const sal_Char* const LDP_WITH_BACKSLASH = ":\\";
+const sal_Char* const LDP_WITH_SLASH     = ":/";
 
 // degenerated case returned by the Windows FileOpen dialog
 // when someone enters for instance "x:filename", the Win32
 // API accepts this case
-const sal_Char* LDP_WITH_DOT_BACKSLASH = ":.\\";
+const sal_Char* const LDP_WITH_DOT_BACKSLASH = ":.\\";
 
 sal_Int32 osl_systemPathIsLogicalDrivePattern(/*in*/ const rtl_uString* pustrPath)
 {
diff --git a/sal/osl/w32/process.cxx b/sal/osl/w32/process.cxx
index 1b08a24..5926867 100644
--- a/sal/osl/w32/process.cxx
+++ b/sal/osl/w32/process.cxx
@@ -436,8 +436,6 @@ oslProcessError SAL_CALL osl_clearEnvironment(rtl_uString *ustrVar)
  * Current Working Directory.
  ***************************************************************************/
 
-extern "C" oslMutex g_CurrentDirectoryMutex;
-
 oslProcessError SAL_CALL osl_getProcessWorkingDir( rtl_uString **pustrWorkingDir )
 {
     ::osl::LongPathBuffer< sal_Unicode > aBuffer( MAX_LONG_PATH );
diff --git a/sal/osl/w32/procimpl.cxx b/sal/osl/w32/procimpl.cxx
index c988380..738b10e 100644
--- a/sal/osl/w32/procimpl.cxx
+++ b/sal/osl/w32/procimpl.cxx
@@ -46,7 +46,7 @@
 #include <string.h>
 
 const sal_Unicode NAME_VALUE_SEPARATOR = TEXT('=');
-const sal_Char* SPACE = " ";
+const sal_Char SPACE[] = " ";
 const rtl::OUString ENV_COMSPEC ("COMSPEC");
 const rtl::OUString QUOTE("\"");
 
@@ -453,7 +453,7 @@ oslProcessError SAL_CALL osl_executeProcess_WithRedirectedIO(
        start at 1 instead of 0 */
     for (sal_uInt32 n = (nullptr != ustrImageName) ? 0 : 1; n < nArguments; n++)
     {
-        command_line.appendAscii(SPACE);
+        command_line.append(SPACE);
 
         /* Quote arguments containing blanks */
         if (rtl::OUString(ustrArguments[n]).indexOf(' ') != -1)
diff --git a/sal/osl/w32/socket.cxx b/sal/osl/w32/socket.cxx
index 4468521..4e1249c 100644
--- a/sal/osl/w32/socket.cxx
+++ b/sal/osl/w32/socket.cxx
@@ -273,7 +273,7 @@ struct LeakWarning
         SAL_WARN_IF( g_nSocketAddr, "sal.osl", "sal_socket: " << g_nSocketAddr << " socket address instances leak" );
     }
 };
-LeakWarning socketWarning;
+static LeakWarning socketWarning;
 #endif
 
 oslSocket osl_createSocketImpl_(SOCKET Socket)
diff --git a/sal/osl/w32/thread.h b/sal/osl/w32/thread.h
index 5761b5a..fb896f5 100644
--- a/sal/osl/w32/thread.h
+++ b/sal/osl/w32/thread.h
@@ -20,6 +20,8 @@ extern "C" {
 
 void SAL_CALL osl_callThreadKeyCallbackOnThreadDetach(void);
 
+extern DWORD g_dwTLSTextEncodingIndex;
+
 #if defined __cplusplus
 }
 #endif
commit 698bdcdb0c87f5e0453c522b64d20fba851ba47a
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jan 11 13:40:45 2017 +0100

    loplugin:externvar (clang-cl)
    
    Change-Id: I29c40113f9248f9041dacc398416f39889f5ddf8

diff --git a/hwpfilter/source/fontmap.cxx b/hwpfilter/source/fontmap.cxx
index 6ef93e7..c25ec84 100644
--- a/hwpfilter/source/fontmap.cxx
+++ b/hwpfilter/source/fontmap.cxx
@@ -118,7 +118,7 @@ const struct FontEntry FontMapTab[] =
 };
 
 #if defined(_WIN32)
-const char* RepFontTab[] =
+const char* const RepFontTab[] =
 {
     "\xb9\xd9\xc5\xc1",                                       /* 0 */
     "\xb5\xb8\xbf\xf2",                                       /* 1 */
diff --git a/hwpfilter/source/grammar.h b/hwpfilter/source/grammar.h
index 75fdb8f..0a87a6a 100644
--- a/hwpfilter/source/grammar.h
+++ b/hwpfilter/source/grammar.h
@@ -52,8 +52,6 @@ typedef union {
 #define RIGHT_DELIM 284
 #define DIGIT   285
 
-#ifndef _WIN32
 extern YYSTYPE yylval;
-#endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/hwpfilter/source/lexer.cxx b/hwpfilter/source/lexer.cxx
index 915b7b0..52aa500 100644
--- a/hwpfilter/source/lexer.cxx
+++ b/hwpfilter/source/lexer.cxx
@@ -946,9 +946,6 @@ extern "C" {
 int yywrap();
 }
 
-#ifdef _WIN32
-extern YYSTYPE yylval;
-#endif
 #ifdef TOKEN_DEBUG
 #define token_debug printf
 #else
commit f2cb396c8d999dc1a519511e504eca643528c3c4
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jan 11 13:40:32 2017 +0100

    loplugin:externvar (clang-cl)
    
    Change-Id: Ie2a96299d8d3cc9c1ccad7cfb8fbee05c6734148

diff --git a/fpicker/source/win32/folderpicker/MtaFop.cxx b/fpicker/source/win32/folderpicker/MtaFop.cxx
index 11b084f..595711e 100644
--- a/fpicker/source/win32/folderpicker/MtaFop.cxx
+++ b/fpicker/source/win32/folderpicker/MtaFop.cxx
@@ -39,9 +39,9 @@ const bool INIT_NONSIGNALED = false;
 
 namespace
 {
-    const char* FOLDERPICKER_SRV_DLL_NAME = "fps.dll";
+    const char* const FOLDERPICKER_SRV_DLL_NAME = "fps.dll";
     const char g_szWndClsName[]           = "FopStaReqWnd###";
-    const char* CURRENT_INSTANCE          = "CurrInst";
+    const char* const CURRENT_INSTANCE          = "CurrInst";
 
     struct RequestContext
     {
diff --git a/fpicker/source/win32/misc/resourceprovider.cxx b/fpicker/source/win32/misc/resourceprovider.cxx
index ba47da2..9360089 100644
--- a/fpicker/source/win32/misc/resourceprovider.cxx
+++ b/fpicker/source/win32/misc/resourceprovider.cxx
@@ -43,7 +43,7 @@ struct Entry
     sal_Int16 resId;
 };
 
-Entry CtrlIdToResIdTable[] = {
+Entry const CtrlIdToResIdTable[] = {
     { CHECKBOX_AUTOEXTENSION,                   STR_SVT_FILEPICKER_AUTO_EXTENSION },
     { CHECKBOX_PASSWORD,                        STR_SVT_FILEPICKER_PASSWORD },
     { CHECKBOX_FILTEROPTIONS,                   STR_SVT_FILEPICKER_FILTER_OPTIONS },
commit 6ec5717e06007c540474d91ec99345fb5edc47a8
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jan 11 13:40:15 2017 +0100

    loplugin:externvar (clang-cl)
    
    Change-Id: I638199f1455bead71f0a03f15e4b6f418a0cd0e2

diff --git a/compilerplugins/clang/externvar.cxx b/compilerplugins/clang/externvar.cxx
index 9569a3d..b9b5648 100644
--- a/compilerplugins/clang/externvar.cxx
+++ b/compilerplugins/clang/externvar.cxx
@@ -8,6 +8,7 @@
  */
 
 #include "check.hxx"
+#include "compat.hxx"
 #include "plugin.hxx"
 
 // Find variable declarations at namespace scope that need not have external
@@ -72,6 +73,14 @@ public:
             // not needed and will not be emitted"
             return true;
         }
+        SourceLocation argLoc;
+        if (compat::isMacroArgExpansion(compiler, def->getLocation(), &argLoc)
+            && (Lexer::getImmediateMacroName(
+                    argLoc, compiler.getSourceManager(), compiler.getLangOpts())
+                == "DEFINE_GUID"))
+        {
+            return true;
+        }
         report(
             DiagnosticsEngine::Warning,
             "variable with external linkage not declared in an include file",
diff --git a/extensions/source/activex/so_activex.cxx b/extensions/source/activex/so_activex.cxx
index e40ae86..0f523c1 100644
--- a/extensions/source/activex/so_activex.cxx
+++ b/extensions/source/activex/so_activex.cxx
@@ -125,13 +125,13 @@ STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
 
 // for now database component and chart are always installed
 #define SUPPORTED_EXT_NUM 30
-const char* aFileExt[] = { ".vor",
+const char* const aFileExt[] = { ".vor",
                            ".sds", ".sda", ".sdd", ".sdp", ".sdc", ".sdw", ".smf",
                            ".stw", ".stc", ".sti", ".std",
                            ".sxw", ".sxc", ".sxi", ".sxd", ".sxg", ".sxm",
                            ".ott", ".otg", ".otp", ".ots", ".otf",
                            ".odt", ".oth", ".odm", ".odg", ".odp", ".ods", ".odf"};
-const char* aMimeType[] = {
+const char* const aMimeType[] = {
                           "application/vnd.stardivision.writer",
 
                           "application/vnd.stardivision.chart",
@@ -176,23 +176,23 @@ const int nForModes[] = { 16,
                           16,  2,  4,  8, 32,
                           16, 16, 16,  2,  4,  8, 32 };
 
-const char* aClassID = "{67F2A879-82D5-4A6D-8CC5-FFB3C114B69D}";
-const char* aTypeLib = "{61FA3F13-8061-4796-B055-3697ED28CB38}";
+const char* const aClassID = "{67F2A879-82D5-4A6D-8CC5-FFB3C114B69D}";
+const char* const aTypeLib = "{61FA3F13-8061-4796-B055-3697ED28CB38}";
 
 // ISOComWindowPeer interface information
-const char* aInterIDWinPeer = "{BF5D10F3-8A10-4A0B-B150-2B6AA2D7E118}";
-const char* aProxyStubWinPeer = "{00020424-0000-0000-C000-000000000046}";
+const char* const aInterIDWinPeer = "{BF5D10F3-8A10-4A0B-B150-2B6AA2D7E118}";
+const char* const aProxyStubWinPeer = "{00020424-0000-0000-C000-000000000046}";
 
 // ISODispatchInterceptor interface information
-const char* aInterIDDispInt = "{9337694C-B27D-4384-95A4-9D8E0EABC9E5}";
-const char* aProxyStubDispInt = "{00020424-0000-0000-C000-000000000046}";
+const char* const aInterIDDispInt = "{9337694C-B27D-4384-95A4-9D8E0EABC9E5}";
+const char* const aProxyStubDispInt = "{00020424-0000-0000-C000-000000000046}";
 
 // ISOActionsApproval interface information
-const char* aInterIDActApprove = "{029E9F1E-2B3F-4297-9160-8197DE7ED54F}";
-const char* aProxyStubActApprove = "{00020424-0000-0000-C000-000000000046}";
+const char* const aInterIDActApprove = "{029E9F1E-2B3F-4297-9160-8197DE7ED54F}";
+const char* const aProxyStubActApprove = "{00020424-0000-0000-C000-000000000046}";
 
 // The following prefix is required for HKEY_LOCAL_MACHINE and HKEY_CURRENT_USER ( not for HKEY_CLASSES_ROOT )
-const char* aLocalPrefix = "Software\\Classes\\";
+const char* const aLocalPrefix = "Software\\Classes\\";
 
 BOOL createKey( HKEY hkey,
                 const char* aKeyToCreate,
@@ -506,8 +506,8 @@ STDAPI DllUnregisterServerNative( int nMode, BOOL bForAllUsers, BOOL bFor64Bit )
 // DllRegisterServerDoc - Adds entries to the system registry
 
 #define SUPPORTED_MSEXT_NUM 7
-const char* aMSFileExt[] = { ".dot", ".doc", ".xlt", ".xls", ".pot", ".ppt", ".pps" };
-const char* aMSMimeType[] = { "application/msword",
+const char* const aMSFileExt[] = { ".dot", ".doc", ".xlt", ".xls", ".pot", ".ppt", ".pps" };
+const char* const aMSMimeType[] = { "application/msword",
                           "application/msword",
                           "application/msexcell",
                           "application/msexcell",
diff --git a/extensions/source/ole/oledll.cxx b/extensions/source/ole/oledll.cxx
index 941c151..62064e8 100644
--- a/extensions/source/ole/oledll.cxx
+++ b/extensions/source/ole/oledll.cxx
@@ -41,7 +41,7 @@
 #define _INIT_ATL_COMMON_VARS
 #endif
 #include <atlbase.h>
-CComModule _Module;
+static CComModule _Module;
 #include <atlcom.h>
 
 #if defined __clang__
commit 2597a2f1ada7738efc539b68b1ba164c342a72eb
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jan 11 13:38:22 2017 +0100

    loplugin:externvar (clang-cl)
    
    Change-Id: Ic7e4ba1ada97a0fff1ae6d209b22e372431cc6e7

diff --git a/embedserv/source/embed/servprov.cxx b/embedserv/source/embed/servprov.cxx
index b380e4c..5afe6d3 100644
--- a/embedserv/source/embed/servprov.cxx
+++ b/embedserv/source/embed/servprov.cxx
@@ -31,7 +31,7 @@
 
 using namespace com::sun::star;
 
-const GUID* guidList[ SUPPORTED_FACTORIES_NUM ] = {
+const GUID* const guidList[ SUPPORTED_FACTORIES_NUM ] = {
     &OID_WriterTextServer,
     &OID_WriterOASISTextServer,
     &OID_CalcServer,
diff --git a/embedserv/source/embed/tracker.cxx b/embedserv/source/embed/tracker.cxx
index acd0e32..cc10886 100644
--- a/embedserv/source/embed/tracker.cxx
+++ b/embedserv/source/embed/tracker.cxx
@@ -30,8 +30,8 @@
 #include "syswinwrapper.hxx"
 
 
-HCURSOR afxCursors[10] = { nullptr, };
-HBRUSH afxHalftoneBrush = nullptr;
+static HCURSOR afxCursors[10] = { nullptr, };
+static HBRUSH afxHalftoneBrush = nullptr;
 
 
 // the struct below is used to determine the qualities of a particular handle
@@ -218,9 +218,9 @@ Tracker::Tracker(LPCRECT lpSrcRect, UINT nStyle)
     m_nStyle = nStyle;
 }
 
-HBRUSH afxHatchBrush = nullptr;
-HPEN afxBlackDottedPen = nullptr;
-int afxHandleSize = 0;
+static HBRUSH afxHatchBrush = nullptr;
+static HPEN afxBlackDottedPen = nullptr;
+static int afxHandleSize = 0;
 
 
 void Tracker::Construct()
commit 691bc3e15d517a7ca5d45906f3aa4912597a7f3e
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jan 11 13:38:06 2017 +0100

    loplugin:externvar (clang-cl)
    
    Change-Id: I034eeb9525bbb8fdc39e176a2433f1b3dfff566a

diff --git a/embeddedobj/source/msole/olecomponent.cxx b/embeddedobj/source/msole/olecomponent.cxx
index fb0245c..2f06f04 100644
--- a/embeddedobj/source/msole/olecomponent.cxx
+++ b/embeddedobj/source/msole/olecomponent.cxx
@@ -165,7 +165,7 @@ public:
 
 typedef ::std::vector< FORMATETC* > FormatEtcList;
 
-FORMATETC pFormatTemplates[FORMATS_NUM] = {
+FORMATETC const pFormatTemplates[FORMATS_NUM] = {
                     { CF_ENHMETAFILE, nullptr, 0, -1, TYMED_ENHMF },
                     { CF_METAFILEPICT, nullptr, 0, -1, TYMED_MFPICT },
                     { CF_BITMAP, nullptr, 0, -1, TYMED_GDI } };
commit 91dfb4712d26e6d4b0989b7187034425fd6b3279
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jan 11 13:37:51 2017 +0100

    loplugin:externvar (clang-cl)
    
    Change-Id: I7219f2e720b7c1581c59cefe39e152c5aa20a8fe

diff --git a/dtrans/source/win32/dnd/globals.hxx b/dtrans/source/win32/dnd/globals.hxx
index a6f01d9..d876318 100644
--- a/dtrans/source/win32/dnd/globals.hxx
+++ b/dtrans/source/win32/dnd/globals.hxx
@@ -19,8 +19,15 @@
 #ifndef INCLUDED_DTRANS_SOURCE_WIN32_DND_GLOBALS_HXX
 #define INCLUDED_DTRANS_SOURCE_WIN32_DND_GLOBALS_HXX
 
+#include <sal/config.h>
+
+#include <com/sun/star/uno/Reference.hxx>
 #include <osl/mutex.hxx>
 
+namespace com { namespace sun { namespace star { namespace datatransfer {
+    class XTransferable;
+} } } }
+
 #if defined _MSC_VER
 #pragma warning(push,1)
 #endif
@@ -75,6 +82,8 @@ struct MutexDummy
     osl::Mutex m_mutex;
 };
 
+extern css::uno::Reference<css::datatransfer::XTransferable> g_XTransferable;
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dtrans/source/win32/dnd/source.cxx b/dtrans/source/win32/dnd/source.cxx
index 7bf94f8..85eb0d8 100644
--- a/dtrans/source/win32/dnd/source.cxx
+++ b/dtrans/source/win32/dnd/source.cxx
@@ -53,8 +53,6 @@ using namespace com::sun::star::awt::MouseButton;
 using namespace com::sun::star::awt;
 using namespace com::sun::star::lang;
 
-extern Reference< XTransferable > g_XTransferable;
-
 unsigned __stdcall DndOleSTAFunc(LPVOID pParams);
 
 DragSource::DragSource( const Reference<XComponentContext>& rxContext):
diff --git a/dtrans/source/win32/dnd/target.cxx b/dtrans/source/win32/dnd/target.cxx
index 5f2dea6..a9f6ae4 100644
--- a/dtrans/source/win32/dnd/target.cxx
+++ b/dtrans/source/win32/dnd/target.cxx
@@ -41,7 +41,6 @@ using namespace com::sun::star::datatransfer::dnd::DNDConstants;
 
 #define WM_REGISTERDRAGDROP WM_USER + 1
 #define WM_REVOKEDRAGDROP WM_USER + 2
-extern Reference< XTransferable > g_XTransferable;
 
 DWORD WINAPI DndTargetOleSTAFunc(LPVOID pParams);
 
commit f50fa59583138f8157bb7349a7ba31e2f76a8925
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jan 11 13:37:40 2017 +0100

    loplugin:externvar (clang-cl)
    
    Change-Id: Ibbcb8b6dfaf1c979db2e7930c4f6c8475d693ac8

diff --git a/connectivity/source/drivers/ado/Awrapado.cxx b/connectivity/source/drivers/ado/Awrapado.cxx
index b37610d..5a47169 100644
--- a/connectivity/source/drivers/ado/Awrapado.cxx
+++ b/connectivity/source/drivers/ado/Awrapado.cxx
@@ -23,14 +23,6 @@
 #include <comphelper/types.hxx>
 #include <rtl/ustrbuf.hxx>
 
-namespace connectivity
-{
-    namespace ado
-    {
-        sal_Int32 nAdoObjectCounter = 0;
-    }
-}
-
 using namespace connectivity::ado;
 
 void WpADOCatalog::Create()
commit f22e5db80b46b71a3df66bc7f829f0b22168b5b0
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Jan 11 13:35:50 2017 +0100

    loplugin:externvar (clang-cl)
    
    Change-Id: Ied0ee5f637e83fe7819c68e3f4ea4634f21ac3f6

diff --git a/canvas/source/directx/dx_canvas.cxx b/canvas/source/directx/dx_canvas.cxx
index 8f806a5..b42f2ab 100644
--- a/canvas/source/directx/dx_canvas.cxx
+++ b/canvas/source/directx/dx_canvas.cxx
@@ -219,7 +219,7 @@ namespace dxcanvas
         return xRet;
     }
 
-    sdecl::class_<Canvas, sdecl::with_args<true> > serviceImpl1(&initCanvas);
+    sdecl::class_<Canvas, sdecl::with_args<true> > const serviceImpl1(&initCanvas);
     const sdecl::ServiceDecl dxCanvasDecl(
         serviceImpl1,
         CANVAS_IMPLEMENTATION_NAME,
@@ -233,7 +233,7 @@ namespace dxcanvas
     }
 
     namespace sdecl = comphelper::service_decl;
-    sdecl::class_<BitmapCanvas, sdecl::with_args<true> > serviceImpl2(&initBitmapCanvas);
+    sdecl::class_<BitmapCanvas, sdecl::with_args<true> > const serviceImpl2(&initBitmapCanvas);
     const sdecl::ServiceDecl dxBitmapCanvasDecl(
         serviceImpl2,
         BITMAPCANVAS_IMPLEMENTATION_NAME,
diff --git a/canvas/source/directx/dx_spritecanvas.cxx b/canvas/source/directx/dx_spritecanvas.cxx
index 16d7287..5c65c33 100644
--- a/canvas/source/directx/dx_spritecanvas.cxx
+++ b/canvas/source/directx/dx_spritecanvas.cxx
@@ -180,7 +180,7 @@ namespace dxcanvas
         return xRet;
     }
 
-    sdecl::class_<SpriteCanvas, sdecl::with_args<true> > serviceImpl(&initCanvas);
+    sdecl::class_<SpriteCanvas, sdecl::with_args<true> > const serviceImpl(&initCanvas);
     const sdecl::ServiceDecl dxSpriteCanvasDecl(
         serviceImpl,
         SPRITECANVAS_IMPLEMENTATION_NAME,


More information about the Libreoffice-commits mailing list