From 515c26bfb762aa0c9fcc9d2443e6ec9e0dc93f9f Mon Sep 17 00:00:00 2001 From: Chris Palmer Date: Thu, 31 Jul 2014 12:08:56 -0700 Subject: Correct the names of the FX_SAFE_* typedefs. R=jun_fang@foxitsoftware.com Review URL: https://codereview.chromium.org/417263008 --- core/include/fxcrt/fx_system.h | 6 +++--- core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp | 2 +- core/src/fxcrt/extension.h | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/core/include/fxcrt/fx_system.h b/core/include/fxcrt/fx_system.h index 391380304c..6d659e2c10 100644 --- a/core/include/fxcrt/fx_system.h +++ b/core/include/fxcrt/fx_system.h @@ -277,9 +277,9 @@ int FXSYS_round(FX_FLOAT f); }; #include "../../../third_party/numerics/safe_math.h" -typedef base::CheckedNumeric FX_SAFE_DWORD; -typedef base::CheckedNumeric FX_SAFE_INT; -typedef base::CheckedNumeric FX_SAFE_SIZET; +typedef base::CheckedNumeric FX_SAFE_DWORD; +typedef base::CheckedNumeric FX_SAFE_INT32; +typedef base::CheckedNumeric FX_SAFE_SIZE_T; #if defined(__clang__) || _MSC_VER >= 1700 #define FX_FINAL final #elif defined(__GNUC__) && __cplusplus >= 201103 && \ diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp index 5279ab9ebb..7e80f75269 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp @@ -1204,7 +1204,7 @@ void CPDF_DIBSource::DownSampleScanline(int line, FX_LPBYTE dest_scan, int dest_ return; } - FX_SAFE_INT max_src_x = clip_left; + FX_SAFE_INT32 max_src_x = clip_left; max_src_x += clip_width - 1; max_src_x *= src_width; max_src_x /= dest_width; diff --git a/core/src/fxcrt/extension.h b/core/src/fxcrt/extension.h index d04d1da550..6221d14fc7 100644 --- a/core/src/fxcrt/extension.h +++ b/core/src/fxcrt/extension.h @@ -230,7 +230,7 @@ public: offset = safeOffset.ValueOrDie(); - FX_SAFE_SIZET newPos = size; + FX_SAFE_SIZE_T newPos = size; newPos += offset; if (!newPos.IsValid() || newPos.ValueOrDefault(0) == 0 || newPos.ValueOrDie() >= m_nCurSize) { return FALSE; @@ -282,7 +282,7 @@ public: offset += (FX_FILESIZE)m_nOffset; } if (m_dwFlags & FX_MEMSTREAM_Consecutive) { - FX_SAFE_SIZET newPos = size; + FX_SAFE_SIZE_T newPos = size; newPos += offset; if (!newPos.IsValid()) return FALSE; @@ -308,7 +308,7 @@ public: return TRUE; } - FX_SAFE_SIZET newPos = size; + FX_SAFE_SIZE_T newPos = size; newPos += offset; if (!newPos.IsValid()) { return FALSE; -- cgit v1.2.3