Skip to content

Commit

Permalink
Fix some warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
wcjohns committed Oct 12, 2023
1 parent 2e674fd commit c6bfb8c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/OneOverR2Calc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,9 @@ void OneOverR2Calc::handleAppUrl( std::string query_str )
{
try
{
std::stod(value);
const double test_val = std::stod(value);
if( IsInf(test_val) || IsNan(test_val) )
throw runtime_error( "NaN or Inf" );
}catch( std::exception & )
{
throw runtime_error( "1/r2 Calc.: invalid '" + name + "' value '" + value + "' in URI." );
Expand Down
2 changes: 1 addition & 1 deletion src/RelActManualGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,7 @@ void RelActManualGui::calculateSolution()
if( (fabs(peak.m_energy - p->gammaParticleEnergy()) > (match_tol_sigma*(peak.m_fwhm/2.35482)))
&& (match_tol_sigma > 0.0) )
{
energy_cal_match_warning_energies.emplace( peak.m_energy, p->gammaParticleEnergy() );
energy_cal_match_warning_energies.emplace( static_cast<float>(peak.m_energy), p->gammaParticleEnergy() );
}

peak.m_energy = p->gammaParticleEnergy();
Expand Down
2 changes: 1 addition & 1 deletion src/SearchMode3DDataModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ int SearchMode3DDataModel::maxNumEnergyChannels() const { return m_maxNumChannel
std::pair<float,float> SearchMode3DDataModel::minMaxCounts( const float time_min, const float time_max,
const float e_min, const float e_max ) const
{
std::pair<float,float> answer( 0, 1.0 );
std::pair<float,float> answer( 0.0f, 1.0f );

auto timeStart = lower_bound( begin(m_times), end(m_times), time_min );
auto timeEnd = upper_bound( begin(m_times), end(m_times), time_max );
Expand Down

0 comments on commit c6bfb8c

Please sign in to comment.