ICU-11001 STRING_HASH changed to use uint32_t in computation.

X-SVN-Rev: 36016
This commit is contained in:
Andy Heninger 2014-07-09 22:02:52 +00:00
parent 38b83477bf
commit 47a28993e7

View file

@ -1,7 +1,7 @@
/*
******************************************************************************
*
* Copyright (C) 1998-2012, International Business Machines
* Copyright (C) 1998-2014, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
@ -1486,7 +1486,7 @@ u_terminateWChars(wchar_t *dest, int32_t destCapacity, int32_t length, UErrorCod
*/
#define STRING_HASH(TYPE, STR, STRLEN, DEREF) \
int32_t hash = 0; \
uint32_t hash = 0; \
const TYPE *p = (const TYPE*) STR; \
if (p != NULL) { \
int32_t len = (int32_t)(STRLEN); \
@ -1497,7 +1497,7 @@ u_terminateWChars(wchar_t *dest, int32_t destCapacity, int32_t length, UErrorCod
p += inc; \
} \
} \
return hash
return static_cast<int32_t>(hash)
/* Used by UnicodeString to compute its hashcode - Not public API. */
U_CAPI int32_t U_EXPORT2