| OLD | NEW |
| 1 /* | 1 /* |
| 2 ******************************************************************************* | 2 ******************************************************************************* |
| 3 * | 3 * |
| 4 * Copyright (C) 2005-2009, International Business Machines | 4 * Copyright (C) 2005-2009, International Business Machines |
| 5 * Corporation and others. All Rights Reserved. | 5 * Corporation and others. All Rights Reserved. |
| 6 * | 6 * |
| 7 ******************************************************************************* | 7 ******************************************************************************* |
| 8 * file name: swapimpl.cpp | 8 * file name: swapimpl.cpp |
| 9 * encoding: US-ASCII | 9 * encoding: US-ASCII |
| 10 * tab size: 8 (not used) | 10 * tab size: 8 (not used) |
| (...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 U_CAPI int32_t U_EXPORT2 | 534 U_CAPI int32_t U_EXPORT2 |
| 535 test_swap(const UDataSwapper *ds, | 535 test_swap(const UDataSwapper *ds, |
| 536 const void *inData, int32_t length, void *outData, | 536 const void *inData, int32_t length, void *outData, |
| 537 UErrorCode *pErrorCode) { | 537 UErrorCode *pErrorCode) { |
| 538 const UDataInfo *pInfo; | 538 const UDataInfo *pInfo; |
| 539 int32_t headerSize; | 539 int32_t headerSize; |
| 540 | 540 |
| 541 const uint8_t *inBytes; | 541 const uint8_t *inBytes; |
| 542 uint8_t *outBytes; | 542 uint8_t *outBytes; |
| 543 | 543 |
| 544 const int32_t *inIndexes; | 544 int32_t offset; |
| 545 int32_t indexes[32]; | |
| 546 | |
| 547 int32_t i, offset, count; | |
| 548 | 545 |
| 549 /* udata_swapDataHeader checks the arguments */ | 546 /* udata_swapDataHeader checks the arguments */ |
| 550 headerSize=udata_swapDataHeader(ds, inData, length, outData, pErrorCode); | 547 headerSize=udata_swapDataHeader(ds, inData, length, outData, pErrorCode); |
| 551 if(pErrorCode==NULL || U_FAILURE(*pErrorCode)) { | 548 if(pErrorCode==NULL || U_FAILURE(*pErrorCode)) { |
| 552 udata_printError(ds, "test_swap(): data header swap failed %s\n", u_erro
rName(*pErrorCode)); | 549 udata_printError(ds, "test_swap(): data header swap failed %s\n", u_erro
rName(*pErrorCode)); |
| 553 return 0; | 550 return 0; |
| 554 } | 551 } |
| 555 | 552 |
| 556 /* check data format and format version */ | 553 /* check data format and format version */ |
| 557 pInfo=(const UDataInfo *)((const char *)inData+4); | 554 pInfo=(const UDataInfo *)((const char *)inData+4); |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 /* the dataFormat was not recognized */ | 710 /* the dataFormat was not recognized */ |
| 714 udata_printError(ds, "udata_swap(): unknown data format %02x.%02x.%02x.%02x
(\"%c%c%c%c\")\n", | 711 udata_printError(ds, "udata_swap(): unknown data format %02x.%02x.%02x.%02x
(\"%c%c%c%c\")\n", |
| 715 pInfo->dataFormat[0], pInfo->dataFormat[1], | 712 pInfo->dataFormat[0], pInfo->dataFormat[1], |
| 716 pInfo->dataFormat[2], pInfo->dataFormat[3], | 713 pInfo->dataFormat[2], pInfo->dataFormat[3], |
| 717 dataFormatChars[0], dataFormatChars[1], | 714 dataFormatChars[0], dataFormatChars[1], |
| 718 dataFormatChars[2], dataFormatChars[3]); | 715 dataFormatChars[2], dataFormatChars[3]); |
| 719 | 716 |
| 720 *pErrorCode=U_UNSUPPORTED_ERROR; | 717 *pErrorCode=U_UNSUPPORTED_ERROR; |
| 721 return 0; | 718 return 0; |
| 722 } | 719 } |
| OLD | NEW |