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

Unified Diff: source/common/ubidi_props.c

Issue 845603002: Update ICU to 54.1 step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@master
Patch Set: remove unusued directories Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/common/ubidi_props.h ('k') | source/common/ubidi_props_data.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/common/ubidi_props.c
diff --git a/source/common/ubidi_props.c b/source/common/ubidi_props.c
index 00255edc48f8ba7b01b3f7de1a22335922da52a6..42d05f1e2600058eb7fa4ec4d77db6414162de2c 100644
--- a/source/common/ubidi_props.c
+++ b/source/common/ubidi_props.c
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 2004-2013, International Business Machines
+* Copyright (C) 2004-2014, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -32,6 +32,7 @@ struct UBiDiProps {
const int32_t *indexes;
const uint32_t *mirrors;
const uint8_t *jgArray;
+ const uint8_t *jgArray2;
UTrie2 trie;
uint8_t formatVersion[4];
@@ -84,18 +85,28 @@ ubidi_addPropertyStarts(const UBiDiProps *bdp, const USetAdder *sa, UErrorCode *
start=bdp->indexes[UBIDI_IX_JG_START];
limit=bdp->indexes[UBIDI_IX_JG_LIMIT];
jgArray=bdp->jgArray;
- prev=0;
- while(start<limit) {
- jg=*jgArray++;
- if(jg!=prev) {
- sa->add(sa->set, start);
- prev=jg;
+ for(;;) {
+ prev=0;
+ while(start<limit) {
+ jg=*jgArray++;
+ if(jg!=prev) {
+ sa->add(sa->set, start);
+ prev=jg;
+ }
+ ++start;
+ }
+ if(prev!=0) {
+ /* add the limit code point if the last value was not 0 (it is now start==limit) */
+ sa->add(sa->set, limit);
+ }
+ if(limit==bdp->indexes[UBIDI_IX_JG_LIMIT]) {
+ /* switch to the second Joining_Group range */
+ start=bdp->indexes[UBIDI_IX_JG_START2];
+ limit=bdp->indexes[UBIDI_IX_JG_LIMIT2];
+ jgArray=bdp->jgArray2;
+ } else {
+ break;
}
- ++start;
- }
- if(prev!=0) {
- /* add the limit code point if the last value was not 0 (it is now start==limit) */
- sa->add(sa->set, limit);
}
/* add code points with hardcoded properties, plus the ones following them */
@@ -204,9 +215,13 @@ ubidi_getJoiningGroup(const UBiDiProps *bdp, UChar32 c) {
limit=bdp->indexes[UBIDI_IX_JG_LIMIT];
if(start<=c && c<limit) {
return (UJoiningGroup)bdp->jgArray[c-start];
- } else {
- return U_JG_NO_JOINING_GROUP;
}
+ start=bdp->indexes[UBIDI_IX_JG_START2];
+ limit=bdp->indexes[UBIDI_IX_JG_LIMIT2];
+ if(start<=c && c<limit) {
+ return (UJoiningGroup)bdp->jgArray2[c-start];
+ }
+ return U_JG_NO_JOINING_GROUP;
}
U_CFUNC UBidiPairedBracketType
« no previous file with comments | « source/common/ubidi_props.h ('k') | source/common/ubidi_props_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698