} 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 */
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);
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);
return NULL;
}
- type = RES_GET_TYPE(resB->fRes);
+ type = (UResType)RES_GET_TYPE(resB->fRes);
if(URES_IS_TABLE(type)) {
int32_t t=0;
/*
******************************************************************************
* *
-* Copyright (C) 1999-2009, International Business Machines *
+* Copyright (C) 1999-2011, International Business Machines *
* Corporation and others. All Rights Reserved. *
* *
******************************************************************************
#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))
#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))