ICU-10070 uregion_isEqualTo -> uregion_areEqual, implement using pointer compare

X-SVN-Rev: 33578
This commit is contained in:
Peter Edberg 2013-05-02 22:04:50 +00:00
parent c55b3819a6
commit a8a20d2b84
3 changed files with 9 additions and 9 deletions

View File

@ -127,7 +127,7 @@ typedef struct URegion URegion;
/**
* Returns a pointer to a URegion for the specified region code: A 2-letter or 3-letter ISO 3166
* code, UNM.49 numeric code (superset of ISO 3166 numeric codes), or other valid Unicode Region
* code, UN M.49 numeric code (superset of ISO 3166 numeric codes), or other valid Unicode Region
* Code as defined by the LDML specification. The code will be canonicalized internally. If the
* region code is NULL or not recognized, the appropriate error code will be set
* (U_ILLEGAL_ARGUMENT_ERROR).
@ -157,7 +157,7 @@ uregion_getAvailable(URegionType type, UErrorCode *status);
* @draft ICU 52
*/
U_DRAFT UBool U_EXPORT2
uregion_isEqualTo(const URegion* uregion, const URegion* otherRegion);
uregion_areEqual(const URegion* uregion, const URegion* otherRegion);
/**
* Returns a pointer to the URegion that contains the specified uregion. Returns NULL if the

View File

@ -38,9 +38,9 @@ uregion_getAvailable(URegionType type, UErrorCode *status)
U_CAPI UBool U_EXPORT2
uregion_isEqualTo(const URegion* uregion, const URegion* otherRegion)
uregion_areEqual(const URegion* uregion, const URegion* otherRegion)
{
return ( (Region*)uregion == (Region*)otherRegion );
return ( (void*)uregion == (void*)otherRegion );
}

View File

@ -369,7 +369,7 @@ static void TestKnownRegions() {
}
if ( e > 0 ) {
const URegion *ncRegion = uregion_getRegionFromNumericCode(e, &status);
if ( !uregion_isEqualTo(ncRegion, r) && e != 891 ) { // 891 is special case - CS and YU both deprecated codes for region 891
if ( !uregion_areEqual(ncRegion, r) && e != 891 ) { // 891 is special case - CS and YU both deprecated codes for region 891
log_err("ERROR: Creating region %s by its numeric code returned a different region. Got: %s instead.\n",
uregion_getRegionCode(r), uregion_getRegionCode(ncRegion) );
}
@ -396,7 +396,7 @@ static void TestGetContainedRegions() {
while ((crID = uenum_next(containedRegions, NULL, &status)) != NULL && U_SUCCESS(status) ) {
const URegion *cr = uregion_getRegionFromCode(crID, &status);
const URegion *containingRegion = (cr)? uregion_getContainingRegion(cr) : NULL;
if ( !containingRegion || !uregion_isEqualTo(containingRegion, r) ) {
if ( !containingRegion || !uregion_areEqual(containingRegion, r) ) {
log_err("ERROR: Region: %s contains region %s. Expected containing region of this region to be the original region, but got %s\n",
uregion_getRegionCode(r), uregion_getRegionCode(cr), (containingRegion)?uregion_getRegionCode(containingRegion):"NULL" );
}
@ -425,7 +425,7 @@ static void TestGetContainedRegionsWithType() {
while ((crID = uenum_next(containedRegions, NULL, &status)) != NULL && U_SUCCESS(status) ) {
const URegion *cr = uregion_getRegionFromCode(crID, &status);
const URegion *containingRegion = (cr)? uregion_getContainingRegionOfType(cr, URGN_CONTINENT) : NULL;
if ( !containingRegion || !uregion_isEqualTo(containingRegion, r) ) {
if ( !containingRegion || !uregion_areEqual(containingRegion, r) ) {
log_err("ERROR: Continent: %s contains territory %s. Expected containing continent of this region to be the original region, but got %s\n",
uregion_getRegionCode(r), uregion_getRegionCode(cr), (containingRegion)?uregion_getRegionCode(containingRegion):"NULL" );
}
@ -451,7 +451,7 @@ static void TestGetContainingRegion() {
}
} else {
const URegion *p = uregion_getRegionFromCode(rd->parent, &status);
if ( c == NULL || !uregion_isEqualTo(p, c) ) {
if ( c == NULL || !uregion_areEqual(p, c) ) {
log_err("ERROR: Expected containing continent of region %s to be %s. Got: %s\n",
uregion_getRegionCode(r), (p)?uregion_getRegionCode(p):"NULL", (c)?uregion_getRegionCode(c):"NULL" );
}
@ -475,7 +475,7 @@ static void TestGetContainingRegionWithType() {
}
} else {
const URegion *p = uregion_getRegionFromCode(rd->containingContinent, &status);
if ( !uregion_isEqualTo(p, c) ) {
if ( !uregion_areEqual(p, c) ) {
log_err("ERROR: Expected containing continent of region %s to be %s. Got: %s\n",
uregion_getRegionCode(r), (p)?uregion_getRegionCode(p):"NULL", (c)?uregion_getRegionCode(c):"NULL" );
}