Skip to content

Commit

Permalink
More warning fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed Apr 30, 2024
1 parent 02f0e13 commit 6efade4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion apps/argparse/argparse.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ class Argument {
}
catch (...)
{
var = std::any_cast<int>(m_default_value);
var = static_cast<T>(std::any_cast<int>(m_default_value));
}
}
action([&var](const auto &s) {
Expand Down
12 changes: 3 additions & 9 deletions apps/gdal_viewshed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint8_t>::max())
// set to zero. Values less than zero are sentinel as NULL nodata.
if (o.outputMode == Viewshed::OutputMode::Normal &&
o.nodataVal > std::numeric_limits<uint8_t>::max())
o.nodataVal = 0;

if (o.outOfRangeVal < 0 || o.outOfRangeVal > std::numeric_limits<uint8_t>::max())
o.outOfRangeVal = 0;
}

/* -------------------------------------------------------------------- */
/* Open source raster file. */
/* -------------------------------------------------------------------- */
Expand Down

0 comments on commit 6efade4

Please sign in to comment.