Skip to content

Commit fc49421

Browse files
author
Arthur Glowacki
committed
Added [[maybe_unused]] for compiler warnings
1 parent 49746b3 commit fc49421

13 files changed

Lines changed: 20 additions & 21 deletions

File tree

src/data_struct/element_info.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,6 @@ template<typename T_real>
335335
T_real Element_Info<T_real>::get_f2(T_real energy)
336336
{
337337
T_real f2 = 0.0;
338-
T_real molecules_per_cc = 0.0;
339338

340339
size_t low_e_idx = 0, high_e_idx = 0;
341340
bool found_indexes = false;

src/data_struct/fit_element_map.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ void Fit_Element_Map<T_real>::set_as_pileup(std::string name, Element_Info<T_rea
362362
//-----------------------------------------------------------------------------
363363

364364
template<typename T_real>
365-
bool Fit_Element_Map<T_real>::check_binding_energy(T_real incident_energy, int energy_ratio_idx) const
365+
bool Fit_Element_Map<T_real>::check_binding_energy(T_real incident_energy, size_t energy_ratio_idx) const
366366
{
367367
if (_element_info != nullptr)
368368
{

src/data_struct/fit_element_map.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ class DLL_EXPORT Fit_Element_Map
193193

194194
std::unordered_map<std::string, T_real> generate_roi_centers_per_shell();
195195

196-
bool check_binding_energy(T_real incident_energy, int energy_ratio_idx) const;
196+
bool check_binding_energy(T_real incident_energy, size_t energy_ratio_idx) const;
197197
protected:
198198

199199
void generate_energy_ratio(T_real energy, T_real ratio, Element_Param_Type et, const Element_Info<T_real> * const detector_element);

src/fitting/models/gaussian_model.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ const Spectra<T_real> Gaussian_Model<T_real>::model_spectrum_element(const Fit_P
470470
if (false == std::isfinite(pre_faktor))
471471
{
472472
logE << "Prefactor = " << pre_faktor << " for "<<element_to_fit->full_name()<<" . Log10 Value = "<< fitp->value(element_to_fit->full_name()) <<"\n";
473-
spectra_model = (ArrayTr<T_real>)(spectra_model).unaryExpr([](T_real v) { return std::numeric_limits<T_real>::quiet_NaN(); });
473+
spectra_model = (ArrayTr<T_real>)(spectra_model).unaryExpr([]( [[maybe_unused]] T_real v) { return std::numeric_limits<T_real>::quiet_NaN(); });
474474
return spectra_model;
475475
}
476476

@@ -655,7 +655,7 @@ const ArrayTr<T_real> Gaussian_Model<T_real>::elastic_peak(const Fit_Parameters<
655655
if(false == std::isfinite(sigma))
656656
{
657657
logE << "sigma = " << sigma << "\n";
658-
counts = counts.unaryExpr([](T_real v) { return std::numeric_limits<T_real>::quiet_NaN(); });
658+
counts = counts.unaryExpr([]( [[maybe_unused]] T_real v) { return std::numeric_limits<T_real>::quiet_NaN(); });
659659
return counts;
660660
}
661661
ArrayTr<T_real>delta_energy = ev - fitp->value(STR_COHERENT_SCT_ENERGY);
@@ -682,7 +682,7 @@ const ArrayTr<T_real> Gaussian_Model<T_real>::compton_peak(const Fit_Parameters<
682682
if(false == std::isfinite(sigma))
683683
{
684684
logE << "sigma = " << sigma << "\n";
685-
counts = (ArrayTr<T_real>)(counts).unaryExpr([](T_real v) { return std::numeric_limits<T_real>::quiet_NaN(); });
685+
counts = (ArrayTr<T_real>)(counts).unaryExpr([]( [[maybe_unused]] T_real v) { return std::numeric_limits<T_real>::quiet_NaN(); });
686686
return counts;
687687
}
688688

src/fitting/optimizers/nlopt_optimizer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ double residuals_nlopt(const std::vector<double> &x, [[maybe_unused]] std::vecto
103103
{
104104
(*ud->status_callback)(ud->cur_itr, ud->total_itr);
105105
}
106-
catch (int e)
106+
catch ([[maybe_unused]] int e)
107107
{
108108
logI << "Cancel fitting" << std::endl;
109109
return -1;

src/fitting/routines/param_optimized_fit_routine.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,8 @@ OPTIMIZER_OUTCOME Param_Optimized_Fit_Routine<T_real>::fit_spectra_parameters(co
286286
// ----------------------------------------------------------------------------
287287

288288
template<typename T_real>
289-
void Param_Optimized_Fit_Routine<T_real>::initialize(models::Base_Model<T_real>* const model,
290-
const Fit_Element_Map_Dict<T_real>* const elements_to_fit,
289+
void Param_Optimized_Fit_Routine<T_real>::initialize([[maybe_unused]] models::Base_Model<T_real>* const model,
290+
[[maybe_unused]] const Fit_Element_Map_Dict<T_real>* const elements_to_fit,
291291
const struct Range energy_range,
292292
ArrayTr<T_real>* custom_background)
293293
{

src/quantification/models/quantification_model.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ void Quantification_Model<T_real>::init_element_quant(Element_Quant<T_real>& ele
8888
T_real detector_chip_thickness,
8989
T_real beryllium_window_thickness,
9090
T_real germanium_dead_layer,
91-
size_t z_number)
91+
int z_number)
9292
{
9393
//incident_E(incident_energy) == COHERENT_SCT_ENERGY: Maps_fit_params
9494
//fit_t_be == BE_WINDOW_THICKNESS * 1000

src/quantification/models/quantification_model.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class DLL_EXPORT Quantification_Model
9090
T_real detector_chip_thickness,
9191
T_real beryllium_window_thickness,
9292
T_real germanium_dead_layer,
93-
size_t z_number);
93+
int z_number);
9494

9595
T_real transmission(T_real thickness, T_real beta, T_real llambda) const;
9696

src/support/eigen-git-mirror

Submodule eigen-git-mirror updated from 6dbbf0a to 454f89a

src/support/pybind11

Submodule pybind11 updated 297 files

0 commit comments

Comments
 (0)