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

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

Issue 1130053003: Support arrays in nonstd::unique_ptr<>. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Comments, kill dead code. Created 5 years, 7 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 | « no previous file | core/src/fpdfdoc/doc_bookmark.cpp » ('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_BASIC_H_ 7 #ifndef _FX_BASIC_H_
8 #define _FX_BASIC_H_ 8 #define _FX_BASIC_H_
9 9
10 #include "fx_memory.h" 10 #include "fx_memory.h"
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 } 766 }
767 } 767 }
768 operator DataType*() 768 operator DataType*()
769 { 769 {
770 return m_pData ? m_pData : m_Data; 770 return m_pData ? m_pData : m_Data;
771 } 771 }
772 private: 772 private:
773 DataType m_Data[FixedSize]; 773 DataType m_Data[FixedSize];
774 DataType* m_pData; 774 DataType* m_pData;
775 }; 775 };
776 template <class DataType>
777 class CFX_TempBuf
778 {
779 public:
780 CFX_TempBuf(int size)
781 {
782 m_pData = FX_Alloc(DataType, size);
783 }
784 ~CFX_TempBuf()
785 {
786 if (m_pData) {
787 FX_Free(m_pData);
788 }
789 }
790 DataType& operator[](int i)
791 {
792 FXSYS_assert(m_pData != NULL);
793 return m_pData[i];
794 }
795 operator DataType*()
796 {
797 return m_pData;
798 }
799 private:
800 DataType* m_pData;
801 };
802 class CFX_MapPtrToPtr 776 class CFX_MapPtrToPtr
803 { 777 {
804 protected: 778 protected:
805 779
806 struct CAssoc { 780 struct CAssoc {
807 781
808 CAssoc* pNext; 782 CAssoc* pNext;
809 783
810 void* key; 784 void* key;
811 785
(...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after
1633 FX_FLOAT c; 1607 FX_FLOAT c;
1634 FX_FLOAT d; 1608 FX_FLOAT d;
1635 FX_FLOAT e; 1609 FX_FLOAT e;
1636 FX_FLOAT f; 1610 FX_FLOAT f;
1637 FX_FLOAT g; 1611 FX_FLOAT g;
1638 FX_FLOAT h; 1612 FX_FLOAT h;
1639 FX_FLOAT i; 1613 FX_FLOAT i;
1640 }; 1614 };
1641 1615
1642 #endif 1616 #endif
OLDNEW
« no previous file with comments | « no previous file | core/src/fpdfdoc/doc_bookmark.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698