Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Unified Diff: patches/clang.patch

Issue 9420032: Take care of two Clang warnings. (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/icu46/
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « icu.gyp ('k') | source/i18n/colldata.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: patches/clang.patch
===================================================================
--- patches/clang.patch (revision 122360)
+++ patches/clang.patch (working copy)
@@ -11,3 +11,100 @@
#else
return extract(start, _length, dst, dst!=0 ? 0xffffffff : 0, codepage);
#endif
+Index: source/i18n/colldata.cpp
+===================================================================
+--- source/i18n/colldata.cpp (revision 122103)
++++ source/i18n/colldata.cpp (working copy)
+@@ -236,9 +236,14 @@
+ int32_t newMax = listMax + STRING_LIST_BUFFER_SIZE;
+
+ UnicodeString *newStrings = new UnicodeString[newMax];
++ if (newStrings == NULL) {
++ status = U_MEMORY_ALLOCATION_ERROR;
++ return;
++ }
++ for (int32_t i=0; i<listSize; ++i) {
++ newStrings[i] = strings[i];
++ }
+
+- uprv_memcpy(newStrings, strings, listSize * sizeof(UnicodeString));
+-
+ #ifdef INSTRUMENT_STRING_LIST
+ int32_t _h = listSize / STRING_LIST_BUFFER_SIZE;
+
+Index: source/i18n/decNumber.c
+===================================================================
+--- source/i18n/decNumber.c (revision 122103)
++++ source/i18n/decNumber.c (working copy)
+@@ -1502,7 +1502,14 @@
+ }
+ uprv_decNumberZero(w); /* set up 10... */
+ #if DECDPUN==1
++ #ifdef __clang__
++ #pragma clang diagnostic push
++ #pragma clang diagnostic ignored "-Warray-bounds"
++ #endif
+ w->lsu[1]=1; w->lsu[0]=0; /* .. */
++ #ifdef __clang__
++ #pragma clang diagnostic pop
++ #endif
+ #else
+ w->lsu[0]=10; /* .. */
+ #endif
+@@ -2934,6 +2941,10 @@
+ /* Set t=0.259, a=0.819 */
+ t->exponent=-3;
+ a->exponent=-3;
++ #ifdef __clang__
++ #pragma clang diagnostic push
++ #pragma clang diagnostic ignored "-Warray-bounds"
++ #endif
+ #if DECDPUN>=3
+ t->lsu[0]=259;
+ a->lsu[0]=819;
+@@ -2944,6 +2955,9 @@
+ t->lsu[0]=9; t->lsu[1]=5; t->lsu[2]=2;
+ a->lsu[0]=9; a->lsu[1]=1; a->lsu[2]=8;
+ #endif
++ #ifdef __clang__
Nico 2012/02/17 01:10:51 Looks like the patch file still has the old change
++ #pragma clang diagnostic pop
++ #endif
+ }
+ else { /* odd exponent */
+ /* Set t=0.0819, a=2.59 */
+@@ -2951,6 +2965,10 @@
+ exp++; /* e=e+1 */
+ t->exponent=-4;
+ a->exponent=-2;
++ #ifdef __clang__
++ #pragma clang diagnostic push
++ #pragma clang diagnostic ignored "-Warray-bounds"
++ #endif
+ #if DECDPUN>=3
+ t->lsu[0]=819;
+ a->lsu[0]=259;
+@@ -2961,6 +2979,9 @@
+ t->lsu[0]=9; t->lsu[1]=1; t->lsu[2]=8;
+ a->lsu[0]=9; a->lsu[1]=5; a->lsu[2]=2;
+ #endif
++ #ifdef __clang__
++ #pragma clang diagnostic pop
++ #endif
+ }
+
+ decMultiplyOp(a, a, f, &workset, &ignore); /* a=a*f */
+@@ -5637,7 +5658,14 @@
+ /* lookaside fastpath code for ln(2) and ln(10) at common lengths */
+ if (rhs->exponent==0 && set->digits<=40) {
+ #if DECDPUN==1
++ #ifdef __clang__
++ #pragma clang diagnostic push
++ #pragma clang diagnostic ignored "-Warray-bounds"
++ #endif
+ if (rhs->lsu[0]==0 && rhs->lsu[1]==1 && rhs->digits==2) { /* ln(10) */
++ #ifdef __clang__
++ #pragma clang diagnostic pop
++ #endif
+ #else
+ if (rhs->lsu[0]==10 && rhs->digits==2) { /* ln(10) */
+ #endif
« no previous file with comments | « icu.gyp ('k') | source/i18n/colldata.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698