Kaydet (Commit) a85d3ba1 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 30530afa
...@@ -51,18 +51,18 @@ Calendar_jewish::Calendar_jewish() ...@@ -51,18 +51,18 @@ Calendar_jewish::Calendar_jewish()
const int HebrewEpoch = -1373429; // Absolute date of start of Hebrew calendar const int HebrewEpoch = -1373429; // Absolute date of start of Hebrew calendar
// True if year is an Hebrew leap year // 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); return ((((7 * year) + 1) % 19) < 7);
} }
// Last month of Hebrew year. // Last month of Hebrew year.
sal_Int32 LastMonthOfHebrewYear(sal_Int32 year) { static sal_Int32 LastMonthOfHebrewYear(sal_Int32 year) {
return (HebrewLeapYear(year)) ? 13 : 12; return (HebrewLeapYear(year)) ? 13 : 12;
} }
// Number of days elapsed from the Sunday prior to the start of the // Number of days elapsed from the Sunday prior to the start of the
// Hebrew calendar to the mean conjunction of Tishri of Hebrew year. // 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 = sal_Int32 MonthsElapsed =
(235 * ((year - 1) / 19)) // Months in complete cycles so far. (235 * ((year - 1) / 19)) // Months in complete cycles so far.
+ (12 * ((year - 1) % 19)) // Regular months in this cycle. + (12 * ((year - 1) % 19)) // Regular months in this cycle.
...@@ -97,23 +97,23 @@ sal_Int32 HebrewCalendarElapsedDays(sal_Int32 year) { ...@@ -97,23 +97,23 @@ sal_Int32 HebrewCalendarElapsedDays(sal_Int32 year) {
} }
// Number of days in Hebrew year. // Number of days in Hebrew year.
sal_Int32 DaysInHebrewYear(sal_Int32 year) { static sal_Int32 DaysInHebrewYear(sal_Int32 year) {
return ((HebrewCalendarElapsedDays(year + 1)) - return ((HebrewCalendarElapsedDays(year + 1)) -
(HebrewCalendarElapsedDays(year))); (HebrewCalendarElapsedDays(year)));
} }
// True if Heshvan is long in Hebrew 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); return ((DaysInHebrewYear(year) % 10) == 5);
} }
// True if Kislev is short in Hebrew year. // True if Kislev is short in Hebrew year.
bool ShortKislev(sal_Int32 year) { static bool ShortKislev(sal_Int32 year) {
return ((DaysInHebrewYear(year) % 10) == 3); return ((DaysInHebrewYear(year) % 10) == 3);
} }
// Last day of month in Hebrew year. // 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) if ((month == 2)
|| (month == 4) || (month == 4)
|| (month == 6) || (month == 6)
...@@ -188,7 +188,7 @@ public: ...@@ -188,7 +188,7 @@ public:
// Gregorian dates // 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. // Compute the last date of the month for the Gregorian calendar.
switch (month) { switch (month) {
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
/* Main Procedure */ /* 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"); FILE *fp = fopen(file, "wb");
if (fp == nullptr) { if (fp == nullptr) {
......
...@@ -304,7 +304,7 @@ DefaultNumberingProvider::getDefaultContinuousNumberingLevels( const Locale& rLo ...@@ -304,7 +304,7 @@ DefaultNumberingProvider::getDefaultContinuousNumberingLevels( const Locale& rLo
return LocaleDataImpl::get()->getContinuousNumberingLevels( rLocale ); 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 // i, ii, iii, iv, v, vi, vii, vii, viii, ix
......
...@@ -123,73 +123,6 @@ LocaleNode* LocaleNode::createNode (const OUString& name, const Reference< XAttr ...@@ -123,73 +123,6 @@ LocaleNode* LocaleNode::createNode (const OUString& name, const Reference< XAttr
#define OSTR(s) (OUStringToOString( (s), RTL_TEXTENCODING_UTF8).getStr()) #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 void LocaleNode::generateCode (const OFileWriter &of) const
{ {
OUString aDTD = getAttr().getValueByName("versionDTD"); OUString aDTD = getAttr().getValueByName("versionDTD");
...@@ -1895,7 +1828,7 @@ void LCCalendarNode::generateCode (const OFileWriter &of) const ...@@ -1895,7 +1828,7 @@ void LCCalendarNode::generateCode (const OFileWriter &of) const
of.writeFunction("getAllCalendars_", "calendarsCount", "calendars"); of.writeFunction("getAllCalendars_", "calendarsCount", "calendars");
} }
bool isIso4217( const OUString& rStr ) static bool isIso4217( const OUString& rStr )
{ {
const sal_Unicode* p = rStr.getStr(); const sal_Unicode* p = rStr.getStr();
return rStr.getLength() == 3 return rStr.getLength() == 3
......
...@@ -96,7 +96,7 @@ public: ...@@ -96,7 +96,7 @@ public:
// Helper : create an input stream from a file // Helper : create an input stream from a file
Reference< XInputStream > createStreamFromFile( static Reference< XInputStream > createStreamFromFile(
const char *pcFile ) const char *pcFile )
{ {
Reference< XInputStream > r; Reference< XInputStream > r;
......
...@@ -64,12 +64,12 @@ namespace i18npool { ...@@ -64,12 +64,12 @@ namespace i18npool {
struct theNatNumMutex : public rtl::Static<osl::Mutex, theNatNumMutex> {}; 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 /// @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 ) Sequence< sal_Int32 >& offset, bool useOffset, sal_Int16 number )
{ {
const sal_Unicode *src = inStr.getStr(); const sal_Unicode *src = inStr.getStr();
...@@ -97,7 +97,7 @@ OUString AsciiToNativeChar( const OUString& inStr, sal_Int32 nCount, ...@@ -97,7 +97,7 @@ OUString AsciiToNativeChar( const OUString& inStr, sal_Int32 nCount,
return OUString(newStr, SAL_NO_ACQUIRE); // take ownership 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, 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) const Number *number, const sal_Unicode* numberChar)
{ {
...@@ -169,7 +169,7 @@ bool AsciiToNative_numberMaker(const sal_Unicode *str, sal_Int32 begin, sal_Int3 ...@@ -169,7 +169,7 @@ bool AsciiToNative_numberMaker(const sal_Unicode *str, sal_Int32 begin, sal_Int3
} }
/// @throws RuntimeException /// @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 ) Sequence< sal_Int32 >& offset, bool useOffset, const Number* number )
{ {
OUString aRet; OUString aRet;
...@@ -1015,7 +1015,7 @@ static const sal_Unicode thousands_last[] = {0x05d0, 0x05dc, 0x05e4, 0x05d9, 0x0 ...@@ -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 geresh = 0x05f3;
static const sal_Unicode gershayim = 0x05f4; 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); sal_Int16 num = sal::static_int_cast<sal_Int16>(value % 1000);
...@@ -1121,7 +1121,7 @@ struct CyrillicNumberChar { ...@@ -1121,7 +1121,7 @@ struct CyrillicNumberChar {
{ 0x0430, 1 } { 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); sal_Int16 num = sal::static_int_cast<sal_Int16>(value % 1000);
if (value >= 1000) { if (value >= 1000) {
......
...@@ -64,7 +64,7 @@ using namespace ::com::sun::star::i18n; ...@@ -64,7 +64,7 @@ using namespace ::com::sun::star::i18n;
using namespace i18npool; using namespace i18npool;
#define IMPL_CREATEINSTANCE( ImplName ) \ #define IMPL_CREATEINSTANCE( ImplName ) \
uno::Reference< uno::XInterface > \ static uno::Reference< uno::XInterface > \
ImplName##_CreateInstance( \ ImplName##_CreateInstance( \
SAL_UNUSED_PARAMETER const uno::Reference< \ SAL_UNUSED_PARAMETER const uno::Reference< \
lang::XMultiServiceFactory >& ) \ lang::XMultiServiceFactory >& ) \
...@@ -75,7 +75,7 @@ using namespace i18npool; ...@@ -75,7 +75,7 @@ using namespace i18npool;
} }
#define IMPL_CREATEINSTANCE_CTX( ImplName ) \ #define IMPL_CREATEINSTANCE_CTX( ImplName ) \
uno::Reference< uno::XInterface > \ static uno::Reference< uno::XInterface > \
ImplName##_CreateInstance( \ ImplName##_CreateInstance( \
const uno::Reference< \ const uno::Reference< \
lang::XMultiServiceFactory >& rxMSF ) \ lang::XMultiServiceFactory >& rxMSF ) \
......
...@@ -287,7 +287,7 @@ void TextSearch::setOptions( const SearchOptions& rOptions ) ...@@ -287,7 +287,7 @@ void TextSearch::setOptions( const SearchOptions& rOptions )
setOptions2( aOptions2); 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(); sal_Int32 nRet = 0, nEnd = rOff.getLength();
while( nRet < nEnd && nPos > rOff[ nRet ] ) ++nRet; while( nRet < nEnd && nPos > rOff[ nRet ] ) ++nRet;
...@@ -1551,7 +1551,7 @@ TextSearch::getSupportedServiceNames() ...@@ -1551,7 +1551,7 @@ TextSearch::getSupportedServiceNames()
return aRet; return aRet;
} }
css::uno::Reference< css::uno::XInterface > static css::uno::Reference< css::uno::XInterface >
TextSearch_CreateInstance( TextSearch_CreateInstance(
const css::uno::Reference< const css::uno::Reference<
css::lang::XMultiServiceFactory >& rxMSF ) css::lang::XMultiServiceFactory >& rxMSF )
......
...@@ -29,9 +29,9 @@ ...@@ -29,9 +29,9 @@
#include <vector> #include <vector>
void make_hhc_char(FILE *sfp, FILE *cfp); static void make_hhc_char(FILE *sfp, FILE *cfp);
void make_stc_char(FILE *sfp, FILE *cfp); static void make_stc_char(FILE *sfp, FILE *cfp);
void make_stc_word(FILE *sfp, FILE *cfp); static void make_stc_word(FILE *sfp, FILE *cfp);
/* Main Procedure */ /* Main Procedure */
...@@ -328,7 +328,7 @@ typedef struct { ...@@ -328,7 +328,7 @@ typedef struct {
} Index; } Index;
extern "C" { 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); Index const *p1 = static_cast<Index const *>(s1), *p2 = static_cast<Index const *>(s2);
int result = p1->len - p2->len; int result = p1->len - p2->len;
......
...@@ -79,7 +79,7 @@ TextConversion_ko::TextConversion_ko( const Reference < XComponentContext >& xCo ...@@ -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 { typedef struct {
UBlockCode from; UBlockCode from;
......
...@@ -42,7 +42,7 @@ TextConversion_zh::TextConversion_zh( const Reference < XComponentContext >& xCo ...@@ -42,7 +42,7 @@ TextConversion_zh::TextConversion_zh( const Reference < XComponentContext >& xCo
xCDL = ConversionDictionaryList::create(xContext); 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) { if (Data && Index) {
sal_Unicode address = Index[ch>>8]; sal_Unicode address = Index[ch>>8];
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
namespace i18npool { namespace i18npool {
sal_Unicode static sal_Unicode
ignoreKashida_CTL_translator (const sal_Unicode c) ignoreKashida_CTL_translator (const sal_Unicode c)
{ {
if( c == 0x0640 ) // Check if it's Kashida if( c == 0x0640 ) // Check if it's Kashida
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
namespace i18npool { namespace i18npool {
sal_Unicode static sal_Unicode
ignoreMiddleDot_ja_JP_translator (const sal_Unicode c) ignoreMiddleDot_ja_JP_translator (const sal_Unicode c)
{ {
switch (c) { switch (c) {
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
namespace i18npool { namespace i18npool {
sal_Unicode static sal_Unicode
ignoreMinusSign_ja_JP_translator (const sal_Unicode c) ignoreMinusSign_ja_JP_translator (const sal_Unicode c)
{ {
switch (c) { switch (c) {
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
namespace i18npool { namespace i18npool {
sal_Unicode static sal_Unicode
ignoreTraditionalKana_ja_JP_translator (const sal_Unicode c) ignoreTraditionalKana_ja_JP_translator (const sal_Unicode c)
{ {
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
namespace i18npool { namespace i18npool {
sal_Unicode static sal_Unicode
ignoreZiZu_ja_JP_translator (const sal_Unicode c) ignoreZiZu_ja_JP_translator (const sal_Unicode c)
{ {
......
...@@ -170,10 +170,10 @@ TransliterationImpl::getType() ...@@ -170,10 +170,10 @@ TransliterationImpl::getType()
throw ERROR; throw ERROR;
} }
TransliterationModules operator&(TransliterationModules lhs, TransliterationModules rhs) { static TransliterationModules operator&(TransliterationModules lhs, TransliterationModules rhs) {
return TransliterationModules(sal_Int32(lhs) & sal_Int32(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)); return TransliterationModules(sal_Int32(lhs) | sal_Int32(rhs));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment