| OLD | NEW |
| 1 /* | 1 /* |
| 2 ****************************************************************************** | 2 ****************************************************************************** |
| 3 * | 3 * |
| 4 * Copyright (C) 2002-2011, International Business Machines | 4 * Copyright (C) 2002-2015, International Business Machines |
| 5 * Corporation and others. All Rights Reserved. | 5 * Corporation and others. All Rights Reserved. |
| 6 * | 6 * |
| 7 ****************************************************************************** | 7 ****************************************************************************** |
| 8 * file name: ucnvbocu.cpp | 8 * file name: ucnvbocu.cpp |
| 9 * encoding: US-ASCII | 9 * encoding: US-ASCII |
| 10 * tab size: 8 (not used) | 10 * tab size: 8 (not used) |
| 11 * indentation:4 | 11 * indentation:4 |
| 12 * | 12 * |
| 13 * created on: 2002mar27 | 13 * created on: 2002mar27 |
| 14 * created by: Markus W. Scherer | 14 * created by: Markus W. Scherer |
| 15 * | 15 * |
| 16 * This is an implementation of the Binary Ordered Compression for Unicode, | 16 * This is an implementation of the Binary Ordered Compression for Unicode, |
| 17 * in its MIME-friendly form as defined in http://www.unicode.org/notes/tn6/ | 17 * in its MIME-friendly form as defined in http://www.unicode.org/notes/tn6/ |
| 18 */ | 18 */ |
| 19 | 19 |
| 20 #include "unicode/utypes.h" | 20 #include "unicode/utypes.h" |
| 21 | 21 |
| 22 #if !UCONFIG_NO_CONVERSION && !UCONFIG_NO_NON_HTML5_CONVERSION | 22 #if !UCONFIG_NO_CONVERSION && !UCONFIG_ONLY_HTML_CONVERSION |
| 23 | 23 |
| 24 #include "unicode/ucnv.h" | 24 #include "unicode/ucnv.h" |
| 25 #include "unicode/ucnv_cb.h" | 25 #include "unicode/ucnv_cb.h" |
| 26 #include "unicode/utf16.h" | 26 #include "unicode/utf16.h" |
| 27 #include "putilimp.h" | 27 #include "putilimp.h" |
| 28 #include "ucnv_bld.h" | 28 #include "ucnv_bld.h" |
| 29 #include "ucnv_cnv.h" | 29 #include "ucnv_cnv.h" |
| 30 #include "uassert.h" | 30 #include "uassert.h" |
| 31 | 31 |
| 32 /* BOCU-1 constants and macros ---------------------------------------------- */ | 32 /* BOCU-1 constants and macros ---------------------------------------------- */ |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 UConverter *cnv; | 392 UConverter *cnv; |
| 393 const UChar *source, *sourceLimit; | 393 const UChar *source, *sourceLimit; |
| 394 uint8_t *target; | 394 uint8_t *target; |
| 395 int32_t targetCapacity; | 395 int32_t targetCapacity; |
| 396 int32_t *offsets; | 396 int32_t *offsets; |
| 397 | 397 |
| 398 int32_t prev, c, diff; | 398 int32_t prev, c, diff; |
| 399 | 399 |
| 400 int32_t sourceIndex, nextSourceIndex; | 400 int32_t sourceIndex, nextSourceIndex; |
| 401 | 401 |
| 402 U_ALIGN_CODE(16) | |
| 403 | |
| 404 /* set up the local pointers */ | 402 /* set up the local pointers */ |
| 405 cnv=pArgs->converter; | 403 cnv=pArgs->converter; |
| 406 source=pArgs->source; | 404 source=pArgs->source; |
| 407 sourceLimit=pArgs->sourceLimit; | 405 sourceLimit=pArgs->sourceLimit; |
| 408 target=(uint8_t *)pArgs->target; | 406 target=(uint8_t *)pArgs->target; |
| 409 targetCapacity=(int32_t)(pArgs->targetLimit-pArgs->target); | 407 targetCapacity=(int32_t)(pArgs->targetLimit-pArgs->target); |
| 410 offsets=pArgs->offsets; | 408 offsets=pArgs->offsets; |
| 411 | 409 |
| 412 /* get the converter state from UConverter */ | 410 /* get the converter state from UConverter */ |
| 413 c=cnv->fromUChar32; | 411 c=cnv->fromUChar32; |
| (...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1164 UConverter *cnv; | 1162 UConverter *cnv; |
| 1165 const uint8_t *source, *sourceLimit; | 1163 const uint8_t *source, *sourceLimit; |
| 1166 UChar *target; | 1164 UChar *target; |
| 1167 const UChar *targetLimit; | 1165 const UChar *targetLimit; |
| 1168 | 1166 |
| 1169 int32_t prev, count, diff, c; | 1167 int32_t prev, count, diff, c; |
| 1170 | 1168 |
| 1171 int8_t byteIndex; | 1169 int8_t byteIndex; |
| 1172 uint8_t *bytes; | 1170 uint8_t *bytes; |
| 1173 | 1171 |
| 1174 U_ALIGN_CODE(16) | |
| 1175 | |
| 1176 /* set up the local pointers */ | 1172 /* set up the local pointers */ |
| 1177 cnv=pArgs->converter; | 1173 cnv=pArgs->converter; |
| 1178 source=(const uint8_t *)pArgs->source; | 1174 source=(const uint8_t *)pArgs->source; |
| 1179 sourceLimit=(const uint8_t *)pArgs->sourceLimit; | 1175 sourceLimit=(const uint8_t *)pArgs->sourceLimit; |
| 1180 target=pArgs->target; | 1176 target=pArgs->target; |
| 1181 targetLimit=pArgs->targetLimit; | 1177 targetLimit=pArgs->targetLimit; |
| 1182 | 1178 |
| 1183 /* get the converter state from UConverter */ | 1179 /* get the converter state from UConverter */ |
| 1184 prev=(int32_t)cnv->toUnicodeStatus; | 1180 prev=(int32_t)cnv->toUnicodeStatus; |
| 1185 if(prev==0) { | 1181 if(prev==0) { |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1389 FALSE, FALSE, | 1385 FALSE, FALSE, |
| 1390 0, | 1386 0, |
| 1391 0, | 1387 0, |
| 1392 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } /* reserved */ | 1388 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } /* reserved */ |
| 1393 }; | 1389 }; |
| 1394 | 1390 |
| 1395 const UConverterSharedData _Bocu1Data= | 1391 const UConverterSharedData _Bocu1Data= |
| 1396 UCNV_IMMUTABLE_SHARED_DATA_INITIALIZER(&_Bocu1StaticData, &_Bocu1Impl); | 1392 UCNV_IMMUTABLE_SHARED_DATA_INITIALIZER(&_Bocu1StaticData, &_Bocu1Impl); |
| 1397 | 1393 |
| 1398 #endif | 1394 #endif |
| OLD | NEW |