]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/common/ucol_swp.cpp
ICU-57165.0.1.tar.gz
[apple/icu.git] / icuSources / common / ucol_swp.cpp
index 13e467364c44c85c21c5f6186e9fb62d363b1453..759743528c0914e9e17c74751dee53f5867ddadc 100644 (file)
@@ -1,7 +1,7 @@
 /*
 *******************************************************************************
 *
-*   Copyright (C) 2003-2014, International Business Machines
+*   Copyright (C) 2003-2015, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 *******************************************************************************
@@ -307,7 +307,6 @@ swapFormatVersion3(const UDataSwapper *ds,
              * if UCAConsts!=0 then contractionUCACombos because we are swapping
              * the UCA data file, and we know that the UCA contains contractions
              */
-            count=header.contractionUCACombos-header.UCAConsts;
             ds->swapArray32(ds, inBytes+header.UCAConsts, header.contractionUCACombos-header.UCAConsts,
                                outBytes+header.UCAConsts, pErrorCode);
         }
@@ -341,7 +340,7 @@ swapFormatVersion3(const UDataSwapper *ds,
     return header.size;
 }
 
-// swap formatVersion 4 ---------------------------------------------------- ***
+// swap formatVersion 4 or 5 ----------------------------------------------- ***
 
 // The following are copied from CollationDataReader, trading an awkward copy of constants
 // for an awkward relocation of the i18n collationdatareader.h file into the common library.
@@ -567,7 +566,7 @@ ucol_swap(const UDataSwapper *ds,
         info.dataFormat[1]==0x43 &&
         info.dataFormat[2]==0x6f &&
         info.dataFormat[3]==0x6c &&
-        (info.formatVersion[0]==3 || info.formatVersion[0]==4)
+        (3<=info.formatVersion[0] && info.formatVersion[0]<=5)
     )) {
         udata_printError(ds, "ucol_swap(): data format %02x.%02x.%02x.%02x "
                          "(format version %02x.%02x) is not recognized as collation data\n",