/*
******************************************************************************
*
-* Copyright (C) 1998-2011, International Business Machines
+* Copyright (C) 1998-2014, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
U_CAPI UChar * U_EXPORT2
u_memcpy(UChar *dest, const UChar *src, int32_t count) {
- return (UChar *)uprv_memcpy(dest, src, count*U_SIZEOF_UCHAR);
+ if(count > 0) {
+ uprv_memcpy(dest, src, count*U_SIZEOF_UCHAR);
+ }
+ return dest;
}
U_CAPI UChar * U_EXPORT2
u_memmove(UChar *dest, const UChar *src, int32_t count) {
- return (UChar *)uprv_memmove(dest, src, count*U_SIZEOF_UCHAR);
+ if(count > 0) {
+ uprv_memmove(dest, src, count*U_SIZEOF_UCHAR);
+ }
+ return dest;
}
U_CAPI UChar * U_EXPORT2
*/
#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); \
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