Fix enum vs unsigned -Wsign-compare warning

Recent Clang versions started taking into account that enums are signed
on Windows when emitting these warnings.

Bug: 792519
Change-Id: I32782dc34fc0480942038e4950266448e38d2eec
Reviewed-on: https://chromium-review.googlesource.com/813495
Reviewed-by: Jungshik Shin <jshin@chromium.org>
diff --git a/README.chromium b/README.chromium
index 9a7bd7b..9f3999d 100644
--- a/README.chromium
+++ b/README.chromium
@@ -253,3 +253,8 @@
   - patches/script_extension.patch 
     upstream bug: https://ssl.icu-project.org/trac/ticket/13462
     (fixed in 60maint branch)
+
+6. Fix -Wsign-compare warning in EnumSet::isValidEnum()
+
+  - patches/isvalidenum.patch
+    upstream bug: https://ssl.icu-project.org/trac/ticket/13509
diff --git a/patches/isvalidenum.patch b/patches/isvalidenum.patch
new file mode 100644
index 0000000..8e4b860
--- /dev/null
+++ b/patches/isvalidenum.patch
@@ -0,0 +1,13 @@
+diff --git a/source/common/unicode/enumset.h b/source/common/unicode/enumset.h
+index f63dd162..68012fa0 100644
+--- a/source/common/unicode/enumset.h
++++ b/source/common/unicode/enumset.h
+@@ -42,7 +42,7 @@ public:
+     inline int32_t contains(T toCheck) const { return get(toCheck); }
+     inline void set(T toSet, int32_t v) { fBools=(fBools&(~flag(toSet)))|(v?(flag(toSet)):0); }
+     inline int32_t get(T toCheck) const { return (fBools & flag(toCheck))?1:0; }
+-    inline UBool isValidEnum(T toCheck) const {  return (toCheck>=minValue&&toCheck<limitValue); }
++    inline UBool isValidEnum(T toCheck) const {  return ((uint32_t)toCheck>=minValue&&(uint32_t)toCheck<limitValue); }
+     inline UBool isValidValue(int32_t v) const { return (v==0||v==1); }
+     inline const EnumSet<T,minValue,limitValue>& operator=(const EnumSet<T,minValue,limitValue>& other) {
+         fBools = other.fBools;
diff --git a/source/common/unicode/enumset.h b/source/common/unicode/enumset.h
index f63dd16..68012fa 100644
--- a/source/common/unicode/enumset.h
+++ b/source/common/unicode/enumset.h
@@ -42,7 +42,7 @@
     inline int32_t contains(T toCheck) const { return get(toCheck); }
     inline void set(T toSet, int32_t v) { fBools=(fBools&(~flag(toSet)))|(v?(flag(toSet)):0); }
     inline int32_t get(T toCheck) const { return (fBools & flag(toCheck))?1:0; }
-    inline UBool isValidEnum(T toCheck) const {  return (toCheck>=minValue&&toCheck<limitValue); }
+    inline UBool isValidEnum(T toCheck) const {  return ((uint32_t)toCheck>=minValue&&(uint32_t)toCheck<limitValue); }
     inline UBool isValidValue(int32_t v) const { return (v==0||v==1); }
     inline const EnumSet<T,minValue,limitValue>& operator=(const EnumSet<T,minValue,limitValue>& other) {
         fBools = other.fBools;