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()
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) {
......
......@@ -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) {
......
......@@ -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
......
......@@ -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
......
......@@ -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;
......
......@@ -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) {
......
......@@ -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 ) \
......
......@@ -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 )
......
......@@ -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;
......
......@@ -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;
......
......@@ -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];
......
......@@ -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
......
......@@ -21,7 +21,7 @@
namespace i18npool {
sal_Unicode
static sal_Unicode
ignoreMiddleDot_ja_JP_translator (const sal_Unicode c)
{
switch (c) {
......
......@@ -21,7 +21,7 @@
namespace i18npool {
sal_Unicode
static sal_Unicode
ignoreMinusSign_ja_JP_translator (const sal_Unicode c)
{
switch (c) {
......
......@@ -21,7 +21,7 @@
namespace i18npool {
sal_Unicode
static sal_Unicode
ignoreTraditionalKana_ja_JP_translator (const sal_Unicode c)
{
......
......@@ -21,7 +21,7 @@
namespace i18npool {
sal_Unicode
static sal_Unicode
ignoreZiZu_ja_JP_translator (const sal_Unicode c)
{
......
......@@ -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));
}
......
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