]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/tools/toolutil/pkgitems.cpp
ICU-57132.0.1.tar.gz
[apple/icu.git] / icuSources / tools / toolutil / pkgitems.cpp
index ba5e827df327bed62b37ab9e0a6e084003e89ddf..8a20981f5da98db3c8869521f094ecd61cabc1d3 100644 (file)
@@ -1,7 +1,7 @@
 /*
 *******************************************************************************
 *
 /*
 *******************************************************************************
 *
-*   Copyright (C) 2003-2010, International Business Machines
+*   Copyright (C) 2003-2015, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 *******************************************************************************
 *   Corporation and others.  All Rights Reserved.
 *
 *******************************************************************************
@@ -43,8 +43,6 @@
 
 // general definitions ----------------------------------------------------- ***
 
 
 // general definitions ----------------------------------------------------- ***
 
-#define LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
-
 U_CDECL_BEGIN
 
 static void U_CALLCONV
 U_CDECL_BEGIN
 
 static void U_CALLCONV
@@ -390,7 +388,7 @@ ures_enumDependencies(const char *itemName, const UDataInfo *pInfo,
         }
     }
 
         }
     }
 
-    U_NAMESPACE_QUALIFIER NativeItem nativePool;
+    icu::NativeItem nativePool;
 
     if(resData.usesPoolBundle) {
         char poolName[200];
 
     if(resData.usesPoolBundle) {
         char poolName[200];
@@ -412,7 +410,8 @@ ures_enumDependencies(const char *itemName, const UDataInfo *pInfo,
             fprintf(stderr, "icupkg: %s is not a pool bundle\n", poolName);
             return;
         }
             fprintf(stderr, "icupkg: %s is not a pool bundle\n", poolName);
             return;
         }
-        const int32_t *poolIndexes=(const int32_t *)nativePool.getBytes()+1;
+        const int32_t *poolRoot=(const int32_t *)nativePool.getBytes();
+        const int32_t *poolIndexes=poolRoot+1;
         int32_t poolIndexLength=poolIndexes[URES_INDEX_LENGTH]&0xff;
         if(!(poolIndexLength>URES_INDEX_POOL_CHECKSUM &&
              (poolIndexes[URES_INDEX_ATTRIBUTES]&URES_ATT_IS_POOL_BUNDLE))
         int32_t poolIndexLength=poolIndexes[URES_INDEX_LENGTH]&0xff;
         if(!(poolIndexLength>URES_INDEX_POOL_CHECKSUM &&
              (poolIndexes[URES_INDEX_ATTRIBUTES]&URES_ATT_IS_POOL_BUNDLE))
@@ -422,6 +421,7 @@ ures_enumDependencies(const char *itemName, const UDataInfo *pInfo,
         }
         if(resData.pRoot[1+URES_INDEX_POOL_CHECKSUM]==poolIndexes[URES_INDEX_POOL_CHECKSUM]) {
             resData.poolBundleKeys=(const char *)(poolIndexes+poolIndexLength);
         }
         if(resData.pRoot[1+URES_INDEX_POOL_CHECKSUM]==poolIndexes[URES_INDEX_POOL_CHECKSUM]) {
             resData.poolBundleKeys=(const char *)(poolIndexes+poolIndexLength);
+            resData.poolBundleStrings=(const uint16_t *)(poolRoot+poolIndexes[URES_INDEX_KEYS_TOP]);
         } else {
             fprintf(stderr, "icupkg: %s has mismatched checksum for %s\n", poolName, itemName);
             return;
         } else {
             fprintf(stderr, "icupkg: %s has mismatched checksum for %s\n", poolName, itemName);
             return;