| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 // Original code is licensed as follows: | 6 // Original code is licensed as follows: |
| 7 /* | 7 /* |
| 8 * Copyright 2008 ZXing authors | 8 * Copyright 2008 ZXing authors |
| 9 * | 9 * |
| 10 * Licensed under the Apache License, Version 2.0 (the "License"); | 10 * Licensed under the Apache License, Version 2.0 (the "License"); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 break; | 76 break; |
| 77 case 5: | 77 case 5: |
| 78 DecodeEdifactSegment(&bits, result, e); | 78 DecodeEdifactSegment(&bits, result, e); |
| 79 BC_EXCEPTION_CHECK_ReturnValue(e, NULL); | 79 BC_EXCEPTION_CHECK_ReturnValue(e, NULL); |
| 80 break; | 80 break; |
| 81 case 6: | 81 case 6: |
| 82 DecodeBase256Segment(&bits, result, byteSegments, e); | 82 DecodeBase256Segment(&bits, result, byteSegments, e); |
| 83 BC_EXCEPTION_CHECK_ReturnValue(e, NULL); | 83 BC_EXCEPTION_CHECK_ReturnValue(e, NULL); |
| 84 break; | 84 break; |
| 85 default: | 85 default: |
| 86 NULL; | |
| 87 e = BCExceptionFormatException; | 86 e = BCExceptionFormatException; |
| 88 return NULL; | 87 return NULL; |
| 89 } | 88 } |
| 90 mode = ASCII_ENCODE; | 89 mode = ASCII_ENCODE; |
| 91 } | 90 } |
| 92 } while (mode != PAD_ENCODE && bits.Available() > 0); | 91 } while (mode != PAD_ENCODE && bits.Available() > 0); |
| 93 if (resultTrailer.GetLength() > 0) { | 92 if (resultTrailer.GetLength() > 0) { |
| 94 result += resultTrailer; | 93 result += resultTrailer; |
| 95 } | 94 } |
| 96 CBC_CommonDecoderResult* tempCp = new CBC_CommonDecoderResult(); | 95 CBC_CommonDecoderResult* tempCp = new CBC_CommonDecoderResult(); |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 BC_FX_ByteString_Append(result, *bytes); | 475 BC_FX_ByteString_Append(result, *bytes); |
| 477 delete bytes; | 476 delete bytes; |
| 478 } | 477 } |
| 479 uint8_t CBC_DataMatrixDecodedBitStreamParser::Unrandomize255State( | 478 uint8_t CBC_DataMatrixDecodedBitStreamParser::Unrandomize255State( |
| 480 int32_t randomizedBase256Codeword, | 479 int32_t randomizedBase256Codeword, |
| 481 int32_t base256CodewordPosition) { | 480 int32_t base256CodewordPosition) { |
| 482 int32_t pseudoRandomNumber = ((149 * base256CodewordPosition) % 255) + 1; | 481 int32_t pseudoRandomNumber = ((149 * base256CodewordPosition) % 255) + 1; |
| 483 int32_t tempVariable = randomizedBase256Codeword - pseudoRandomNumber; | 482 int32_t tempVariable = randomizedBase256Codeword - pseudoRandomNumber; |
| 484 return (uint8_t)(tempVariable >= 0 ? tempVariable : tempVariable + 256); | 483 return (uint8_t)(tempVariable >= 0 ? tempVariable : tempVariable + 256); |
| 485 } | 484 } |
| OLD | NEW |