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

Side by Side Diff: core/include/fxcrt/fx_string.h

Issue 818193004: XFA: merge patch from CL 729293003, use FX_ArraySize for safety (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 12 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
« no previous file with comments | « core/include/fxcrt/fx_basic.h ('k') | fpdfsdk/include/javascript/JS_Define.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef _FX_STRING_H_ 7 #ifndef _FX_STRING_H_
8 #define _FX_STRING_H_ 8 #define _FX_STRING_H_
9 class CFX_ByteStringC; 9 class CFX_ByteStringC;
10 class CFX_ByteString; 10 class CFX_ByteString;
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 590
591 FX_STRSIZE m_Length; 591 FX_STRSIZE m_Length;
592 private: 592 private:
593 593
594 void* operator new (size_t) throw() 594 void* operator new (size_t) throw()
595 { 595 {
596 return NULL; 596 return NULL;
597 } 597 }
598 }; 598 };
599 typedef const CFX_WideStringC& FX_WSTR; 599 typedef const CFX_WideStringC& FX_WSTR;
600 #define FX_WSTRC(wstr) CFX_WideStringC(wstr, sizeof(wstr) / sizeof(FX_WCHAR) - 1 ) 600 #define FX_WSTRC(wstr) CFX_WideStringC(wstr, FX_ArraySize(wstr) - 1)
601 struct CFX_StringDataW { 601 struct CFX_StringDataW {
602 602
603 long m_nRefs; 603 long m_nRefs;
604 604
605 FX_STRSIZE m_nDataLength; 605 FX_STRSIZE m_nDataLength;
606 606
607 FX_STRSIZE m_nAllocLength; 607 FX_STRSIZE m_nAllocLength;
608 608
609 FX_WCHAR m_String[1]; 609 FX_WCHAR m_String[1];
610 }; 610 };
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
844 CFX_ByteString FX_UTF8Encode(FX_LPCWSTR pwsStr, FX_STRSIZE len); 844 CFX_ByteString FX_UTF8Encode(FX_LPCWSTR pwsStr, FX_STRSIZE len);
845 inline CFX_ByteString FX_UTF8Encode(FX_WSTR wsStr) 845 inline CFX_ByteString FX_UTF8Encode(FX_WSTR wsStr)
846 { 846 {
847 return FX_UTF8Encode(wsStr.GetPtr(), wsStr.GetLength()); 847 return FX_UTF8Encode(wsStr.GetPtr(), wsStr.GetLength());
848 } 848 }
849 inline CFX_ByteString FX_UTF8Encode(const CFX_WideString &wsStr) 849 inline CFX_ByteString FX_UTF8Encode(const CFX_WideString &wsStr)
850 { 850 {
851 return FX_UTF8Encode(wsStr.c_str(), wsStr.GetLength()); 851 return FX_UTF8Encode(wsStr.c_str(), wsStr.GetLength());
852 } 852 }
853 #endif 853 #endif
OLDNEW
« no previous file with comments | « core/include/fxcrt/fx_basic.h ('k') | fpdfsdk/include/javascript/JS_Define.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698