From 589ceba9768adeb0646443e605cc1e98a953cd64 Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Wed, 5 Sep 2001 18:44:27 +0000 Subject: [PATCH] ICU-1100 Don't fail on ures_getIntVector and ures_getBinary any more. X-SVN-Rev: 5687 --- icu4c/source/common/uresbund.c | 14 ++------------ icu4c/source/test/cintltst/creststn.c | 4 ++-- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/icu4c/source/common/uresbund.c b/icu4c/source/common/uresbund.c index c83fbb89b0a..d4269df8dd5 100644 --- a/icu4c/source/common/uresbund.c +++ b/icu4c/source/common/uresbund.c @@ -546,7 +546,6 @@ U_CAPI const UChar* U_EXPORT2 ures_getString(const UResourceBundle* resB, int32_ U_CAPI const uint8_t* U_EXPORT2 ures_getBinary(const UResourceBundle* resB, int32_t* len, UErrorCode* status) { - const uint8_t *p; if (status==NULL || U_FAILURE(*status)) { return NULL; } @@ -556,11 +555,7 @@ U_CAPI const uint8_t* U_EXPORT2 ures_getBinary(const UResourceBundle* resB, int3 } switch(RES_GET_TYPE(resB->fRes)) { case RES_BINARY: - p = res_getBinary(&(resB->fResData), resB->fRes, len); - if (*len == 0) { - *status = U_MISSING_RESOURCE_ERROR; - } - return p; + return res_getBinary(&(resB->fResData), resB->fRes, len); case RES_INT: case RES_STRING: case RES_INT_VECTOR: @@ -575,7 +570,6 @@ U_CAPI const uint8_t* U_EXPORT2 ures_getBinary(const UResourceBundle* resB, int3 U_CAPI const int32_t* U_EXPORT2 ures_getIntVector(const UResourceBundle* resB, int32_t* len, UErrorCode* status) { - const int32_t *p; if (status==NULL || U_FAILURE(*status)) { return NULL; } @@ -585,11 +579,7 @@ U_CAPI const int32_t* U_EXPORT2 ures_getIntVector(const UResourceBundle* resB, i } switch(RES_GET_TYPE(resB->fRes)) { case RES_INT_VECTOR: - p = res_getIntVector(&(resB->fResData), resB->fRes, len); - if (*len == 0) { - *status = U_MISSING_RESOURCE_ERROR; - } - return p; + return res_getIntVector(&(resB->fResData), resB->fRes, len); case RES_INT: case RES_STRING: case RES_ARRAY: diff --git a/icu4c/source/test/cintltst/creststn.c b/icu4c/source/test/cintltst/creststn.c index 54b1e2011cb..71ce9f2ef4f 100644 --- a/icu4c/source/test/cintltst/creststn.c +++ b/icu4c/source/test/cintltst/creststn.c @@ -411,7 +411,7 @@ static void TestEmptyTypes() { } else { zeroIntVect=ures_getIntVector(res, &len, &status); - if(U_SUCCESS(status) || resArray != NULL || len != 0) { + if(!U_SUCCESS(status) || resArray != NULL || len != 0) { log_err("Shouldn't get emptyintv\n"); } } @@ -427,7 +427,7 @@ static void TestEmptyTypes() { } else { binResult=ures_getBinary(res, &len, &status); - if(U_SUCCESS(status) || binResult != NULL || len != 0) { + if(!U_SUCCESS(status) || binResult != NULL || len != 0) { log_err("Shouldn't get emptybin\n"); } }