From 387a035d749ff7f00beca82f83e7aa5d8c5e9fcd Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 9 Jan 2017 15:41:25 +0100 Subject: New loplugin:externvar: sal Change-Id: Iefc33784f21e7a0b88c8d6308618926e38ab8554 --- include/rtl/strbuf.hxx | 5 +++++ include/rtl/string.hxx | 5 +++++ include/rtl/stringconcat.hxx | 4 ++++ include/rtl/ustrbuf.hxx | 4 ++++ include/rtl/ustring.hxx | 4 ++++ sal/inc/salusesyslog.hxx | 23 ++++++++++++++++++++++ sal/osl/all/log.cxx | 1 + sal/osl/unx/salinit.cxx | 3 +-- sal/qa/osl/file/osl_File.cxx | 2 +- sal/qa/rtl/strings/test_ostring_concat.cxx | 3 ++- sal/qa/rtl/strings/test_ostring_stringliterals.cxx | 8 ++++---- .../rtl/strings/test_oustring_stringliterals.cxx | 7 +++---- 12 files changed, 57 insertions(+), 12 deletions(-) create mode 100644 sal/inc/salusesyslog.hxx diff --git a/include/rtl/strbuf.hxx b/include/rtl/strbuf.hxx index 8c9148b3e984..7cf4123d0ae8 100644 --- a/include/rtl/strbuf.hxx +++ b/include/rtl/strbuf.hxx @@ -34,6 +34,11 @@ #include #endif +#ifdef RTL_STRING_UNITTEST +extern bool rtl_string_unittest_const_literal; +extern bool rtl_string_unittest_const_literal_function; +#endif + // The unittest uses slightly different code to help check that the proper // calls are made. The class is put into a different namespace to make // sure the compiler generates a different (if generating also non-inline) diff --git a/include/rtl/string.hxx b/include/rtl/string.hxx index 827ab8e3fbd5..8f5d044e5a4e 100644 --- a/include/rtl/string.hxx +++ b/include/rtl/string.hxx @@ -39,6 +39,11 @@ #include +#ifdef RTL_STRING_UNITTEST +extern bool rtl_string_unittest_const_literal; +extern bool rtl_string_unittest_const_literal_function; +#endif + // The unittest uses slightly different code to help check that the proper // calls are made. The class is put into a different namespace to make // sure the compiler generates a different (if generating also non-inline) diff --git a/include/rtl/stringconcat.hxx b/include/rtl/stringconcat.hxx index d5bc4e8eb500..9fd5332b2404 100644 --- a/include/rtl/stringconcat.hxx +++ b/include/rtl/stringconcat.hxx @@ -17,6 +17,10 @@ #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING" +#if defined RTL_STRING_UNITTEST_CONCAT +extern bool rtl_string_unittest_invalid_concat; +#endif + #ifdef RTL_STRING_UNITTEST #define rtl rtlunittest #endif diff --git a/include/rtl/ustrbuf.hxx b/include/rtl/ustrbuf.hxx index 4665d20b1d35..57c73a8012f8 100644 --- a/include/rtl/ustrbuf.hxx +++ b/include/rtl/ustrbuf.hxx @@ -35,6 +35,10 @@ #include #endif +#ifdef RTL_STRING_UNITTEST +extern bool rtl_string_unittest_invalid_conversion; +#endif + // The unittest uses slightly different code to help check that the proper // calls are made. The class is put into a different namespace to make // sure the compiler generates a different (if generating also non-inline) diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx index c6c312442dec..eed067c1b754 100644 --- a/include/rtl/ustring.hxx +++ b/include/rtl/ustring.hxx @@ -39,6 +39,10 @@ #include #endif +#ifdef RTL_STRING_UNITTEST +extern bool rtl_string_unittest_invalid_conversion; +#endif + // The unittest uses slightly different code to help check that the proper // calls are made. The class is put into a different namespace to make // sure the compiler generates a different (if generating also non-inline) diff --git a/sal/inc/salusesyslog.hxx b/sal/inc/salusesyslog.hxx new file mode 100644 index 000000000000..ae1c14a886cb --- /dev/null +++ b/sal/inc/salusesyslog.hxx @@ -0,0 +1,23 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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/. + */ + +#ifndef INCLUDED_SAL_INC_SALUSESYSLOG_HXX +#define INCLUDED_SAL_INC_SALUSESYSLOG_HXX + +#include + +#include + +#if HAVE_SYSLOG_H +extern bool sal_use_syslog; +#endif + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/sal/osl/all/log.cxx b/sal/osl/all/log.cxx index b400e43ab164..23f45cdb4875 100644 --- a/sal/osl/all/log.cxx +++ b/sal/osl/all/log.cxx @@ -27,6 +27,7 @@ #include "sal/log.hxx" #include "sal/types.h" #include "misc.hxx" +#include "salusesyslog.hxx" #if defined ANDROID #include diff --git a/sal/osl/unx/salinit.cxx b/sal/osl/unx/salinit.cxx index da7ede593404..fdde9e84980c 100644 --- a/sal/osl/unx/salinit.cxx +++ b/sal/osl/unx/salinit.cxx @@ -33,12 +33,11 @@ #include "sal/types.h" #include +#include #if HAVE_SYSLOG_H #include #include -// from sal/osl/all/log.cxx: -extern bool sal_use_syslog; #endif extern "C" { diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx index 1f8841c129f0..ae4243b4b25d 100644 --- a/sal/qa/osl/file/osl_File.cxx +++ b/sal/qa/osl/file/osl_File.cxx @@ -5090,6 +5090,6 @@ class GlobalObject } }; -GlobalObject theGlobalObject; +static GlobalObject theGlobalObject; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sal/qa/rtl/strings/test_ostring_concat.cxx b/sal/qa/rtl/strings/test_ostring_concat.cxx index 0326df1aaccd..b2adc17272d6 100644 --- a/sal/qa/rtl/strings/test_ostring_concat.cxx +++ b/sal/qa/rtl/strings/test_ostring_concat.cxx @@ -9,7 +9,6 @@ // activate support for detecting errors instead of getting compile errors #define RTL_STRING_UNITTEST_CONCAT -bool rtl_string_unittest_invalid_concat = false; #include #include @@ -22,6 +21,8 @@ bool rtl_string_unittest_invalid_concat = false; #include +bool rtl_string_unittest_invalid_concat = false; + using namespace rtl; namespace std diff --git a/sal/qa/rtl/strings/test_ostring_stringliterals.cxx b/sal/qa/rtl/strings/test_ostring_stringliterals.cxx index 2b08581d0712..9d81a90ac6a9 100644 --- a/sal/qa/rtl/strings/test_ostring_stringliterals.cxx +++ b/sal/qa/rtl/strings/test_ostring_stringliterals.cxx @@ -9,10 +9,6 @@ // activate the extra needed ctor #define RTL_STRING_UNITTEST -bool rtl_string_unittest_const_literal; -bool rtl_string_unittest_invalid_conversion; -bool rtl_string_unittest_const_literal_function; -bool rtl_string_unittest_non_const_literal_function; #include #include @@ -21,6 +17,10 @@ bool rtl_string_unittest_non_const_literal_function; #include "rtl/string.hxx" #include "rtl/strbuf.hxx" +bool rtl_string_unittest_const_literal; +bool rtl_string_unittest_const_literal_function; +static bool rtl_string_unittest_non_const_literal_function; + namespace test { namespace ostring { class StringLiterals: public CppUnit::TestFixture diff --git a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx index 3c0b996627dc..094a779fc2f1 100644 --- a/sal/qa/rtl/strings/test_oustring_stringliterals.cxx +++ b/sal/qa/rtl/strings/test_oustring_stringliterals.cxx @@ -9,10 +9,6 @@ // activate the extra needed ctor #define RTL_STRING_UNITTEST -extern bool rtl_string_unittest_const_literal; -extern bool rtl_string_unittest_invalid_conversion; -extern bool rtl_string_unittest_const_literal_function; -extern bool rtl_string_unittest_non_const_literal_function; #include @@ -26,6 +22,9 @@ extern bool rtl_string_unittest_non_const_literal_function; #include "rtl/ustring.hxx" #include "rtl/ustrbuf.hxx" +extern bool rtl_string_unittest_const_literal; +bool rtl_string_unittest_invalid_conversion; + namespace test { namespace oustring { class StringLiterals: public CppUnit::TestFixture -- cgit