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

Unified Diff: fpdfsdk/fpdfview.cpp

Issue 2484953003: Force compiler to deduce src type for checked_cast<dst, src>. (Closed)
Patch Set: Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfdoc/cpdf_formfield.cpp ('k') | third_party/base/stl_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fpdfview.cpp
diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp
index 9142dc78c9352f91cfc8f41c8ae6ddb84f43d247..334c14cd45f9d1ed834d80b72bc3595c0de775cd 100644
--- a/fpdfsdk/fpdfview.cpp
+++ b/fpdfsdk/fpdfview.cpp
@@ -192,8 +192,7 @@ bool CPDF_CustomAccess::ReadBlock(void* buffer,
if (offset < 0)
return false;
- FX_SAFE_FILESIZE newPos =
- pdfium::base::checked_cast<FX_FILESIZE, size_t>(size);
+ FX_SAFE_FILESIZE newPos = pdfium::base::checked_cast<FX_FILESIZE>(size);
newPos += offset;
if (!newPos.IsValid() ||
newPos.ValueOrDie() > static_cast<FX_FILESIZE>(m_FileAccess.m_FileLen)) {
@@ -388,8 +387,7 @@ class CMemFile final : public IFX_SeekableReadStream {
if (offset < 0) {
return false;
}
- FX_SAFE_FILESIZE newPos =
- pdfium::base::checked_cast<FX_FILESIZE, size_t>(size);
+ FX_SAFE_FILESIZE newPos = pdfium::base::checked_cast<FX_FILESIZE>(size);
newPos += offset;
if (!newPos.IsValid() || newPos.ValueOrDie() > m_size) {
return false;
« no previous file with comments | « core/fpdfdoc/cpdf_formfield.cpp ('k') | third_party/base/stl_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698