ICU-4707 Fix some compiler warnings.

X-SVN-Rev: 19402
This commit is contained in:
George Rhoten 2006-03-22 08:17:49 +00:00
parent aeb583804c
commit 88889fdd3a
4 changed files with 16 additions and 17 deletions

View File

@ -1793,6 +1793,7 @@ parse(UCHARBUF *buf, const char *currentInputDir, UErrorCode *status)
{ {
/* neither colon nor open brace */ /* neither colon nor open brace */
*status=U_PARSE_ERROR; *status=U_PARSE_ERROR;
bundleType=RT_UNKNOWN;
error(line, "parse error, did not find open-brace '{' or colon ':', stopped with %s", u_errorName(*status)); error(line, "parse error, did not find open-brace '{' or colon ':', stopped with %s", u_errorName(*status));
} }
} }

View File

@ -277,7 +277,6 @@ pkg_mak_writeObjRules(UPKGOptions *o, FileStream *makefile, CharList **objects,
CharList *infiles; CharList *infiles;
CharList *parents = NULL, *commands = NULL; 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 */ 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; char *parentPath;
const char *tchar; const char *tchar;
char tree[1024]; char tree[1024];

View File

@ -115,7 +115,7 @@ getDataInfo(const uint8_t *data, int32_t length,
return NULL; return NULL;
} }
if( data==NULL || if( data==NULL ||
(length>=0 && length<sizeof(DataHeader)) (length>=0 && length<(int32_t)sizeof(DataHeader))
) { ) {
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR; *pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
return NULL; return NULL;
@ -123,7 +123,7 @@ getDataInfo(const uint8_t *data, int32_t length,
pHeader=(const DataHeader *)data; pHeader=(const DataHeader *)data;
pInfo=&pHeader->info; pInfo=&pHeader->info;
if( (length>=0 && length<sizeof(DataHeader)) || if( (length>=0 && length<(int32_t)sizeof(DataHeader)) ||
pHeader->dataHeader.magic1!=0xda || pHeader->dataHeader.magic1!=0xda ||
pHeader->dataHeader.magic2!=0x27 || pHeader->dataHeader.magic2!=0x27 ||
pInfo->sizeofUChar!=2 pInfo->sizeofUChar!=2
@ -140,8 +140,8 @@ getDataInfo(const uint8_t *data, int32_t length,
infoLength=readSwapUInt16(pInfo->size); infoLength=readSwapUInt16(pInfo->size);
} }
if( headerLength<sizeof(DataHeader) || if( headerLength<(int32_t)sizeof(DataHeader) ||
infoLength<sizeof(UDataInfo) || infoLength<(int32_t)sizeof(UDataInfo) ||
headerLength<(int32_t)(sizeof(pHeader->dataHeader)+infoLength) || headerLength<(int32_t)(sizeof(pHeader->dataHeader)+infoLength) ||
(length>=0 && length<headerLength) (length>=0 && length<headerLength)
) { ) {
@ -207,9 +207,11 @@ getFileLength(FILE *f) {
/* /*
* Turn tree separators and alternate file separators into normal file separators. * 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 static void
treeToPath(char *s) { treeToPath(char *s) {
#if U_TREE_ENTRY_SEP_CHAR!=U_FILE_SEP_CHAR || U_FILE_ALT_SEP_CHAR!=U_FILE_SEP_CHAR
char *t; char *t;
for(t=s; *t!=0; ++t) { for(t=s; *t!=0; ++t) {
@ -217,15 +219,17 @@ treeToPath(char *s) {
*t=U_FILE_SEP_CHAR; *t=U_FILE_SEP_CHAR;
} }
} }
#endif
} }
#endif
/* /*
* Turn file separators into tree separators. * 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 static void
pathToTree(char *s) { 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; char *t;
for(t=s; *t!=0; ++t) { for(t=s; *t!=0; ++t) {
@ -233,8 +237,8 @@ pathToTree(char *s) {
*t=U_TREE_ENTRY_SEP_CHAR; *t=U_TREE_ENTRY_SEP_CHAR;
} }
} }
#endif
} }
#endif
/* /*
* Prepend the path (if any) to the name and run the name through treeToName(). * Prepend the path (if any) to the name and run the name through treeToName().

View File

@ -1,7 +1,7 @@
/* /*
******************************************************************************* *******************************************************************************
* *
* Copyright (C) 2003-2005, International Business Machines * Copyright (C) 2003-2006, International Business Machines
* Corporation and others. All Rights Reserved. * Corporation and others. All Rights Reserved.
* *
******************************************************************************* *******************************************************************************
@ -55,11 +55,6 @@ U_CDECL_END
typedef void CheckDependency(void *context, const char *itemName, const char *targetName); 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 ------------------------------------------------------ *** // check a dependency ------------------------------------------------------ ***
/* /*
@ -489,7 +484,7 @@ ucnv_enumDependencies(const UDataSwapper *ds,
/* read the initial UConverterStaticData structure after the UDataInfo header */ /* read the initial UConverterStaticData structure after the UDataInfo header */
inStaticData=(const UConverterStaticData *)inBytes; inStaticData=(const UConverterStaticData *)inBytes;
if( length<sizeof(UConverterStaticData) || if( length<(int32_t)sizeof(UConverterStaticData) ||
(uint32_t)length<(staticDataSize=ds->readUInt32(inStaticData->structSize)) (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", 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; 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", udata_printError(ds, "icupkg/ucnv_enumDependencies(): too few bytes (%d after headers) for an ICU MBCS .cnv conversion table\n",
length); length);
*pErrorCode=U_INDEX_OUTOFBOUNDS_ERROR; *pErrorCode=U_INDEX_OUTOFBOUNDS_ERROR;