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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « icu.gyp ('k') | source/i18n/colldata.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 Index: common/unicode/unistr.h 1 Index: common/unicode/unistr.h
2 =================================================================== 2 ===================================================================
3 --- common/unicode/unistr.h (revision 75773) 3 --- common/unicode/unistr.h (revision 75773)
4 +++ common/unicode/unistr.h (working copy) 4 +++ common/unicode/unistr.h (working copy)
5 @@ -4089,7 +4089,7 @@ 5 @@ -4089,7 +4089,7 @@
6 #if defined(__GNUC__) 6 #if defined(__GNUC__)
7 // Ticket #7039: Clip length to the maximum valid length to the end of addres sable memory given the starting address 7 // Ticket #7039: Clip length to the maximum valid length to the end of addres sable memory given the starting address
8 // This is only an issue when using GCC and certain optimizations are turned on. 8 // This is only an issue when using GCC and certain optimizations are turned on.
9 - return extract(start, _length, dst, dst!=0 ? ((dst >= (char*)((size_t)-1) - U INT32_MAX) ? (((char*)UINT32_MAX) - dst) : UINT32_MAX) : 0, codepage); 9 - return extract(start, _length, dst, dst!=0 ? ((dst >= (char*)((size_t)-1) - U INT32_MAX) ? (((char*)UINT32_MAX) - dst) : UINT32_MAX) : 0, codepage);
10 + return extract(start, _length, dst, dst!=0 ? ((dst >= (char*)((size_t)-1) - U INT32_MAX) ? static_cast<unsigned int>((((char*)UINT32_MAX) - dst)) : UINT32_MAX ) : 0, codepage); 10 + return extract(start, _length, dst, dst!=0 ? ((dst >= (char*)((size_t)-1) - U INT32_MAX) ? static_cast<unsigned int>((((char*)UINT32_MAX) - dst)) : UINT32_MAX ) : 0, codepage);
11 #else 11 #else
12 return extract(start, _length, dst, dst!=0 ? 0xffffffff : 0, codepage); 12 return extract(start, _length, dst, dst!=0 ? 0xffffffff : 0, codepage);
13 #endif 13 #endif
14 Index: source/i18n/colldata.cpp
15 ===================================================================
16 --- source/i18n/colldata.cpp (revision 122103)
17 +++ source/i18n/colldata.cpp (working copy)
18 @@ -236,9 +236,14 @@
19 int32_t newMax = listMax + STRING_LIST_BUFFER_SIZE;
20
21 UnicodeString *newStrings = new UnicodeString[newMax];
22 + if (newStrings == NULL) {
23 + status = U_MEMORY_ALLOCATION_ERROR;
24 + return;
25 + }
26 + for (int32_t i=0; i<listSize; ++i) {
27 + newStrings[i] = strings[i];
28 + }
29
30 - uprv_memcpy(newStrings, strings, listSize * sizeof(UnicodeString));
31 -
32 #ifdef INSTRUMENT_STRING_LIST
33 int32_t _h = listSize / STRING_LIST_BUFFER_SIZE;
34
35 Index: source/i18n/decNumber.c
36 ===================================================================
37 --- source/i18n/decNumber.c (revision 122103)
38 +++ source/i18n/decNumber.c (working copy)
39 @@ -1502,7 +1502,14 @@
40 }
41 uprv_decNumberZero(w); /* set up 10... */
42 #if DECDPUN==1
43 + #ifdef __clang__
44 + #pragma clang diagnostic push
45 + #pragma clang diagnostic ignored "-Warray-bounds"
46 + #endif
47 w->lsu[1]=1; w->lsu[0]=0; /* .. */
48 + #ifdef __clang__
49 + #pragma clang diagnostic pop
50 + #endif
51 #else
52 w->lsu[0]=10; /* .. */
53 #endif
54 @@ -2934,6 +2941,10 @@
55 /* Set t=0.259, a=0.819 */
56 t->exponent=-3;
57 a->exponent=-3;
58 + #ifdef __clang__
59 + #pragma clang diagnostic push
60 + #pragma clang diagnostic ignored "-Warray-bounds"
61 + #endif
62 #if DECDPUN>=3
63 t->lsu[0]=259;
64 a->lsu[0]=819;
65 @@ -2944,6 +2955,9 @@
66 t->lsu[0]=9; t->lsu[1]=5; t->lsu[2]=2;
67 a->lsu[0]=9; a->lsu[1]=1; a->lsu[2]=8;
68 #endif
69 + #ifdef __clang__
Nico 2012/02/17 01:10:51 Looks like the patch file still has the old change
70 + #pragma clang diagnostic pop
71 + #endif
72 }
73 else { /* odd exponent */
74 /* Set t=0.0819, a=2.59 */
75 @@ -2951,6 +2965,10 @@
76 exp++; /* e=e+1 */
77 t->exponent=-4;
78 a->exponent=-2;
79 + #ifdef __clang__
80 + #pragma clang diagnostic push
81 + #pragma clang diagnostic ignored "-Warray-bounds"
82 + #endif
83 #if DECDPUN>=3
84 t->lsu[0]=819;
85 a->lsu[0]=259;
86 @@ -2961,6 +2979,9 @@
87 t->lsu[0]=9; t->lsu[1]=1; t->lsu[2]=8;
88 a->lsu[0]=9; a->lsu[1]=5; a->lsu[2]=2;
89 #endif
90 + #ifdef __clang__
91 + #pragma clang diagnostic pop
92 + #endif
93 }
94
95 decMultiplyOp(a, a, f, &workset, &ignore); /* a=a*f */
96 @@ -5637,7 +5658,14 @@
97 /* lookaside fastpath code for ln(2) and ln(10) at common lengths */
98 if (rhs->exponent==0 && set->digits<=40) {
99 #if DECDPUN==1
100 + #ifdef __clang__
101 + #pragma clang diagnostic push
102 + #pragma clang diagnostic ignored "-Warray-bounds"
103 + #endif
104 if (rhs->lsu[0]==0 && rhs->lsu[1]==1 && rhs->digits==2) { /* ln(10) */
105 + #ifdef __clang__
106 + #pragma clang diagnostic pop
107 + #endif
108 #else
109 if (rhs->lsu[0]==10 && rhs->digits==2) { /* ln(10) */
110 #endif
OLDNEW
« 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