fix code quality problem

Signed-off-by: sunyaozu <sunyaozu@huawei.com>
This commit is contained in:
sunyaozu
2022-03-16 20:36:06 +08:00
parent 24a0c5f852
commit 1eadbd2a48
41 changed files with 13 additions and 23 deletions
Executable → Regular
View File
-1
View File
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (c) 2021 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Executable → Regular
View File
Executable → Regular
View File
Executable → Regular
View File
Executable → Regular
View File
View File
View File
View File
+1 -1
View File
@@ -99,7 +99,7 @@ private:
};
enum EPercentLocation {
UNKOWN = 0,
UNKNOWN = 0,
LEFT = 1,
RIGHT = 2
};
View File
View File
View File
View File
View File
View File
+1 -1
View File
@@ -24,7 +24,7 @@ using namespace std;
/**
* construct a DateTimeFormat object with request pattern and locale.
* now we only support patterns defined in AvailableDateTimeFormatPatterns.
* locale, locale information to retrive datetime resource form icu data.
* locale, locale information to retrieve datetime resource form icu data.
*/
DateTimeFormat::DateTimeFormat(AvailableDateTimeFormatPattern requestPattern, const LocaleInfo &locale)
{
+1 -1
View File
@@ -24,7 +24,7 @@ using namespace std;
/**
* construct a DateTimeFormat object with request pattern and locale.
* now we only support patterns defined in AvailableDateTimeFormatPatterns.
* locale, locale information to retrive datetime resource form icu data.
* locale, locale information to retrieve datetime resource form icu data.
*/
DateTimeFormatImpl::DateTimeFormatImpl(AvailableDateTimeFormatPattern requestPattern, const LocaleInfo &locale)
{
View File
View File
View File
+3 -3
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -288,9 +288,9 @@ void NumberFormatImpl::AddGroup(char *targetAndSource[], const int len[], const
return;
}
char *target = targetAndSource[0]; // use array to store target and source string, first is target string
int targetLen = len[0]; // use array to store target length and source length, first is target legnth
int targetLen = len[0]; // use array to store target length and source length, first is target length
char *source = targetAndSource[1]; // use array to store target and source string, second is source string
int sourceLen = len[1]; // use array to store target length and source length, second is source legnth
int sourceLen = len[1]; // use array to store target length and source length, second is source length
int isTwoGroup = len[2]; // 2 is the index of group info
int intLen = sourceLen - decLen;
int addIndex = 0;
View File
+1 -9
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -178,8 +178,6 @@ bool PluralFormatImpl::ParseDecimalRule(const std::string &rule, const int ruleS
// the final result should be true.
} else if (nextSymbolIndex >= ruleSize) {
return true;
} else {
// do nothing
}
} else {
// If next symbol is or and current result or temp result is false, skip to next formula.
@@ -194,8 +192,6 @@ bool PluralFormatImpl::ParseDecimalRule(const std::string &rule, const int ruleS
} else if ((nextSymbolIndex >= ruleSize) &&
!ParseDecimalFormula(rule, ruleSize, i, numberInfo, numberInfoSize)) {
tempResult = false;
} else {
// do nothing
}
}
}
@@ -264,8 +260,6 @@ bool PluralFormatImpl::ParseRule(const std::string &rule, const int ruleSize, co
// the final result should be true.
} else if (nextSymbolIndex >= ruleSize) {
return true;
} else {
// do nothing
}
} else {
// If next symbol is or and current result or temp result is false, skip to next formula.
@@ -279,8 +273,6 @@ bool PluralFormatImpl::ParseRule(const std::string &rule, const int ruleSize, co
tempResult = false;
} else if ((nextSymbolIndex >= ruleSize) && !ParseFormula(rule, ruleSize, i, number)) {
tempResult = false;
} else {
// do nothing
}
}
}
View File
Executable → Regular
View File
Executable → Regular
View File
View File
View File
+1 -1
View File
@@ -161,7 +161,7 @@ public:
* and <b>ab:cd</b> indicates <b>hour:minute</b>.
* @param appendTo Used to save the formatting result.
* @param status Indicates the formatting status.
* @return Returns 1 or -1 if am/pm markers should be put at the begining or end of the returned string when we call
* @return Returns 1 or -1 if am/pm markers should be put at the beginning or end of the returned string when we call
* format with HOUR12_MINUTE_SECOND, returns 0 if no am/pm markers should be added.
*/
int8_t Get12HourTimeWithoutAmpm(const time_t &cal, const std::string &zoneInfo,
View File
View File
View File
View File
+4 -4
View File
@@ -36,9 +36,9 @@ public:
virtual ~WeekInfo() = default;
/**
* @brief Get the index of the begining day of a week.
* @brief Get the index of the beginning day of a week.
*
* @return Returns the index of the begining day of a week, 1 stands for Sunday and 7 stands for Saturday
* @return Returns the index of the beginning day of a week, 1 stands for Sunday and 7 stands for Saturday
*/
uint8_t GetFirstDayOfWeek();
@@ -50,9 +50,9 @@ public:
uint8_t GetMinimalDaysInFirstWeek();
/**
* @brief Get the index of the begining day of weekend.
* @brief Get the index of the beginning day of weekend.
*
* @return Returns the index of the begining day of weekend, 1 stands for Sunday and 7 stands for Saturday
* @return Returns the index of the beginning day of weekend, 1 stands for Sunday and 7 stands for Saturday
*/
uint8_t GetFirstDayOfWeekend();
View File
View File
View File
View File
-1
View File
@@ -22,7 +22,6 @@
<version>1.0</version>
<name>lite-data-tool</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>
<properties>
@@ -136,7 +136,7 @@ public class DataFetcher {
* If a locale's data equals to its fallback's data, this locale is excluded
* if a meta data of a locale equals to its fallback's data, this meta data is excluded
* validLocales keep track of how many locales will be available in dat file.
* count indicates how many metaData in total will be availabe in dat file.
* count indicates how many metaData in total will be available in dat file.
*
* @return Total number of meta data count
*/