summaryrefslogtreecommitdiff
path: root/core/include/fxcrt/fx_basic.h
AgeCommit message (Collapse)Author
2016-01-11Merge to XFA: Switch most min/max macros to std::min/max.Lei Zhang
Fix lint errors along the way. R=tsepez@chromium.org TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1567343002 . (cherry picked from commit 9adfbb0920a258e916003b1ee9515e97879db82a) Review URL: https://codereview.chromium.org/1577503002 .
2016-01-04Merge to XFA: Remove CPDF_Creator::m_ObjectSize, it's never read from.Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1543413002 . (cherry picked from commit 03f5040cbe03cc93e133cb98ecce6725e2679170) Review URL: https://codereview.chromium.org/1555193002 .
2015-12-24Merge to XFA: Switch from nonstd::unique_ptr to std::unique_ptr.Lei Zhang
TBR=thakis@chromium.org Review URL: https://codereview.chromium.org/1547833002 . (cherry picked from commit d20dfba2ae10e8aeb328328f09da79ff904110a8) Review URL: https://codereview.chromium.org/1545183002 .
2015-12-17Merge to XFA: FX_NAMESPACE_DECLARE pointless.Tom Sepez
Orignal Review URL: https://codereview.chromium.org/1534003002 . (cherry picked from commit fed9dd90c086c854ef13440e6022602eb9f91cfc) TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1537463003 .
2015-12-14Merge to XFA: Get rid of most instance of 'foo == NULL'Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1520063002 . (cherry picked from commit e385244f8cd6ae376f6b3cf1265a0795d5d30eff) Review URL: https://codereview.chromium.org/1528763003 .
2015-12-14Merge to XFA: Get rid of most instance of 'foo != NULL'Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1512763013 . (cherry picked from commit e3c7c2b54348da4a6939f6672f6c6bff126815a7) Review URL: https://codereview.chromium.org/1529553003 .
2015-12-14Merge to XFA: Properly land "Fix hint table loading issues."Oliver Chang
R=thestig@chromium.org TBR=thestig@chromium.org BUG=566179 Original Review URL: https://codereview.chromium.org/1524983002 . (cherry picked from commit 1eb7477b3e7c5cb7c54ca364810ab9a24acad4f9) Review URL: https://codereview.chromium.org/1525793003 .
2015-12-14Merge to XFA: Fix hint table loading issues.Oliver Chang
BUG=566179 TBR=thestig@chromium.org Original Review URL: https://codereview.chromium.org/1523523002 . (cherry picked from commit be8408f43bcfd69a74007a340a4c034004146c60) Review URL: https://codereview.chromium.org/1518403003 .
2015-11-25Manual fixups to PDF_ENABLE_XFA in core/Tom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1477663003 .
2015-11-25Inflict PPDF_ENABLE_XFA ifdefs on XFA core/Tom Sepez
R=thestig@chromium.org Review URL: https://codereview.chromium.org/1471323004 .
2015-10-23Merge to XFA: Cleanup: Remove unused CPDF_Stream::Clone().Lei Zhang
Cloning a CPDF_Stream actually happens via CPDF_Object::Clone(). Transitively, remove: - GetStreamFilter() -- all the filters. Also remove CXFA_FileRead. R=jam@chromium.org Review URL: https://codereview.chromium.org/1288543002 . (cherry picked from commit c9a05f1c90860a97dbe4b8014bc4584bfa3a4580) Review URL: https://codereview.chromium.org/1297463002 .
2015-10-19Merge to XFA: Remove some checks for object creation failures. They cannot fail.Lei Zhang
Also reduce nesting in if statements, remove CFX_SmartPointer, and use more unique_ptrs. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1393303004 . (cherry picked from commit 6101a5f98b27888f1736ae74982ed4d409d83be0) Review URL: https://codereview.chromium.org/1413223002 .
2015-10-02Merge to XFA: Get rid of gotos in CPDF_SyntaxParser and FlateUncompress().Lei Zhang
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1360103002 . (cherry picked from commit b8a074711108baf04017d86207e08c19ff327d8e) Review URL: https://codereview.chromium.org/1384123002 .
2015-10-01XFA: Remove checks in fxcrt now that new can't return 0.Lei Zhang
This is a manual merge. Original review: https://codereview.chromium.org/1052553006 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1384643002 .
2015-10-01Merge to XFA: Clean up some image decoder classes:Lei Zhang
- Use std::vector<uint8_t> instead of raw uint8_t* - Make ICodec_ScanlineDecoder::GetScanline() return const uint8_t* - Add FxFreeDeleter, use it in CCodec_ImageDataCache. - Make CCodec_ImageDataCache encapsulate its data members. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1361053002 . (cherry picked from commit 022da0014faa103901ec107ed6a33e5ab00c7931) Review URL: https://codereview.chromium.org/1372993003 .
2015-09-22Merge to XFA: Change nonstd::unique_ptr to take a custom deleter.Lei Zhang
Code is mostly stolen from Chromium's scoped_ptr. - Add unit tests. - Use this to fix a leak. BUG=chromium:531408 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1351383004 . (cherry picked from commit cef2a9c51bee4b987fc813013d45dad6535a9a46) Review URL: https://codereview.chromium.org/1358163003 .
2015-08-19Merge to XFA: Remove more dead code from fx_basic.hTom Sepez
(cherry picked from commit 57207efd5f17ec63e174061ea5415afb58516fce) Original Review URL: https://codereview.chromium.org/1294683003 . TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1299263002 .
2015-08-19Merge to XFA: FX_CMapDwordToDword considered harmful.Tom Sepez
(cherry picked from commit 85d5c4af4a9546970b34dd413c473d10fef8534b) Original Review URL: https://codereview.chromium.org/1289703003 . TBR=thestig@chromium.org Conflicts: core/include/fxcrt/fx_basic.h BUG= Review URL: https://codereview.chromium.org/1302783003 .
2015-08-19Merge to XFA: CFX_MapByteStringToPtr considered harmful (combo patch).Tom Sepez
New manual edits: two unused members deleted, one adapted. fde_csscache.cpp fde_csscache.h fpdfxfa_doc.h fx_ge_fontmap.cpp (cherry picked from commit 1d9dbd53b205b2b4d9e75a7eeb95e80837917ea3) (cherry picked from commit cb4d0ea68308e3c51a6ba9551b393bb2f639afc4) (cherry picked from commit 9cf44c2ed09a8b2ff243eb6dbb72a8cceae1b5ff) (cherry picked from commit 2a2a6aa7f51352fc481e78f6ad9d41f2738bcc48) (cherry picked from commit ce4ffb8183af3fa2bb5133f0f7370a88e064c516) Original Review URL: https://codereview.chromium.org/1297723002 . R=thestig@chromium.org Review URL: https://codereview.chromium.org/1301793002 .
2015-08-14Merge to XFA: Don't bother checking pointers before delete[] and FX_Free().Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1297713003 . (cherry picked from commit cb62e7657b3a9a04142028a4e6614029a08e894b) Review URL: https://codereview.chromium.org/1287053005 .
2015-08-05Kill off last uses of FX_NEW in XFA.Tom Sepez
It would seem that this never merged completely. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1277583002 .
2015-08-05Merge to XFA: FPDF_Creator can only create file through callbacks.Tom Sepez
(cherry picked from commit 5cd398545141226f082b2f757f23c73303058a83) Original Review URL: https://codereview.chromium.org/1264423003 . TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1275623002 .
2015-08-04XFA: clang-format all pdfium code.Nico Weber
No behavior change. Generated by: find . -name '*.cpp' -o -name '*.h' | \ grep -E -v 'third_party|thirdparties|lpng_v163|tiff_v403' | \ xargs ../../buildtools/mac/clang-format -i Then manually merged https://codereview.chromium.org/1269223002/ See thread "tabs vs spaces" on pdfium@googlegroups.com for discussion. BUG=none
2015-06-19Merge to XFA: Fix -Winconsistent-missing-override warnings.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1187463003. (cherry picked from commit 8bd09648445aef8a9ae38d9f61618bd2013ac3f0) Review URL: https://codereview.chromium.org/1194173002.
2015-06-19Fix -Wnon-virtual-dtor warnings on the XFA branch.Lei Zhang
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1183483003.
2015-06-13Remove trailing whitespaces in core, XFA edition.Lei Zhang
Review URL: https://codereview.chromium.org/1180333002.
2015-06-11Merge to XFA: Kill FXSYS_mem{cpy,cmp,set.move}{32,8}.Tom Sepez
Only manual merge was core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp follwed by scripts. Original Review URL: https://codereview.chromium.org/1179693003. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1179953002.
2015-06-10Merge to XFA: Remove FX_BSTR and FX_WSTR typedefs.Tom Sepez
Nearly automatic merge + re-run script on new files. Original Review URL: https://codereview.chromium.org/1180593004. TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1174303002.
2015-06-10Merge to XFA: Remove typdefs for pointer types in fx_system.h.Tom Sepez
Original Review URL: https://codereview.chromium.org/1171733003 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1178613002.
2015-06-09Merge to XFA: Use stdint.h types throughout PDFium.Tom Sepez
Near-automatic merge, plus re-running scripts to update additional usage. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1172793002
2015-05-28Merge to XFA: Fix ALL the include guards.Tom Sepez
Original Review URL: https://codereview.chromium.org/1160443004 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1162013003
2015-05-18Merge to XFA: Add safe FX_Alloc2D() macroTom Sepez
Original Review URL: https://codereview.chromium.org/1143663004 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1136673005
2015-05-06Merge to XFA: Support arrays in nonstd::unique_ptr<>.Tom Sepez
Original Review URL: https://codereview.chromium.org/1130053003 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1124353002
2015-04-14Merge to XFA: Kill CFX_Object.Tom Sepez
Not just a simple merge, but changes to remove CFX_Object from XFA. Original Review URL: https://codereview.chromium.org/1088733002 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1087053002
2015-04-06Merge to XFA: Fix IWYU in fxcrt headers.Tom Sepez
Note: new includes for XFA Original Review URL: https://codereview.chromium.org/1064433005 R=thestig@chromium.org TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1062843003
2015-02-03Merge to XFA: Replace CFX_SmartPointer cast operator with Get() method.Tom Sepez
Original Review URL: https://codereview.chromium.org/889673003 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/900693003
2015-01-26Merge to XFA: Fix infinite recursion in CPDF_Parser::ParseIndirectObjectAt().Tom Sepez
Orignal Review URL: https://codereview.chromium.org/875263002 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/880753002
2015-01-09merge to XFA: Fix -Wnon-virtual-dtor compiler warnings.Tom Sepez
Original at URL: https://codereview.chromium.org/810883005 Note that the new code in XFA introduces many more of these, to be handled separately. TBR=brucedawson@chromium.org TBR=thestig@chromium.org BUG=https://code.google.com/p/pdfium/issues/detail?id=102 Review URL: https://codereview.chromium.org/842223004
2015-01-05XFA: merge patch from CL 729293003, use FX_ArraySize for safetyBruce Dawson
Note that the merge of this fix to XFA found six bugs. Five were fixed in https://codereview.chromium.org/826573003 and one was fixed in https://codereview.chromium.org/831293002. These bugs are now impossible to compile. Replace manual/error-prone/hard-to-verify arraysize calculations with safe FX_ArraySize macro. pdfium has numerous places where the number of elements in an array is calculated with expressions like: sizeof(cFormats)/sizeof(FX_LPCWSTR) This is suboptimal because it is verbose, it is easy to get wrong, and it cannot be determined through casual inspection whether the code is correct. It will give incorrect results if cFormats is a pointer instead of an array and it will give incorrect results if FX_LPCWSTR is not the type of the array elements. The FX_WSTRC macro in fx_string.h which I fixed was particularly scary because it would silently misbehave if passed a pointer. The FX_ArraySize macro which I have added and started using (taken from arraysize in v8's macros.h) is easier to use and will always give correct results. If passed a pointer it will fail to compile. For this change I only fixed instances of sizeof(FX_LPCWSTR). There appear to be about 150 other places in the pdfium code that could benefit from using FX_ArraySize. TBR=bo_xu@foxitsoftware.com, tsepez@chromium.org Review URL: https://codereview.chromium.org/818193004
2014-11-03Merge XFA to PDFium master at 4dc95e7 on 10/28/2014Bo Xu
2014-07-24CalRGB color correctionBo Xu
BUG=pdfium:19 R=thestig@chromium.org Review URL: https://codereview.chromium.org/403163002
2014-07-23Refactor CFX_BasicArray.chromium/2112chromium/2111chromium/2110chromium/2109chromium/2108chromium/2107chromium/2106chromium/2105chromium/2104Chris Palmer
The |nGrowBy| argument to |SetSize| was always -1, which caused the effective m_nGrowBy value to always be its default value: 0. So it was not needed, and was cluttering up the logic. BUG=384662 Check for integer overflow in CFX_BasicArray. BUG=384662 R=bo_xu@foxitsoftware.com, rsesek@chromium.org Review URL: https://codereview.chromium.org/415803002
2014-07-08Remove custom memory managerBo Xu
BUG= R=palmer@chromium.org Review URL: https://codereview.chromium.org/372473003
2014-07-07Integer overflow in fx_basic.h and fx_memory.hfoxit
BUG=382656 R=palmer@chromium.org Review URL: https://codereview.chromium.org/334573007
2014-05-23Convert all line endings to LF.John Abd-El-Malek
2014-05-17Initial commit.John Abd-El-Malek