Skip to content

Commit

Permalink
ICU-22966 Fix -Wshadow warnings in unicode/uset.h
Browse files Browse the repository at this point in the history
Fix -Wshadow warnings displayed
when compiling ICU4C 76.1 or later.

Co-authored-by: Xisco Fauli <[email protected]>
  • Loading branch information
th1722 and Xisco Fauli committed Jan 11, 2025
1 parent f8aa68b commit 45f18df
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions icu4c/source/common/unicode/uset.h
Original file line number Diff line number Diff line change
Expand Up @@ -1393,8 +1393,8 @@ class USetCodePointIterator {
private:
friend class USetCodePoints;

USetCodePointIterator(const USet *uset, int32_t rangeIndex, int32_t rangeCount)
: uset(uset), rangeIndex(rangeIndex), rangeCount(rangeCount),
USetCodePointIterator(const USet *pUset, int32_t nRangeIndex, int32_t nRangeCount)
: uset(pUset), rangeIndex(nRangeIndex), rangeCount(nRangeCount),
c(U_SENTINEL), end(U_SENTINEL) {
// Fetch the first range.
operator++();
Expand Down Expand Up @@ -1430,7 +1430,7 @@ class USetCodePoints {
* Constructs a C++ "range" object over the code points of the USet.
* @draft ICU 76
*/
USetCodePoints(const USet *uset) : uset(uset), rangeCount(uset_getRangeCount(uset)) {}
USetCodePoints(const USet *pUset) : uset(pUset), rangeCount(uset_getRangeCount(pUset)) {}

/** @draft ICU 76 */
USetCodePoints(const USetCodePoints &other) = default;
Expand Down Expand Up @@ -1461,7 +1461,7 @@ struct CodePointRange {
/** @draft ICU 76 */
struct iterator {
/** @draft ICU 76 */
iterator(UChar32 c) : c(c) {}
iterator(UChar32 aC) : c(aC) {}

/** @draft ICU 76 */
bool operator==(const iterator &other) const { return c == other.c; }
Expand Down Expand Up @@ -1574,8 +1574,8 @@ class USetRangeIterator {
private:
friend class USetRanges;

USetRangeIterator(const USet *uset, int32_t rangeIndex, int32_t rangeCount)
: uset(uset), rangeIndex(rangeIndex), rangeCount(rangeCount) {}
USetRangeIterator(const USet *pUset, int32_t nRangeIndex, int32_t nRangeCount)
: uset(pUset), rangeIndex(nRangeIndex), rangeCount(nRangeCount) {}

const USet *uset;
int32_t rangeIndex;
Expand Down Expand Up @@ -1611,7 +1611,7 @@ class USetRanges {
* Constructs a C++ "range" object over the code point ranges of the USet.
* @draft ICU 76
*/
USetRanges(const USet *uset) : uset(uset), rangeCount(uset_getRangeCount(uset)) {}
USetRanges(const USet *pUset) : uset(pUset), rangeCount(uset_getRangeCount(pUset)) {}

/** @draft ICU 76 */
USetRanges(const USetRanges &other) = default;
Expand Down Expand Up @@ -1685,8 +1685,8 @@ class USetStringIterator {
private:
friend class USetStrings;

USetStringIterator(const USet *uset, int32_t index, int32_t count)
: uset(uset), index(index), count(count) {}
USetStringIterator(const USet *pUset, int32_t nIndex, int32_t nCount)
: uset(pUset), index(nIndex), count(nCount) {}

const USet *uset;
int32_t index;
Expand Down Expand Up @@ -1719,7 +1719,7 @@ class USetStrings {
* Constructs a C++ "range" object over the strings of the USet.
* @draft ICU 76
*/
USetStrings(const USet *uset) : uset(uset), count(uset_getStringCount(uset)) {}
USetStrings(const USet *pUset) : uset(pUset), count(uset_getStringCount(pUset)) {}

/** @draft ICU 76 */
USetStrings(const USetStrings &other) = default;
Expand Down Expand Up @@ -1816,8 +1816,8 @@ class USetElementIterator {
private:
friend class USetElements;

USetElementIterator(const USet *uset, int32_t index, int32_t rangeCount, int32_t totalCount)
: uset(uset), index(index), rangeCount(rangeCount), totalCount(totalCount),
USetElementIterator(const USet *pUset, int32_t nIndex, int32_t nRangeCount, int32_t nTotalCount)
: uset(pUset), index(nIndex), rangeCount(nRangeCount), totalCount(nTotalCount),
c(U_SENTINEL), end(U_SENTINEL) {
if (index < rangeCount) {
// Fetch the first range.
Expand Down Expand Up @@ -1874,9 +1874,9 @@ class USetElements {
* Constructs a C++ "range" object over all of the elements of the USet.
* @draft ICU 77
*/
USetElements(const USet *uset)
: uset(uset), rangeCount(uset_getRangeCount(uset)),
stringCount(uset_getStringCount(uset)) {}
USetElements(const USet *pUset)
: uset(pUset), rangeCount(uset_getRangeCount(pUset)),
stringCount(uset_getStringCount(pUset)) {}

/** @draft ICU 77 */
USetElements(const USetElements &other) = default;
Expand Down

0 comments on commit 45f18df

Please sign in to comment.