summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-09-15 19:10:54 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-09-17 09:05:16 +0200
commita85d3ba1c0de313b60324b9ecfa488bb99d69d06 (patch)
tree3d2fe95aae78325d9a5b61b6b73ba6179ce0f752 /i18npool
parent30530afaaa715473a2f9c3f068beeed5f3a98daf (diff)
loplugin:external in i18npool
...showing that print_node etc. are actually unused Change-Id: Ife7faf53dc2487a7ee0cfbe131a761ea18104945 Reviewed-on: https://gerrit.libreoffice.org/60538 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'i18npool')
-rw-r--r--i18npool/source/calendar/calendar_jewish.cxx16
-rw-r--r--i18npool/source/collator/gencoll_rule.cxx2
-rw-r--r--i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx2
-rw-r--r--i18npool/source/localedata/LocaleNode.cxx69
-rw-r--r--i18npool/source/localedata/saxparser.cxx2
-rw-r--r--i18npool/source/nativenumber/nativenumbersupplier.cxx14
-rw-r--r--i18npool/source/registerservices/registerservices.cxx4
-rw-r--r--i18npool/source/search/textsearch.cxx4
-rw-r--r--i18npool/source/textconversion/genconv_dict.cxx8
-rw-r--r--i18npool/source/textconversion/textconversion_ko.cxx2
-rw-r--r--i18npool/source/textconversion/textconversion_zh.cxx2
-rw-r--r--i18npool/source/transliteration/ignoreKashida_CTL.cxx2
-rw-r--r--i18npool/source/transliteration/ignoreMiddleDot_ja_JP.cxx2
-rw-r--r--i18npool/source/transliteration/ignoreMinusSign_ja_JP.cxx2
-rw-r--r--i18npool/source/transliteration/ignoreTraditionalKana_ja_JP.cxx2
-rw-r--r--i18npool/source/transliteration/ignoreZiZu_ja_JP.cxx2
-rw-r--r--i18npool/source/transliteration/transliterationImpl.cxx4
17 files changed, 36 insertions, 103 deletions
diff --git a/i18npool/source/calendar/calendar_jewish.cxx b/i18npool/source/calendar/calendar_jewish.cxx
index 1a36ffa5ffad..837f6f14f35a 100644
--- a/i18npool/source/calendar/calendar_jewish.cxx
+++ b/i18npool/source/calendar/calendar_jewish.cxx
@@ -51,18 +51,18 @@ Calendar_jewish::Calendar_jewish()
const int HebrewEpoch = -1373429; // Absolute date of start of Hebrew calendar
// True if year is an Hebrew leap year
-bool HebrewLeapYear(sal_Int32 year) {
+static bool HebrewLeapYear(sal_Int32 year) {
return ((((7 * year) + 1) % 19) < 7);
}
// Last month of Hebrew year.
-sal_Int32 LastMonthOfHebrewYear(sal_Int32 year) {
+static sal_Int32 LastMonthOfHebrewYear(sal_Int32 year) {
return (HebrewLeapYear(year)) ? 13 : 12;
}
// Number of days elapsed from the Sunday prior to the start of the
// Hebrew calendar to the mean conjunction of Tishri of Hebrew year.
-sal_Int32 HebrewCalendarElapsedDays(sal_Int32 year) {
+static sal_Int32 HebrewCalendarElapsedDays(sal_Int32 year) {
sal_Int32 MonthsElapsed =
(235 * ((year - 1) / 19)) // Months in complete cycles so far.
+ (12 * ((year - 1) % 19)) // Regular months in this cycle.
@@ -97,23 +97,23 @@ sal_Int32 HebrewCalendarElapsedDays(sal_Int32 year) {
}
// Number of days in Hebrew year.
-sal_Int32 DaysInHebrewYear(sal_Int32 year) {
+static sal_Int32 DaysInHebrewYear(sal_Int32 year) {
return ((HebrewCalendarElapsedDays(year + 1)) -
(HebrewCalendarElapsedDays(year)));
}
// True if Heshvan is long in Hebrew year.
-bool LongHeshvan(sal_Int32 year) {
+static bool LongHeshvan(sal_Int32 year) {
return ((DaysInHebrewYear(year) % 10) == 5);
}
// True if Kislev is short in Hebrew year.
-bool ShortKislev(sal_Int32 year) {
+static bool ShortKislev(sal_Int32 year) {
return ((DaysInHebrewYear(year) % 10) == 3);
}
// Last day of month in Hebrew year.
-sal_Int32 LastDayOfHebrewMonth(sal_Int32 month, sal_Int32 year) {
+static sal_Int32 LastDayOfHebrewMonth(sal_Int32 month, sal_Int32 year) {
if ((month == 2)
|| (month == 4)
|| (month == 6)
@@ -188,7 +188,7 @@ public:
// Gregorian dates
-int LastDayOfGregorianMonth(int month, int year) {
+static int LastDayOfGregorianMonth(int month, int year) {
// Compute the last date of the month for the Gregorian calendar.
switch (month) {
diff --git a/i18npool/source/collator/gencoll_rule.cxx b/i18npool/source/collator/gencoll_rule.cxx
index 3048d12bb90b..88b8b50ea423 100644
--- a/i18npool/source/collator/gencoll_rule.cxx
+++ b/i18npool/source/collator/gencoll_rule.cxx
@@ -33,7 +33,7 @@
/* Main Procedure */
-void data_write(char* file, char* name, sal_uInt8 *data, sal_Int32 len)
+static void data_write(char* file, char* name, sal_uInt8 *data, sal_Int32 len)
{
FILE *fp = fopen(file, "wb");
if (fp == nullptr) {
diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
index b36195569c18..899ea58457d3 100644
--- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
+++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
@@ -304,7 +304,7 @@ DefaultNumberingProvider::getDefaultContinuousNumberingLevels( const Locale& rLo
return LocaleDataImpl::get()->getContinuousNumberingLevels( rLocale );
}
-OUString toRoman( sal_Int32 n )
+static OUString toRoman( sal_Int32 n )
{
// i, ii, iii, iv, v, vi, vii, vii, viii, ix
diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx
index 19554017041e..37a732690d6d 100644
--- a/i18npool/source/localedata/LocaleNode.cxx
+++ b/i18npool/source/localedata/LocaleNode.cxx
@@ -123,73 +123,6 @@ LocaleNode* LocaleNode::createNode (const OUString& name, const Reference< XAttr
#define OSTR(s) (OUStringToOString( (s), RTL_TEXTENCODING_UTF8).getStr())
-void print_OUString( const OUString& s )
-{
- printf( "%s", OSTR(s));
-}
-
-bool is_empty_string( const OUString& s )
-{
- return s.isEmpty() || s == "\n";
-}
-
-void print_indent( int depth )
-{
- for( int i=0; i<depth; i++ ) printf(" ");
-}
-
-void print_color( int color )
-{
- printf("\033[%dm", color);
-}
-
-void print_node( const LocaleNode* p, int depth )
-{
- if( !p ) return;
-
- print_indent( depth );
- printf("<");
- print_color(36);
- print_OUString( p->getName() );
- print_color(0);
- const Attr& q = p->getAttr();
- for( sal_Int32 j = 0; j < q.getLength(); ++j )
- {
- printf(" ");
- print_color(33);
- print_OUString( q.getTypeByIndex(j) );
- print_color(0);
- printf("=");
- print_color(31);
- printf("'");
- print_OUString( q.getValueByIndex(j) );
- printf("'");
- print_color(0);
- }
- printf(">");
- printf("\n");
- if( !is_empty_string( p->getValue() ) )
- {
- print_indent( depth+1 );
- printf("value: ");
- print_color(31);
- printf("'");
- print_OUString( p->getValue() );
- printf("'");
- print_color(0);
- printf("\n");
- }
- for( sal_Int32 i=0; i<p->getNumberOfChildren(); i++ )
- {
- print_node( p->getChildAt(i), depth+1 );
- }
- print_indent( depth );
- printf("</");
- print_OUString( p->getName() );
- printf(">");
- printf("\n");
-}
-
void LocaleNode::generateCode (const OFileWriter &of) const
{
OUString aDTD = getAttr().getValueByName("versionDTD");
@@ -1895,7 +1828,7 @@ void LCCalendarNode::generateCode (const OFileWriter &of) const
of.writeFunction("getAllCalendars_", "calendarsCount", "calendars");
}
-bool isIso4217( const OUString& rStr )
+static bool isIso4217( const OUString& rStr )
{
const sal_Unicode* p = rStr.getStr();
return rStr.getLength() == 3
diff --git a/i18npool/source/localedata/saxparser.cxx b/i18npool/source/localedata/saxparser.cxx
index d75cf7206ab7..183611fff00e 100644
--- a/i18npool/source/localedata/saxparser.cxx
+++ b/i18npool/source/localedata/saxparser.cxx
@@ -96,7 +96,7 @@ public:
// Helper : create an input stream from a file
-Reference< XInputStream > createStreamFromFile(
+static Reference< XInputStream > createStreamFromFile(
const char *pcFile )
{
Reference< XInputStream > r;
diff --git a/i18npool/source/nativenumber/nativenumbersupplier.cxx b/i18npool/source/nativenumber/nativenumbersupplier.cxx
index 5272954ecaad..e3a023d792df 100644
--- a/i18npool/source/nativenumber/nativenumbersupplier.cxx
+++ b/i18npool/source/nativenumber/nativenumbersupplier.cxx
@@ -64,12 +64,12 @@ namespace i18npool {
struct theNatNumMutex : public rtl::Static<osl::Mutex, theNatNumMutex> {};
-OUString getHebrewNativeNumberString(const OUString& aNumberString, bool useGeresh);
+static OUString getHebrewNativeNumberString(const OUString& aNumberString, bool useGeresh);
-OUString getCyrillicNativeNumberString(const OUString& aNumberString);
+static OUString getCyrillicNativeNumberString(const OUString& aNumberString);
/// @throws RuntimeException
-OUString AsciiToNativeChar( const OUString& inStr, sal_Int32 nCount,
+static OUString AsciiToNativeChar( const OUString& inStr, sal_Int32 nCount,
Sequence< sal_Int32 >& offset, bool useOffset, sal_Int16 number )
{
const sal_Unicode *src = inStr.getStr();
@@ -97,7 +97,7 @@ OUString AsciiToNativeChar( const OUString& inStr, sal_Int32 nCount,
return OUString(newStr, SAL_NO_ACQUIRE); // take ownership
}
-bool AsciiToNative_numberMaker(const sal_Unicode *str, sal_Int32 begin, sal_Int32 len,
+static bool AsciiToNative_numberMaker(const sal_Unicode *str, sal_Int32 begin, sal_Int32 len,
sal_Unicode *dst, sal_Int32& count, sal_Int16 multiChar_index, Sequence< sal_Int32 >& offset, bool useOffset, sal_Int32 startPos,
const Number *number, const sal_Unicode* numberChar)
{
@@ -169,7 +169,7 @@ bool AsciiToNative_numberMaker(const sal_Unicode *str, sal_Int32 begin, sal_Int3
}
/// @throws RuntimeException
-OUString AsciiToNative( const OUString& inStr, sal_Int32 nCount,
+static OUString AsciiToNative( const OUString& inStr, sal_Int32 nCount,
Sequence< sal_Int32 >& offset, bool useOffset, const Number* number )
{
OUString aRet;
@@ -1015,7 +1015,7 @@ static const sal_Unicode thousands_last[] = {0x05d0, 0x05dc, 0x05e4, 0x05d9, 0x0
static const sal_Unicode geresh = 0x05f3;
static const sal_Unicode gershayim = 0x05f4;
-void makeHebrewNumber(sal_Int64 value, OUStringBuffer& output, bool isLast, bool useGeresh)
+static void makeHebrewNumber(sal_Int64 value, OUStringBuffer& output, bool isLast, bool useGeresh)
{
sal_Int16 num = sal::static_int_cast<sal_Int16>(value % 1000);
@@ -1121,7 +1121,7 @@ struct CyrillicNumberChar {
{ 0x0430, 1 }
};
-void makeCyrillicNumber(sal_Int64 value, OUStringBuffer& output, bool addTitlo)
+static void makeCyrillicNumber(sal_Int64 value, OUStringBuffer& output, bool addTitlo)
{
sal_Int16 num = sal::static_int_cast<sal_Int16>(value % 1000);
if (value >= 1000) {
diff --git a/i18npool/source/registerservices/registerservices.cxx b/i18npool/source/registerservices/registerservices.cxx
index 0a3fa328d9aa..392da9ce9a6c 100644
--- a/i18npool/source/registerservices/registerservices.cxx
+++ b/i18npool/source/registerservices/registerservices.cxx
@@ -64,7 +64,7 @@ using namespace ::com::sun::star::i18n;
using namespace i18npool;
#define IMPL_CREATEINSTANCE( ImplName ) \
- uno::Reference< uno::XInterface > \
+ static uno::Reference< uno::XInterface > \
ImplName##_CreateInstance( \
SAL_UNUSED_PARAMETER const uno::Reference< \
lang::XMultiServiceFactory >& ) \
@@ -75,7 +75,7 @@ using namespace i18npool;
}
#define IMPL_CREATEINSTANCE_CTX( ImplName ) \
- uno::Reference< uno::XInterface > \
+ static uno::Reference< uno::XInterface > \
ImplName##_CreateInstance( \
const uno::Reference< \
lang::XMultiServiceFactory >& rxMSF ) \
diff --git a/i18npool/source/search/textsearch.cxx b/i18npool/source/search/textsearch.cxx
index 25d2e3196864..906dd12c5263 100644
--- a/i18npool/source/search/textsearch.cxx
+++ b/i18npool/source/search/textsearch.cxx
@@ -287,7 +287,7 @@ void TextSearch::setOptions( const SearchOptions& rOptions )
setOptions2( aOptions2);
}
-sal_Int32 FindPosInSeq_Impl( const Sequence <sal_Int32>& rOff, sal_Int32 nPos )
+static sal_Int32 FindPosInSeq_Impl( const Sequence <sal_Int32>& rOff, sal_Int32 nPos )
{
sal_Int32 nRet = 0, nEnd = rOff.getLength();
while( nRet < nEnd && nPos > rOff[ nRet ] ) ++nRet;
@@ -1551,7 +1551,7 @@ TextSearch::getSupportedServiceNames()
return aRet;
}
-css::uno::Reference< css::uno::XInterface >
+static css::uno::Reference< css::uno::XInterface >
TextSearch_CreateInstance(
const css::uno::Reference<
css::lang::XMultiServiceFactory >& rxMSF )
diff --git a/i18npool/source/textconversion/genconv_dict.cxx b/i18npool/source/textconversion/genconv_dict.cxx
index 91836a392864..40e8cd99a9d3 100644
--- a/i18npool/source/textconversion/genconv_dict.cxx
+++ b/i18npool/source/textconversion/genconv_dict.cxx
@@ -29,9 +29,9 @@
#include <vector>
-void make_hhc_char(FILE *sfp, FILE *cfp);
-void make_stc_char(FILE *sfp, FILE *cfp);
-void make_stc_word(FILE *sfp, FILE *cfp);
+static void make_hhc_char(FILE *sfp, FILE *cfp);
+static void make_stc_char(FILE *sfp, FILE *cfp);
+static void make_stc_word(FILE *sfp, FILE *cfp);
/* Main Procedure */
@@ -328,7 +328,7 @@ typedef struct {
} Index;
extern "C" {
-int Index_comp(const void* s1, const void* s2)
+static int Index_comp(const void* s1, const void* s2)
{
Index const *p1 = static_cast<Index const *>(s1), *p2 = static_cast<Index const *>(s2);
int result = p1->len - p2->len;
diff --git a/i18npool/source/textconversion/textconversion_ko.cxx b/i18npool/source/textconversion/textconversion_ko.cxx
index b1dfe5d28cb7..f09aa509e909 100644
--- a/i18npool/source/textconversion/textconversion_ko.cxx
+++ b/i18npool/source/textconversion/textconversion_ko.cxx
@@ -79,7 +79,7 @@ TextConversion_ko::TextConversion_ko( const Reference < XComponentContext >& xCo
}
}
-sal_Int16 checkScriptType(sal_Unicode c)
+static sal_Int16 checkScriptType(sal_Unicode c)
{
typedef struct {
UBlockCode from;
diff --git a/i18npool/source/textconversion/textconversion_zh.cxx b/i18npool/source/textconversion/textconversion_zh.cxx
index cf32266012d8..0e1348e8cf9b 100644
--- a/i18npool/source/textconversion/textconversion_zh.cxx
+++ b/i18npool/source/textconversion/textconversion_zh.cxx
@@ -42,7 +42,7 @@ TextConversion_zh::TextConversion_zh( const Reference < XComponentContext >& xCo
xCDL = ConversionDictionaryList::create(xContext);
}
-sal_Unicode getOneCharConversion(sal_Unicode ch, const sal_Unicode* Data, const sal_uInt16* Index)
+static sal_Unicode getOneCharConversion(sal_Unicode ch, const sal_Unicode* Data, const sal_uInt16* Index)
{
if (Data && Index) {
sal_Unicode address = Index[ch>>8];
diff --git a/i18npool/source/transliteration/ignoreKashida_CTL.cxx b/i18npool/source/transliteration/ignoreKashida_CTL.cxx
index 20b6c0f858da..4dfb54da2e7d 100644
--- a/i18npool/source/transliteration/ignoreKashida_CTL.cxx
+++ b/i18npool/source/transliteration/ignoreKashida_CTL.cxx
@@ -11,7 +11,7 @@
namespace i18npool {
-sal_Unicode
+static sal_Unicode
ignoreKashida_CTL_translator (const sal_Unicode c)
{
if( c == 0x0640 ) // Check if it's Kashida
diff --git a/i18npool/source/transliteration/ignoreMiddleDot_ja_JP.cxx b/i18npool/source/transliteration/ignoreMiddleDot_ja_JP.cxx
index eb7af6ef5779..b95a46910ae2 100644
--- a/i18npool/source/transliteration/ignoreMiddleDot_ja_JP.cxx
+++ b/i18npool/source/transliteration/ignoreMiddleDot_ja_JP.cxx
@@ -21,7 +21,7 @@
namespace i18npool {
-sal_Unicode
+static sal_Unicode
ignoreMiddleDot_ja_JP_translator (const sal_Unicode c)
{
switch (c) {
diff --git a/i18npool/source/transliteration/ignoreMinusSign_ja_JP.cxx b/i18npool/source/transliteration/ignoreMinusSign_ja_JP.cxx
index 823d43ac4cc0..831d0389889e 100644
--- a/i18npool/source/transliteration/ignoreMinusSign_ja_JP.cxx
+++ b/i18npool/source/transliteration/ignoreMinusSign_ja_JP.cxx
@@ -21,7 +21,7 @@
namespace i18npool {
-sal_Unicode
+static sal_Unicode
ignoreMinusSign_ja_JP_translator (const sal_Unicode c)
{
switch (c) {
diff --git a/i18npool/source/transliteration/ignoreTraditionalKana_ja_JP.cxx b/i18npool/source/transliteration/ignoreTraditionalKana_ja_JP.cxx
index b62d79440024..78afd9401c80 100644
--- a/i18npool/source/transliteration/ignoreTraditionalKana_ja_JP.cxx
+++ b/i18npool/source/transliteration/ignoreTraditionalKana_ja_JP.cxx
@@ -21,7 +21,7 @@
namespace i18npool {
-sal_Unicode
+static sal_Unicode
ignoreTraditionalKana_ja_JP_translator (const sal_Unicode c)
{
diff --git a/i18npool/source/transliteration/ignoreZiZu_ja_JP.cxx b/i18npool/source/transliteration/ignoreZiZu_ja_JP.cxx
index 3591078eaaec..029e335b68e3 100644
--- a/i18npool/source/transliteration/ignoreZiZu_ja_JP.cxx
+++ b/i18npool/source/transliteration/ignoreZiZu_ja_JP.cxx
@@ -21,7 +21,7 @@
namespace i18npool {
-sal_Unicode
+static sal_Unicode
ignoreZiZu_ja_JP_translator (const sal_Unicode c)
{
diff --git a/i18npool/source/transliteration/transliterationImpl.cxx b/i18npool/source/transliteration/transliterationImpl.cxx
index ba5c0623dbc2..900160f2971c 100644
--- a/i18npool/source/transliteration/transliterationImpl.cxx
+++ b/i18npool/source/transliteration/transliterationImpl.cxx
@@ -170,10 +170,10 @@ TransliterationImpl::getType()
throw ERROR;
}
-TransliterationModules operator&(TransliterationModules lhs, TransliterationModules rhs) {
+static TransliterationModules operator&(TransliterationModules lhs, TransliterationModules rhs) {
return TransliterationModules(sal_Int32(lhs) & sal_Int32(rhs));
}
-TransliterationModules operator|(TransliterationModules lhs, TransliterationModules rhs) {
+static TransliterationModules operator|(TransliterationModules lhs, TransliterationModules rhs) {
return TransliterationModules(sal_Int32(lhs) | sal_Int32(rhs));
}