summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-04-25 10:29:58 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-04-25 17:44:29 +0000
commit6302288dec6111120749754ba8ec2d249b63404b (patch)
treeea760932b163690fe5274716735b5c5d538615b2 /core
parentd1e01de5f0776700cd52f06569f4fc0bd34e74d6 (diff)
downloadpdfium-6302288dec6111120749754ba8ec2d249b63404b.tar.xz
Rename core/fxcrt/fx_basic_coords.cpp to fx_coordinates.cpp
Its contents are delcared in fx_coordinates.h Remove unused GetIntersection(). Move FXSYS_round to fx_system.cpp. Change-Id: I70749581d1321dd919e35fa2daab9591098f68e9 Reviewed-on: https://pdfium-review.googlesource.com/4479 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core')
-rw-r--r--core/fxcrt/fx_coordinates.cpp (renamed from core/fxcrt/fx_basic_coords.cpp)27
-rw-r--r--core/fxcrt/fx_system.cpp10
2 files changed, 12 insertions, 25 deletions
diff --git a/core/fxcrt/fx_basic_coords.cpp b/core/fxcrt/fx_coordinates.cpp
index 9c83ddfbd0..ca40a42227 100644
--- a/core/fxcrt/fx_basic_coords.cpp
+++ b/core/fxcrt/fx_coordinates.cpp
@@ -4,11 +4,10 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include <limits.h>
+#include "core/fxcrt/fx_coordinates.h"
#include <algorithm>
-#include "core/fxcrt/fx_coordinates.h"
#include "core/fxcrt/fx_extension.h"
namespace {
@@ -38,6 +37,7 @@ void FX_RECT::Normalize() {
bottom = temp;
}
}
+
void FX_RECT::Intersect(const FX_RECT& src) {
FX_RECT src_n = src;
src_n.Normalize();
@@ -51,29 +51,6 @@ void FX_RECT::Intersect(const FX_RECT& src) {
}
}
-bool GetIntersection(float low1,
- float high1,
- float low2,
- float high2,
- float& interlow,
- float& interhigh) {
- if (low1 >= high2 || low2 >= high1) {
- return false;
- }
- interlow = low1 > low2 ? low1 : low2;
- interhigh = high1 > high2 ? high2 : high1;
- return true;
-}
-extern "C" int FXSYS_round(float d) {
- if (d < (float)INT_MIN) {
- return INT_MIN;
- }
- if (d > (float)INT_MAX) {
- return INT_MAX;
- }
-
- return (int)round(d);
-}
CFX_FloatRect::CFX_FloatRect(const FX_RECT& rect) {
left = (float)(rect.left);
right = (float)(rect.right);
diff --git a/core/fxcrt/fx_system.cpp b/core/fxcrt/fx_system.cpp
index d2b04f502a..cf1c7e5920 100644
--- a/core/fxcrt/fx_system.cpp
+++ b/core/fxcrt/fx_system.cpp
@@ -6,6 +6,16 @@
#include "core/fxcrt/fx_system.h"
+#include <limits>
+
+extern "C" int FXSYS_round(float d) {
+ if (d < static_cast<float>(std::numeric_limits<int>::min()))
+ return std::numeric_limits<int>::min();
+ if (d > static_cast<float>(std::numeric_limits<int>::max()))
+ return std::numeric_limits<int>::max();
+ return static_cast<int>(round(d));
+}
+
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
size_t FXSYS_wcsftime(wchar_t* strDest,