Commit 9ad2b8e3 authored by Ian Humphrey's avatar Ian Humphrey
Browse files

Fixed compilation errors for OSX and linux related to v007 and c++11 upgrade...

Fixed compilation errors for OSX and linux related to v007 and c++11 upgrade (Calculator, IString, PolygonTools). References #4809.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/Fedora25@8077 41f8697f-d340-4b68-9986-7bafba869bb8
parent 2b8c5c6d
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -278,8 +278,8 @@ namespace Isis {
   */
  double MaximumOperator(double a, double b) {

    if (isnan(a)) return (a);
    if (isnan(b)) return (b);
    if (std::isnan(a)) return (a);
    if (std::isnan(b)) return (b);
    return (a > b) ? a : b;
  }

@@ -292,8 +292,8 @@ namespace Isis {
   * @return The smaller of the two
   */
  double MinimumOperator(double a, double b) {
    if (isnan(a)) return (a);
    if (isnan(b)) return (b);
    if (std::isnan(a)) return (a);
    if (std::isnan(b)) return (b);
    return (a < b) ? a : b;
  }

@@ -968,7 +968,7 @@ namespace Isis {

    if(keepSpecials) {
      for(int i = 0; i < (int)top.size(); i++) {
        if(isnan(top[i])) {
        if(std::isnan(top[i])) {
          top[i] = Isis::Null;
        }
        // Test for +INFINITY
+2 −0
Original line number Diff line number Diff line
@@ -61,6 +61,8 @@ namespace Isis {
   *           min/max operations now ignore special pixels.
   *  @history 2010-04-08 Steven Lambright - Made min, max have proper
   *           implementations and vectors are now QVectors.
   *  @history 2017-08-30 Tyler Wilson and Ian Humphrey - provided std:: namespace for isnan
   *                          to fix ambiguity error when using c++11. References #4809.
   *
   */
  class Calculator {
+1 −1
Original line number Diff line number Diff line
@@ -297,7 +297,7 @@ namespace Isis {
    if(doubleToConvert == 0.0) {
      result = "0.0";
    }
    else if(isnan(doubleToConvert)) {
    else if (std::isnan(doubleToConvert) ) {
      result = "nan";
    }

+2 −0
Original line number Diff line number Diff line
@@ -175,6 +175,8 @@ namespace Isis {
   *                          ...) methods. All public API's should use/expect QString (not IString,
   *                          not std::string). This affects virtually every class in Isis. 
   *                          Fixes #1312.
   *  @history 2017-08-30 Tyler Wilson and Ian Humphrey - Added std:: namespace to isnan to avoid
   *                          ambiguity error when compiling for c++11. References #4809.
   */
  class IString : public std::string {
    public:
+3 −2
Original line number Diff line number Diff line
@@ -1024,8 +1024,9 @@ namespace Isis {
    unsigned int minPrecision = 13;
    while(failed) {
      try {
        std::unique_ptr< geos::geom::Geometry > resultAuto =
          BinaryOp(geomFirst, geomSecond, geos::operation::overlay::overlayOp(code));
        // C++11: the geos BinaryOp returns an auto_ptr, we use release() to create a unique_ptr.
        std::unique_ptr< geos::geom::Geometry > resultAuto(
          BinaryOp(geomFirst, geomSecond, geos::operation::overlay::overlayOp(code)).release());
        failed = false;
        result = resultAuto->clone();
      }
Loading