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

Side by Side Diff: core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp

Issue 1172793002: Merge to XFA: Use stdint.h types throughout PDFium. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 6 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 unified diff | Download patch
OLDNEW
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 6
7 #include "../../../include/fpdfapi/fpdf_page.h" 7 #include "../../../include/fpdfapi/fpdf_page.h"
8 #include "../../../include/fpdfapi/fpdf_module.h" 8 #include "../../../include/fpdfapi/fpdf_module.h"
9 #include "../../../include/fpdfapi/fpdf_serial.h" 9 #include "../../../include/fpdfapi/fpdf_serial.h"
10 #include "pageint.h" 10 #include "pageint.h"
(...skipping 1535 matching lines...) Expand 10 before | Expand all | Expand 10 after
1546 } 1546 }
1547 } 1547 }
1548 CFX_ByteString _FPDF_ByteStringFromHex(CFX_BinaryBuf& src_buf) 1548 CFX_ByteString _FPDF_ByteStringFromHex(CFX_BinaryBuf& src_buf)
1549 { 1549 {
1550 CFX_ByteTextBuf buf; 1550 CFX_ByteTextBuf buf;
1551 FX_BOOL bFirst = TRUE; 1551 FX_BOOL bFirst = TRUE;
1552 int code = 0; 1552 int code = 0;
1553 FX_LPCBYTE str = src_buf.GetBuffer(); 1553 FX_LPCBYTE str = src_buf.GetBuffer();
1554 FX_DWORD size = src_buf.GetSize(); 1554 FX_DWORD size = src_buf.GetSize();
1555 for (FX_DWORD i = 0; i < size; i ++) { 1555 for (FX_DWORD i = 0; i < size; i ++) {
1556 FX_BYTE ch = str[i]; 1556 uint8_t ch = str[i];
1557 if (ch >= '0' && ch <= '9') { 1557 if (ch >= '0' && ch <= '9') {
1558 if (bFirst) { 1558 if (bFirst) {
1559 code = (ch - '0') * 16; 1559 code = (ch - '0') * 16;
1560 } else { 1560 } else {
1561 code += ch - '0'; 1561 code += ch - '0';
1562 buf.AppendChar((char)code); 1562 buf.AppendChar((char)code);
1563 } 1563 }
1564 bFirst = !bFirst; 1564 bFirst = !bFirst;
1565 } else if (ch >= 'A' && ch <= 'F') { 1565 } else if (ch >= 'A' && ch <= 'F') {
1566 if (bFirst) { 1566 if (bFirst) {
(...skipping 11 matching lines...) Expand all
1578 buf.AppendChar((char)code); 1578 buf.AppendChar((char)code);
1579 } 1579 }
1580 bFirst = !bFirst; 1580 bFirst = !bFirst;
1581 } 1581 }
1582 } 1582 }
1583 if (!bFirst) { 1583 if (!bFirst) {
1584 buf.AppendChar((char)code); 1584 buf.AppendChar((char)code);
1585 } 1585 }
1586 return buf.GetByteString(); 1586 return buf.GetByteString();
1587 } 1587 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp ('k') | core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698