diff --git a/apps/argparse/argparse.hpp b/apps/argparse/argparse.hpp index d4d2edda32a7..65d96156968c 100644 --- a/apps/argparse/argparse.hpp +++ b/apps/argparse/argparse.hpp @@ -707,7 +707,7 @@ class Argument { } catch (...) { - var = std::any_cast(m_default_value); + var = static_cast(std::any_cast(m_default_value)); } } action([&var](const auto &s) { diff --git a/apps/gdal_viewshed.cpp b/apps/gdal_viewshed.cpp index da632382d250..942de2a689f8 100644 --- a/apps/gdal_viewshed.cpp +++ b/apps/gdal_viewshed.cpp @@ -201,17 +201,11 @@ MAIN_START(argc, argv) } // For double values that are out of range for byte raster output, - // set to zero. - if (o.outputMode == Viewshed::OutputMode::Normal) - { - // Values less than zero are sentinel to not have nodata. - if (o.nodataVal > std::numeric_limits::max()) + // set to zero. Values less than zero are sentinel as NULL nodata. + if (o.outputMode == Viewshed::OutputMode::Normal && + o.nodataVal > std::numeric_limits::max()) o.nodataVal = 0; - if (o.outOfRangeVal < 0 || o.outOfRangeVal > std::numeric_limits::max()) - o.outOfRangeVal = 0; - } - /* -------------------------------------------------------------------- */ /* Open source raster file. */ /* -------------------------------------------------------------------- */