summaryrefslogtreecommitdiff
path: root/core/fxcrt/fx_system.h
AgeCommit message (Collapse)Author
2017-08-31Cleanup fx_basic_* filesDan Sinclair
Remove dead code, move code to namespaces where possible, cleanup some single use items. Change-Id: Ia734477ceb2105a1ed272463bd8220f1205a7ce9 Reviewed-on: https://pdfium-review.googlesource.com/12732 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-08-23Convert string Find methods to return an OptionalRyan Harrison
The Find and ReverseFind methods for WideString, WideStringC, ByteString, and ByteStringC have been converted from returning a raw FX_STRSIZE, to returning Optional<FX_STRSIZE>, so that success/failure can be indicated without using FX_STRNPOS. This allows for removing FX_STRNPOS and by association makes the conversion of FX_STRSIZE to size_t easier, since it forces checking the return value of Find to be explictly done as well as taking the error value out of the range of FX_STRSIZE. New Contains methods have been added for cases where the success or failure is all the call site to Find cared about, and the actual position was ignored. BUG=pdfium:828 Change-Id: Id827e508c8660affa68cc08a13d96121369364b7 Reviewed-on: https://pdfium-review.googlesource.com/11350 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-08-04Enforce recent VC++ version (2015 or later).Tom Sepez
Remove ifdef'd code for versions we know will no longer work. Change-Id: I036c80168f846df1b98e9df4972f84655e8418fb Reviewed-on: https://pdfium-review.googlesource.com/10051 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-08-03kill some stray __native_client__ definesTom Sepez
There isn't any work to NaCl PDFium at the moment, and it would take a lot more than these few changes. Change-Id: I6c4bf5f38bbfb9cf4f5a5688128c7720c38a8ce4 Reviewed-on: https://pdfium-review.googlesource.com/10050 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-08-01Replace raw value for constant error value in string operationsRyan Harrison
Currently Find() and other methods that return a FX_STRSIZE return -1 to indicate error/failure. This means that there is a lot of magic numbers and magic checks floating around. The standard library for similar operations uses a npos constant. This CL implements FX_STRNPOS, and replaces usages of magic number checking. It also does some type cleanup along the way where it was obvious that FX_STRSIZE should be being used. Removing the magic numbers should make eventually changing FX_STRSIZE to be unsigned easier in the future. BUG=pdfium:828 Change-Id: I67e481e44cf2f75a1698afa8fbee4f375a74c490 Reviewed-on: https://pdfium-review.googlesource.com/9651 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-05-04Remove FXSYS_wfopen(), it is totally unused.Tom Sepez
Change-Id: I612d9eaa47f6e4b023a49ab9120372de3d73cdc7 Reviewed-on: https://pdfium-review.googlesource.com/4831 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-04-24Add FXSYS_wcsftime() to avoid termination on win.Tom Sepez
Bug: 712725 Change-Id: I3384385176410964a87b12c2587f68247ea80cc9 Reviewed-on: https://pdfium-review.googlesource.com/4454 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-04-03Drop FXSYS_ from util methodsDan Sinclair
This Cl drops the FXSYS_ from utility methods which are the same on all platforms. Bug: pdfium:694 Change-Id: I0859b60c5ba7af68c929a519dd76f48c27a6c896 Reviewed-on: https://pdfium-review.googlesource.com/3614 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-04-03Drop FXSYS_ from mem methodsDan Sinclair
This Cl drops the FXSYS_ from mem methods which are the same on all platforms. Bug: pdfium:694 Change-Id: I9d5ae905997dbaaec5aa0b2ae4c07358ed9c6236 Reviewed-on: https://pdfium-review.googlesource.com/3613 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-04-03Drop FXSYS_ from wide string methodsDan Sinclair
This Cl drops the FXSYS_ from wide string methods which are the same on all platforms. Bug: pdfium:694 Change-Id: I46a7af5913e7897f7c4ba712a76540c12105818f Reviewed-on: https://pdfium-review.googlesource.com/3611 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-04-03Drop FXSYS_ from file methodsDan Sinclair
This Cl drops the FXSYS_ from file methods which are the same on all platforms. Bug: pdfium:694 Change-Id: I095c64fed69bf70e00a2594fa94a1fdc71a7060e Reviewed-on: https://pdfium-review.googlesource.com/3610 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-04-03Drop FXSYS_ from math methodsDan Sinclair
This Cl drops the FXSYS_ from math methods which are the same on all platforms. Bug: pdfium:694 Change-Id: I85c9ff841fd9095b1434f67319847ba0cd9df7ac Reviewed-on: https://pdfium-review.googlesource.com/3598 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-04-03Drop FXSYS_ from string methodsDan Sinclair
This Cl drops the FXSYS_ from string methods which are the same on all platforms. Bug: pdfium:694 Change-Id: I1698aafd84f40474997549ae91ce35603377e303 Reviewed-on: https://pdfium-review.googlesource.com/3597 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-04-03Minor cleanupsDan Sinclair
Cleanup some unused methods, add some missing #ifdef comments. Bug: pdfium:694 Change-Id: I019a03f7a55d1d4a23300ff822ae30dde4406c3d Reviewed-on: https://pdfium-review.googlesource.com/3596 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-31Move FX_FILESIZE to fx_system.hTom Sepez
Remove dependency on fx_stream.h from fx_safe_types.h. We're going to hit cylces in include file dependencies otherwise when the partition allocator work is landed. Change-Id: I35bf78038a08599559b959f1403aa0f8fbf87739 Reviewed-on: https://pdfium-review.googlesource.com/3552 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-03-30vswprintf() part 1: move code, create helper function.Tom Sepez
Change-Id: Iec9c3bb850b1654c67ac3081e557842f1eafd604 Reviewed-on: https://pdfium-review.googlesource.com/3431 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2017-03-15Replace FX_POSITION in GFGAS_FontMgr with boolDan Sinclair
Change-Id: Iddd99312aee6447c05be5633eead023a004e65e1 Reviewed-on: https://pdfium-review.googlesource.com/3034 Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-14Replace FX_FLOAT with underlying float type.Dan Sinclair
Change-Id: I158b7d80b0ec28b742a9f2d5a96f3dde7fb3ab56 Reviewed-on: https://pdfium-review.googlesource.com/3031 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-03-14Replace FX_DOUBLE with underlying double type.Dan Sinclair
Change-Id: Ife4a46157ec1044b24965f7d282858f8261031b1 Reviewed-on: https://pdfium-review.googlesource.com/3030 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-14Replace FX_CHAR and FX_WCHAR with underlying types.Dan Sinclair
Change-Id: I96e0a20d66b9184d22f64d8e4ce0dadd5a78c1e8 Reviewed-on: https://pdfium-review.googlesource.com/2967 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2016-11-08Define IsFloatEqual macro properly.thestig
BUG=chromium:663253 Review-Url: https://codereview.chromium.org/2482373002
2016-11-03Remove FX_BOOL entirely.tsepez
FX_BOOL was a type just like a regular C++ bool, except that it took 4x the space and frequently was used to hold values besides true or false. Review-Url: https://codereview.chromium.org/2471353002
2016-10-31Re-land "Change FX_BOOL definition from int to bool."chromium/2906tsepez
This reverts commit 747dcf7 Review-Url: https://codereview.chromium.org/2468723002
2016-10-29Revert of Change FX_BOOL definition from int to bool. (patchset #15 ↵dsinclair
id:250001 of https://codereview.chromium.org/2453473003/ ) Reason for revert: Potentially blocking the roll, speculative revert. See: https://codereview.chromium.org/2464643002/ Original issue's description: > Change FX_BOOL definition from int to bool. > > If this CL sticks, we can then remove it entirely. > > Committed: https://pdfium.googlesource.com/pdfium/+/dd65283408d9137e2f142e78dff2a1826baab5fd TBR=thestig@chromium.org,tsepez@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review-Url: https://codereview.chromium.org/2461893002
2016-10-28Change FX_BOOL definition from int to bool.tsepez
If this CL sticks, we can then remove it entirely. Review-Url: https://codereview.chromium.org/2453473003
2016-09-29Move core/fxcrt/include to core/fxcrtdsinclair
BUG=pdfium:611 Review-Url: https://codereview.chromium.org/2382723003