]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/common/utrie.cpp
ICU-62108.0.1.tar.gz
[apple/icu.git] / icuSources / common / utrie.cpp
index eb97aaa55b1b77b08b3e8222927438406b08e78e..ecf9b1cba72c6d06756b7965d5085f1e9a552eed 100644 (file)
@@ -1,12 +1,14 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
 /*
 ******************************************************************************
 *
 /*
 ******************************************************************************
 *
-*   Copyright (C) 2001-2011, International Business Machines
+*   Copyright (C) 2001-2012, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 ******************************************************************************
 *   file name:  utrie.cpp
 *   Corporation and others.  All Rights Reserved.
 *
 ******************************************************************************
 *   file name:  utrie.cpp
-*   encoding:   US-ASCII
+*   encoding:   UTF-8
 *   tab size:   8 (not used)
 *   indentation:4
 *
 *   tab size:   8 (not used)
 *   indentation:4
 *
@@ -139,7 +141,7 @@ utrie_clone(UNewTrie *fillIn, const UNewTrie *other, uint32_t *aliasData, int32_
         uprv_free(aliasData);
     } else {
         uprv_memcpy(trie->index, other->index, sizeof(trie->index));
         uprv_free(aliasData);
     } else {
         uprv_memcpy(trie->index, other->index, sizeof(trie->index));
-        uprv_memcpy(trie->data, other->data, other->dataLength*4);
+        uprv_memcpy(trie->data, other->data, (size_t)other->dataLength*4);
         trie->dataLength=other->dataLength;
         trie->isDataAllocated=isDataAllocated;
     }
         trie->dataLength=other->dataLength;
         trie->isDataAllocated=isDataAllocated;
     }
@@ -839,7 +841,7 @@ utrie_serialize(UNewTrie *trie, void *dt, int32_t capacity,
         }
 
         /* write 32-bit data values */
         }
 
         /* write 32-bit data values */
-        uprv_memcpy(dest16, trie->data, 4*trie->dataLength);
+        uprv_memcpy(dest16, trie->data, 4*(size_t)trie->dataLength);
     }
 
     return length;
     }
 
     return length;
@@ -943,7 +945,7 @@ utrie_unserializeDummy(UTrie *trie,
     /* calculate the actual size of the dummy trie data */
 
     /* max(Latin-1, block 0) */
     /* calculate the actual size of the dummy trie data */
 
     /* max(Latin-1, block 0) */
-    latin1Length= UTRIE_SHIFT<=8 ? 256 : UTRIE_DATA_BLOCK_LENGTH;
+    latin1Length= 256; /*UTRIE_SHIFT<=8 ? 256 : UTRIE_DATA_BLOCK_LENGTH;*/
 
     trie->indexLength=UTRIE_BMP_INDEX_LENGTH+UTRIE_SURROGATE_BLOCK_COUNT;
     trie->dataLength=latin1Length;
 
     trie->indexLength=UTRIE_BMP_INDEX_LENGTH+UTRIE_SURROGATE_BLOCK_COUNT;
     trie->dataLength=latin1Length;