Bug 1307958 - -Werror=sign-compare under ./intl directory draft
authorISHIKAWA, Chiaki <ishikawa@yk.rim.or.jp>
Sat, 09 Nov 2019 11:00:05 +0900
changeset 81069 c0526a9cca00673125f3ba7bea4966aa3b423232
parent 81068 d049d4d11ddc23b590f2d55fada3e70a3afa87d7
child 81070 65df23be2f60eb1aac1359891d7a690b060532e9
push id9744
push userishikawa@yk.rim.or.jp
push dateSat, 09 Nov 2019 02:01:06 +0000
treeherdertry-comm-central@56c83244ac0e [default view] [failures only]
bugs1307958
Bug 1307958 - -Werror=sign-compare under ./intl directory
mozilla-M-C-007-intl-icu-sign-compare-rev02.patch
new file mode 100644
--- /dev/null
+++ b/mozilla-M-C-007-intl-icu-sign-compare-rev02.patch
@@ -0,0 +1,87 @@
+# HG changeset patch
+# User ISHIKAWA, Chiaki <ishikawa@yk.rim.or.jp>
+# Parent  4d16694751b15db310e4771651d60361cfd76112
+Bug 1307958 - -Werror=sign-compare under ./intl directory
+
+diff --git a/intl/icu/source/common/uhash.cpp b/intl/icu/source/common/uhash.cpp
+--- a/intl/icu/source/common/uhash.cpp
++++ b/intl/icu/source/common/uhash.cpp
+@@ -211,17 +211,17 @@ static void
+                 int32_t primeIndex,
+                 UErrorCode *status) {
+ 
+     UHashElement *p, *limit;
+     UHashTok emptytok;
+ 
+     if (U_FAILURE(*status)) return;
+ 
+-    U_ASSERT(primeIndex >= 0 && primeIndex < PRIMES_LENGTH);
++    U_ASSERT(primeIndex >= 0 && primeIndex < (int) PRIMES_LENGTH);
+ 
+     hash->primeIndex = static_cast<int8_t>(primeIndex);
+     hash->length = PRIMES[primeIndex];
+ 
+     p = hash->elements = (UHashElement*)
+         uprv_malloc(sizeof(UHashElement) * hash->length);
+ 
+     if (hash->elements == NULL) {
+@@ -395,17 +395,17 @@ static void
+ _uhash_rehash(UHashtable *hash, UErrorCode *status) {
+ 
+     UHashElement *old = hash->elements;
+     int32_t oldLength = hash->length;
+     int32_t newPrimeIndex = hash->primeIndex;
+     int32_t i;
+ 
+     if (hash->count > hash->highWaterMark) {
+-        if (++newPrimeIndex >= PRIMES_LENGTH) {
++            if (++newPrimeIndex >= (int) PRIMES_LENGTH) {
+             return;
+         }
+     } else if (hash->count < hash->lowWaterMark) {
+         if (--newPrimeIndex < 0) {
+             return;
+         }
+     } else {
+         return;
+@@ -548,17 +548,17 @@ U_CAPI UHashtable* U_EXPORT2
+ uhash_openSize(UHashFunction *keyHash,
+                UKeyComparator *keyComp,
+                UValueComparator *valueComp,
+                int32_t size,
+                UErrorCode *status) {
+ 
+     /* Find the smallest index i for which PRIMES[i] >= size. */
+     int32_t i = 0;
+-    while (i<(PRIMES_LENGTH-1) && PRIMES[i]<size) {
++    while (i < (int) (PRIMES_LENGTH-1) && PRIMES[i]<size) {
+         ++i;
+     }
+ 
+     return _uhash_create(keyHash, keyComp, valueComp, i, status);
+ }
+ 
+ U_CAPI UHashtable* U_EXPORT2
+ uhash_init(UHashtable *fillinResult,
+diff --git a/intl/icu/source/common/utrace.cpp b/intl/icu/source/common/utrace.cpp
+--- a/intl/icu/source/common/utrace.cpp
++++ b/intl/icu/source/common/utrace.cpp
+@@ -144,17 +144,17 @@ static void outputPtrBytes(void *val, ch
+ #if !U_IS_BIG_ENDIAN
+     /* Little Endian.  Move p to most significant end of the value      */
+     incVal = -1;
+     p += sizeof(void *) - 1;
+ #endif
+ 
+     /* Loop through the bytes of the ptr as it sits in memory, from 
+      * most significant to least significant end                    */
+-    for (i=0; i<sizeof(void *); i++) {
++    for (i=0; (unsigned) i<sizeof(void *); i++) {
+         outputHexBytes(*p, 2, outBuf, outIx, capacity);
+         p += incVal;
+     }
+ }
+ 
+ static void outputString(const char *s, char *outBuf, int32_t *outIx, int32_t capacity, int32_t indent) {
+     int32_t i = 0;
+     char    c;