Commit bd8f50f0 authored by Gauthier Quesnel's avatar Gauthier Quesnel
Browse files

core: fix warnings

parent ae297e6f
......@@ -709,6 +709,8 @@ struct message
return static_cast<double>(to_real_32(i));
case value_type::real_64:
return static_cast<double>(to_real_64(i));
default:
return 0.0;
}
return 0.0;
......@@ -4390,8 +4392,9 @@ struct simulation
{
return dispatch(
mdl.type,
[dyn_id = mdl.id, port, index]<typename DynamicsM>(
DynamicsM& dyn_models) -> status {
[ dyn_id = mdl.id, port,
index ]<typename DynamicsM>(DynamicsM & dyn_models)
->status {
using Dynamics = typename DynamicsM::value_type;
if constexpr (is_detected_v<has_output_port_t, Dynamics>) {
......@@ -4415,8 +4418,8 @@ struct simulation
{
dispatch(
mdl.type,
[this, &f, dyn_id = mdl.id]<typename DynamicsM>(
DynamicsM& dyn_models) {
[ this, &f, dyn_id = mdl.id ]<typename DynamicsM>(DynamicsM &
dyn_models) {
using Dynamics = typename DynamicsM::value_type;
if constexpr (is_detected_v<has_input_port_t, Dynamics>) {
......@@ -4435,8 +4438,8 @@ struct simulation
{
dispatch(
mdl.type,
[this, &f, dyn_id = mdl.id]<typename DynamicsM>(
DynamicsM& dyn_models) {
[ this, &f, dyn_id = mdl.id ]<typename DynamicsM>(DynamicsM &
dyn_models) {
using Dynamics = typename DynamicsM::value_type;
if constexpr (is_detected_v<has_output_port_t, Dynamics>) {
......@@ -4457,8 +4460,9 @@ struct simulation
{
return dispatch(
mdl.type,
[dyn_id = mdl.id, port, index]<typename DynamicsM>(
DynamicsM& dyn_models) -> status {
[ dyn_id = mdl.id, port,
index ]<typename DynamicsM>(DynamicsM & dyn_models)
->status {
using Dynamics = typename DynamicsM::value_type;
if constexpr (is_detected_v<has_input_port_t, Dynamics>) {
......@@ -4483,15 +4487,17 @@ struct simulation
{
return dispatch(
mdl.type,
[dyn_id = mdl.id, index, port]<typename DynamicsM>(
DynamicsM& dyn_models) -> status {
[ dyn_id = mdl.id, index,
port ]<typename DynamicsM>(DynamicsM & dyn_models)
->status {
using Dynamics = typename DynamicsM::value_type;
if constexpr (is_detected_v<has_output_port_t, Dynamics>) {
auto* dyn = dyn_models.try_to_get(dyn_id);
irt_return_if_fail(dyn, status::dynamics_unknown_id);
irt_return_if_fail(0 <= index && static_cast<size_t>(index) <
irt_return_if_fail(0 <= index &&
static_cast<size_t>(index) <
std::size(dyn->y),
status::dynamics_unknown_port_id);
......@@ -4509,15 +4515,17 @@ struct simulation
{
return dispatch(
mdl.type,
[dyn_id = mdl.id, index, port]<typename DynamicsM>(
DynamicsM& dyn_models) -> status {
[ dyn_id = mdl.id, index,
port ]<typename DynamicsM>(DynamicsM & dyn_models)
->status {
using Dynamics = typename DynamicsM::value_type;
if constexpr (is_detected_v<has_input_port_t, Dynamics>) {
auto* dyn = dyn_models.try_to_get(dyn_id);
irt_return_if_fail(dyn, status::dynamics_unknown_id);
irt_return_if_fail(0 <= index && static_cast<size_t>(index) <
irt_return_if_fail(0 <= index &&
static_cast<size_t>(index) <
std::size(dyn->x),
status::dynamics_unknown_port_id);
......@@ -4621,8 +4629,9 @@ public:
auto ret = dispatch(
mdl->type,
[this, &mdl, copy]<typename DynamicsM>(
DynamicsM& dynamics_models) -> status {
[ this, &mdl,
copy ]<typename DynamicsM>(DynamicsM & dynamics_models)
->status {
using Dynamics = typename DynamicsM::value_type;
irt_return_if_fail(dynamics_models.can_alloc(1),
......@@ -4662,8 +4671,8 @@ public:
auto ret = dispatch(
mdl->type,
[this, model_it, first, last, out]<typename DynamicsM>(
DynamicsM& dynamics_models) {
[ this, model_it, first, last,
out ]<typename DynamicsM>(DynamicsM & dynamics_models) {
using Dynamics = typename DynamicsM::value_type;
auto* mdl_src = this->models.try_to_get(*(first + model_it));
......@@ -5154,7 +5163,8 @@ public:
{
return dispatch(
mdl.type,
[this, &mdl, t]<typename DynamicsModels>(DynamicsModels& dyn_models) {
[ this, &mdl,
t ]<typename DynamicsModels>(DynamicsModels & dyn_models) {
return this->make_initialize(mdl, dyn_models.get(mdl.id), t);
});
}
......@@ -5220,11 +5230,11 @@ public:
time t,
flat_list<output_port_id>& o) noexcept
{
return dispatch(mdl.type,
[this, &mdl, t, &o]<typename DynamicsModels>(
DynamicsModels& dyn_models) {
return this->make_transition(
mdl, dyn_models.get(mdl.id), t, o);
return dispatch(
mdl.type,
[ this, &mdl, t, &
o ]<typename DynamicsModels>(DynamicsModels & dyn_models) {
return this->make_transition(mdl, dyn_models.get(mdl.id), t, o);
});
}
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment