Skip to content

Commit e2fafa5

Browse files
committed
ICU-21694 ubidi.h sample code would not compile
1 parent b03b8be commit e2fafa5

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

icu4c/source/common/unicode/ubidi.h

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
*
8585
* <pre>
8686
* \code
87-
*#include "unicode/ubidi.h"
87+
*#include <unicode/ubidi.h>
8888
*
8989
*typedef enum {
9090
* styleNormal=0, styleSelected=1,
@@ -136,11 +136,11 @@
136136
* int styleLimit;
137137
*
138138
* for(i=0; i<styleRunCount; ++i) {
139-
* styleLimit=styleRun[i].limit;
139+
* styleLimit=styleRuns[i].limit;
140140
* if(start<styleLimit) {
141141
* if(styleLimit>limit) { styleLimit=limit; }
142142
* renderRun(text, start, styleLimit,
143-
* direction, styleRun[i].style);
143+
* direction, styleRuns[i].style);
144144
* if(styleLimit==limit) { break; }
145145
* start=styleLimit;
146146
* }
@@ -150,14 +150,14 @@
150150
*
151151
* for(i=styleRunCount-1; i>=0; --i) {
152152
* if(i>0) {
153-
* styleStart=styleRun[i-1].limit;
153+
* styleStart=styleRuns[i-1].limit;
154154
* } else {
155155
* styleStart=0;
156156
* }
157157
* if(limit>=styleStart) {
158158
* if(styleStart<start) { styleStart=start; }
159159
* renderRun(text, styleStart, limit,
160-
* direction, styleRun[i].style);
160+
* direction, styleRuns[i].style);
161161
* if(styleStart==start) { break; }
162162
* limit=styleStart;
163163
* }
@@ -168,7 +168,8 @@
168168
* // the line object represents text[start..limit-1]
169169
* void renderLine(UBiDi *line, const UChar *text,
170170
* int32_t start, int32_t limit,
171-
* const StyleRun *styleRuns, int styleRunCount) {
171+
* const StyleRun *styleRuns, int styleRunCount,
172+
* UErrorCode *pErrorCode) {
172173
* UBiDiDirection direction=ubidi_getDirection(line);
173174
* if(direction!=UBIDI_MIXED) {
174175
* // unidirectional
@@ -183,14 +184,14 @@
183184
* int32_t count, i, length;
184185
* UBiDiLevel level;
185186
*
186-
* count=ubidi_countRuns(para, pErrorCode);
187+
* count=ubidi_countRuns(line, pErrorCode);
187188
* if(U_SUCCESS(*pErrorCode)) {
188189
* if(styleRunCount<=1) {
189190
* Style style=styleRuns[0].style;
190191
*
191192
* // iterate over directional runs
192193
* for(i=0; i<count; ++i) {
193-
* direction=ubidi_getVisualRun(para, i, &start, &length);
194+
* direction=ubidi_getVisualRun(line, i, &start, &length);
194195
* renderRun(text, start, start+length, direction, style);
195196
* }
196197
* } else {
@@ -244,7 +245,7 @@
244245
* startLine(paraLevel, width);
245246
*
246247
* renderLine(para, text, 0, length,
247-
* styleRuns, styleRunCount);
248+
* styleRuns, styleRunCount, pErrorCode);
248249
* } else {
249250
* UBiDi *line;
250251
*
@@ -268,7 +269,7 @@
268269
*
269270
* renderLine(line, text, start, limit,
270271
* styleRuns+styleRunStart,
271-
* styleRunLimit-styleRunStart);
272+
* styleRunLimit-styleRunStart, pErrorCode);
272273
* }
273274
* if(limit==length) { break; }
274275
* start=limit;

0 commit comments

Comments
 (0)