mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-08 06:53:45 +00:00
ICU-8595 Compiler warning fixes for UResType
X-SVN-Rev: 30295
This commit is contained in:
parent
2201fb816c
commit
3cf524ee6a
2 changed files with 8 additions and 8 deletions
|
@ -976,7 +976,7 @@ static UResourceBundle *init_resb_result(const ResourceData *rdata, Resource r,
|
|||
} else if(idx != -1) {
|
||||
/* if there is no key, but there is an index, try to get by the index */
|
||||
/* here we have either a table or an array, so get the element */
|
||||
UResType type = RES_GET_TYPE(r);
|
||||
UResType type = (UResType)RES_GET_TYPE(r);
|
||||
if(URES_IS_TABLE(type)) {
|
||||
r = res_getTableItemByIndex(&(mainRes->fResData), r, idx, (const char **)&aKey);
|
||||
} else { /* array */
|
||||
|
@ -1695,7 +1695,7 @@ ures_getByKeyWithFallback(const UResourceBundle *resB,
|
|||
return fillIn;
|
||||
}
|
||||
|
||||
type = RES_GET_TYPE(resB->fRes);
|
||||
type = (UResType)RES_GET_TYPE(resB->fRes);
|
||||
if(URES_IS_TABLE(type)) {
|
||||
int32_t t;
|
||||
res = res_getTableItemByKey(&(resB->fResData), resB->fRes, &t, &key);
|
||||
|
@ -1773,7 +1773,7 @@ U_CAPI UResourceBundle* U_EXPORT2 ures_getByKey(const UResourceBundle *resB, con
|
|||
return fillIn;
|
||||
}
|
||||
|
||||
type = RES_GET_TYPE(resB->fRes);
|
||||
type = (UResType)RES_GET_TYPE(resB->fRes);
|
||||
if(URES_IS_TABLE(type)) {
|
||||
int32_t t;
|
||||
res = res_getTableItemByKey(&(resB->fResData), resB->fRes, &t, &key);
|
||||
|
@ -1827,7 +1827,7 @@ U_CAPI const UChar* U_EXPORT2 ures_getStringByKey(const UResourceBundle *resB, c
|
|||
return NULL;
|
||||
}
|
||||
|
||||
type = RES_GET_TYPE(resB->fRes);
|
||||
type = (UResType)RES_GET_TYPE(resB->fRes);
|
||||
if(URES_IS_TABLE(type)) {
|
||||
int32_t t=0;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
******************************************************************************
|
||||
* *
|
||||
* Copyright (C) 1999-2009, International Business Machines *
|
||||
* Copyright (C) 1999-2011, International Business Machines *
|
||||
* Corporation and others. All Rights Reserved. *
|
||||
* *
|
||||
******************************************************************************
|
||||
|
@ -61,7 +61,7 @@ typedef uint32_t Resource;
|
|||
|
||||
#define RES_BOGUS 0xffffffff
|
||||
|
||||
#define RES_GET_TYPE(res) ((UResType)((res)>>28UL))
|
||||
#define RES_GET_TYPE(res) ((int32_t)((res)>>28UL))
|
||||
#define RES_GET_OFFSET(res) ((res)&0x0fffffff)
|
||||
#define RES_GET_POINTER(pRoot, res) ((pRoot)+RES_GET_OFFSET(res))
|
||||
|
||||
|
@ -69,8 +69,8 @@ typedef uint32_t Resource;
|
|||
#define RES_GET_INT(res) (((int32_t)((res)<<4L))>>4L)
|
||||
#define RES_GET_UINT(res) ((res)&0x0fffffff)
|
||||
|
||||
#define URES_IS_ARRAY(type) ((type)==URES_ARRAY || (type)==URES_ARRAY16)
|
||||
#define URES_IS_TABLE(type) ((type)==URES_TABLE || (type)==URES_TABLE16 || (type)==URES_TABLE32)
|
||||
#define URES_IS_ARRAY(type) ((int32_t)(type)==URES_ARRAY || (int32_t)(type)==URES_ARRAY16)
|
||||
#define URES_IS_TABLE(type) ((int32_t)(type)==URES_TABLE || (int32_t)(type)==URES_TABLE16 || (int32_t)(type)==URES_TABLE32)
|
||||
#define URES_IS_CONTAINER(type) (URES_IS_TABLE(type) || URES_IS_ARRAY(type))
|
||||
|
||||
#define URES_MAKE_RESOURCE(type, offset) (((Resource)(type)<<28)|(Resource)(offset))
|
||||
|
|
Loading…
Add table
Reference in a new issue