Age | Commit message (Collapse) | Author |
|
Since casts to FX_LPCWSTR have been shown to hide bugs I tried removing
more of them, targeting those places where a cast was used to force a
conversion from CFX_WideString to FX_LPCWSTR, replacing these casts with
calls to the newly added .c_str() function. This revealed two places
where the cast was hiding a bug -- where ->c_str() was required instead!
This removes ~33 FX_LPCWSTR casts and there are ~31 left, many of which
will go away in some future change.
Also includes this change:
Removing unnecessary casts from wchar_t* to wchar_t*, by various names.
Original patch from Bruce Dawson(brucedawson@chromium.org)
R=bo_xu@foxitsoftware.com, tsepez@chromium.org
Review URL: https://codereview.chromium.org/733693003
|
|
As of the 2013 version VC++ still doesn't support the 'z' size specifier. This makes portable printing of size_t types frustrating. The simplest general solution is to use %u and cast to unsigned. If there was any possibility of the numbers getting larger than 32-bit then we would need better alternatives, but there is not.
This was found through code inspection, through /analyze, and through pdfium_test print this non-helpful message:
Loaded, parsed and rendered zu pages.
Skipped zu bad pages.
I can confirm that the fix works on Windows and it should work identically on mac. This is a follow-on to change 02e6ca4c4f.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/738433003
|
|
Remove casts that merely cast from wchar_t* to wchar_t*. Sometimes the
types or casts are FX_LPCWSTR but the idea is the same. Excess casts
can (and have) hidden bugs so removing these may prevent future problems.
Original patch from Bruce Dawson(brucedawson@chromium.org)
R=bo_xu@foxitsoftware.com, tsepez@chromium.org
Review URL: https://codereview.chromium.org/730993002
|
|
Should there be cases where this fails to compile, it indicates a mistake,
either an incorrectly declared overrriden virtual method, or a method that
should be declared non-virtual.
The only issues were with CPDF_CustomAccess::GetBlock(), CPDF_CustomAccess::GetByte(),
and CPDF_CustomAccess::GetFullPath(). These don't appear to be used anywhere,
and are removed. Two members are removed that are no longer needed once those
methods are removed.
R=jam@chromium.org, jun_fang@foxitsoftware.com
Review URL: https://codereview.chromium.org/454983003
|
|
BUG=382988
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/433293002
|
|
R=jun_fang@foxitsoftware.com
Review URL: https://codereview.chromium.org/417263008
|
|
fpdfview.cpp
BUG=397258
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/419063002
|
|
BUG=pdfium:19
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/403163002
|
|
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
|
|
BUG=pdfium:26
TBR=bo_xu@foxitsoftware.com
Review URL: https://codereview.chromium.org/418463002
|
|
Calling `delete` on an object of a type that has virtual functions but
not a virtual destructor is questionable: Since the object has virtual functions,
it likely has subclasses, so if it's deleted through the base pointer and the
destructor isn't virtual, the subclass destructor won't be called.
In most cases, the classes getting deleted can just be marked final to tell
the compiler that it can't possibly have subclasses (this also enables the
compiler to generate better code).
Two classes didn't have any sub- or superclasses but virtual functions -
this doesn't make sense, so make all methods of these classes non-virtual.
(Also delete an unused function on one of the two classes.)
In one case, a class actually did have a subclass that needs to be deleted
virtually, so mark one destructor as virtual.
BUG=none
R=bo_xu@foxitsoftware.com
Review URL: https://codereview.chromium.org/370853002
|
|
BUG=381521
R=palmer@chromium.org
Review URL: https://codereview.chromium.org/383563002
|
|
This contains fixes for the following sorts of issues:
* Nonstandard extension: unnamed struct/union
This also changes the signature of FPDF_FillRect() to enable the cleanest
possible changes in https://codereview.chromium.org/372273005 .
BUG=81439
TEST=none
Original patch by Peter Kasting <pkasting@chromium.org>
Original code review: https://codereview.chromium.org/376003003/
R=pkasting@chromium.org
Review URL: https://codereview.chromium.org/377353002
|
|
Fixes for re-enabling more MSVC level 4 warnings: pdfium/ edition
BUG=81439
TBR=pkasting@chromium.org
Review URL: https://codereview.chromium.org/376043003
|
|
This contains fixes for the following sorts of issues:
* Nonstandard extension: unnamed struct/union
This also changes the signature of FPDF_FillRect() to enable the cleanest
possible changes in https://codereview.chromium.org/372273005 .
BUG=81439
TEST=none
Original patch by Peter Kasting <pkasting@chromium.org>
Original code review: https://codereview.chromium.org/376003003/
R=pkasting@chromium.org
Review URL: https://codereview.chromium.org/372383004
|
|
BUG=
R=palmer@chromium.org
Review URL: https://codereview.chromium.org/372473003
|
|
BUG=382601
R=jun_fang@foxitsoftware.com
Review URL: https://codereview.chromium.org/336003004
|
|
BUG=382656
R=palmer@chromium.org
Review URL: https://codereview.chromium.org/334573007
|
|
wrong characters representation, and addjust some code indent
BUG=
R=jam@chromium.org
Review URL: https://codereview.chromium.org/294353002
|
|
|
|
|