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

Side by Side Diff: source/common/uvectr64.cpp

Issue 1621843002: ICU 56 update step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@561
Patch Set: Created 4 years, 11 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
« no previous file with comments | « source/common/uvectr32.cpp ('k') | source/common/wintz.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 ****************************************************************************** 2 ******************************************************************************
3 * Copyright (C) 1999-2010, International Business Machines Corporation and * 3 * Copyright (C) 1999-2015, International Business Machines Corporation and
4 * others. All Rights Reserved. * 4 * others. All Rights Reserved.
5 ****************************************************************************** 5 ******************************************************************************
6 */ 6 */
7 7
8 #include "uvectr64.h" 8 #include "uvectr64.h"
9 #include "cmemory.h" 9 #include "cmemory.h"
10 #include "putilimp.h" 10 #include "putilimp.h"
11 11
12 U_NAMESPACE_BEGIN 12 U_NAMESPACE_BEGIN
13 13
14 #define DEFAULT_CAPACITY 8 14 #define DEFAULT_CAPACITY 8
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 ++count; 107 ++count;
108 } 108 }
109 /* else index out of range */ 109 /* else index out of range */
110 } 110 }
111 111
112 void UVector64::removeAllElements(void) { 112 void UVector64::removeAllElements(void) {
113 count = 0; 113 count = 0;
114 } 114 }
115 115
116 UBool UVector64::expandCapacity(int32_t minimumCapacity, UErrorCode &status) { 116 UBool UVector64::expandCapacity(int32_t minimumCapacity, UErrorCode &status) {
117 if (U_FAILURE(status)) {
118 return FALSE;
119 }
117 if (minimumCapacity < 0) { 120 if (minimumCapacity < 0) {
118 status = U_ILLEGAL_ARGUMENT_ERROR; 121 status = U_ILLEGAL_ARGUMENT_ERROR;
119 return FALSE; 122 return FALSE;
120 } 123 }
121 if (capacity >= minimumCapacity) { 124 if (capacity >= minimumCapacity) {
122 return TRUE; 125 return TRUE;
123 } 126 }
124 if (maxCapacity>0 && minimumCapacity>maxCapacity) { 127 if (maxCapacity>0 && minimumCapacity>maxCapacity) {
125 status = U_BUFFER_OVERFLOW_ERROR; 128 status = U_BUFFER_OVERFLOW_ERROR;
126 return FALSE; 129 return FALSE;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 } 203 }
201 for (i=count; i<newSize; ++i) { 204 for (i=count; i<newSize; ++i) {
202 elements[i] = 0; 205 elements[i] = 0;
203 } 206 }
204 } 207 }
205 count = newSize; 208 count = newSize;
206 } 209 }
207 210
208 U_NAMESPACE_END 211 U_NAMESPACE_END
209 212
OLDNEW
« no previous file with comments | « source/common/uvectr32.cpp ('k') | source/common/wintz.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698