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>
diff --git a/BUILD.gn b/BUILD.gn
index ba36cfb..3b48762 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -766,7 +766,6 @@
     "core/fxcrt/cfx_widestring.h",
     "core/fxcrt/fx_basic.h",
     "core/fxcrt/fx_basic_buffer.cpp",
-    "core/fxcrt/fx_basic_coords.cpp",
     "core/fxcrt/fx_basic_gcc.cpp",
     "core/fxcrt/fx_basic_memmgr.cpp",
     "core/fxcrt/fx_basic_utf.cpp",
@@ -774,6 +773,7 @@
     "core/fxcrt/fx_bidi.cpp",
     "core/fxcrt/fx_bidi.h",
     "core/fxcrt/fx_codepage.h",
+    "core/fxcrt/fx_coordinates.cpp",
     "core/fxcrt/fx_coordinates.h",
     "core/fxcrt/fx_extension.cpp",
     "core/fxcrt/fx_extension.h",
diff --git a/core/fxcrt/fx_basic_coords.cpp b/core/fxcrt/fx_coordinates.cpp
similarity index 94%
rename from core/fxcrt/fx_basic_coords.cpp
rename to core/fxcrt/fx_coordinates.cpp
index 9c83ddf..ca40a42 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 @@
     bottom = temp;
   }
 }
+
 void FX_RECT::Intersect(const FX_RECT& src) {
   FX_RECT src_n = src;
   src_n.Normalize();
@@ -51,29 +51,6 @@
   }
 }
 
-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 d2b04f5..cf1c7e5 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,