ICU-4707 Fix some compiler warnings.
X-SVN-Rev: 19402
This commit is contained in:
parent
aeb583804c
commit
88889fdd3a
@ -1793,6 +1793,7 @@ parse(UCHARBUF *buf, const char *currentInputDir, UErrorCode *status)
|
||||
{
|
||||
/* neither colon nor open brace */
|
||||
*status=U_PARSE_ERROR;
|
||||
bundleType=RT_UNKNOWN;
|
||||
error(line, "parse error, did not find open-brace '{' or colon ':', stopped with %s", u_errorName(*status));
|
||||
}
|
||||
}
|
||||
|
@ -277,7 +277,6 @@ pkg_mak_writeObjRules(UPKGOptions *o, FileStream *makefile, CharList **objects,
|
||||
CharList *infiles;
|
||||
CharList *parents = NULL, *commands = NULL;
|
||||
int32_t genFileOffset = 0; /* offset from beginning of .c and .o file name, use to chop off package name for AS/400 */
|
||||
char serName[100];
|
||||
char *parentPath;
|
||||
const char *tchar;
|
||||
char tree[1024];
|
||||
|
@ -115,7 +115,7 @@ getDataInfo(const uint8_t *data, int32_t length,
|
||||
return NULL;
|
||||
}
|
||||
if( data==NULL ||
|
||||
(length>=0 && length<sizeof(DataHeader))
|
||||
(length>=0 && length<(int32_t)sizeof(DataHeader))
|
||||
) {
|
||||
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return NULL;
|
||||
@ -123,7 +123,7 @@ getDataInfo(const uint8_t *data, int32_t length,
|
||||
|
||||
pHeader=(const DataHeader *)data;
|
||||
pInfo=&pHeader->info;
|
||||
if( (length>=0 && length<sizeof(DataHeader)) ||
|
||||
if( (length>=0 && length<(int32_t)sizeof(DataHeader)) ||
|
||||
pHeader->dataHeader.magic1!=0xda ||
|
||||
pHeader->dataHeader.magic2!=0x27 ||
|
||||
pInfo->sizeofUChar!=2
|
||||
@ -140,8 +140,8 @@ getDataInfo(const uint8_t *data, int32_t length,
|
||||
infoLength=readSwapUInt16(pInfo->size);
|
||||
}
|
||||
|
||||
if( headerLength<sizeof(DataHeader) ||
|
||||
infoLength<sizeof(UDataInfo) ||
|
||||
if( headerLength<(int32_t)sizeof(DataHeader) ||
|
||||
infoLength<(int32_t)sizeof(UDataInfo) ||
|
||||
headerLength<(int32_t)(sizeof(pHeader->dataHeader)+infoLength) ||
|
||||
(length>=0 && length<headerLength)
|
||||
) {
|
||||
@ -207,9 +207,11 @@ getFileLength(FILE *f) {
|
||||
/*
|
||||
* Turn tree separators and alternate file separators into normal file separators.
|
||||
*/
|
||||
#if U_TREE_ENTRY_SEP_CHAR==U_FILE_SEP_CHAR && U_FILE_ALT_SEP_CHAR==U_FILE_SEP_CHAR
|
||||
#define treeToPath(s)
|
||||
#else
|
||||
static void
|
||||
treeToPath(char *s) {
|
||||
#if U_TREE_ENTRY_SEP_CHAR!=U_FILE_SEP_CHAR || U_FILE_ALT_SEP_CHAR!=U_FILE_SEP_CHAR
|
||||
char *t;
|
||||
|
||||
for(t=s; *t!=0; ++t) {
|
||||
@ -217,15 +219,17 @@ treeToPath(char *s) {
|
||||
*t=U_FILE_SEP_CHAR;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Turn file separators into tree separators.
|
||||
*/
|
||||
#if U_TREE_ENTRY_SEP_CHAR==U_FILE_SEP_CHAR && U_FILE_ALT_SEP_CHAR==U_FILE_SEP_CHAR
|
||||
#define pathToTree(s)
|
||||
#else
|
||||
static void
|
||||
pathToTree(char *s) {
|
||||
#if U_FILE_SEP_CHAR!=U_TREE_ENTRY_SEP_CHAR || U_FILE_ALT_SEP_CHAR!=U_TREE_ENTRY_SEP_CHAR
|
||||
char *t;
|
||||
|
||||
for(t=s; *t!=0; ++t) {
|
||||
@ -233,8 +237,8 @@ pathToTree(char *s) {
|
||||
*t=U_TREE_ENTRY_SEP_CHAR;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Prepend the path (if any) to the name and run the name through treeToName().
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
*******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2003-2005, International Business Machines
|
||||
* Copyright (C) 2003-2006, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
*******************************************************************************
|
||||
@ -55,11 +55,6 @@ U_CDECL_END
|
||||
|
||||
typedef void CheckDependency(void *context, const char *itemName, const char *targetName);
|
||||
|
||||
static uint16_t
|
||||
readSwapUInt16(uint16_t x) {
|
||||
return (uint16_t)((x<<8)|(x>>8));
|
||||
}
|
||||
|
||||
// check a dependency ------------------------------------------------------ ***
|
||||
|
||||
/*
|
||||
@ -489,7 +484,7 @@ ucnv_enumDependencies(const UDataSwapper *ds,
|
||||
/* read the initial UConverterStaticData structure after the UDataInfo header */
|
||||
inStaticData=(const UConverterStaticData *)inBytes;
|
||||
|
||||
if( length<sizeof(UConverterStaticData) ||
|
||||
if( length<(int32_t)sizeof(UConverterStaticData) ||
|
||||
(uint32_t)length<(staticDataSize=ds->readUInt32(inStaticData->structSize))
|
||||
) {
|
||||
udata_printError(ds, "icupkg/ucnv_enumDependencies(): too few bytes (%d after header) for an ICU .cnv conversion table\n",
|
||||
@ -509,7 +504,7 @@ ucnv_enumDependencies(const UDataSwapper *ds,
|
||||
|
||||
inMBCSHeader=(const _MBCSHeader *)inBytes;
|
||||
|
||||
if(length<sizeof(_MBCSHeader)) {
|
||||
if(length<(int32_t)sizeof(_MBCSHeader)) {
|
||||
udata_printError(ds, "icupkg/ucnv_enumDependencies(): too few bytes (%d after headers) for an ICU MBCS .cnv conversion table\n",
|
||||
length);
|
||||
*pErrorCode=U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
|
Loading…
Reference in New Issue
Block a user