Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Gauthier Quesnel
irritator
Commits
2a42ad4a
Commit
2a42ad4a
authored
Apr 08, 2020
by
Gauthier Quesnel
Browse files
core: fix serveral warnings
parent
a8c2f4fa
Pipeline
#10585
passed with stage
in 1 minute and 13 seconds
Changes
2
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
app/gui/node-editor.cpp
View file @
2a42ad4a
...
...
@@ -226,7 +226,7 @@ struct editor
}
template
<
typename
Dynamics
>
void
do_free
(
model
&
mdl
,
Dynamics
&
dyn
)
void
do_free
(
[[
maybe_unused
]]
Dynamics
&
dyn
)
{
if
constexpr
(
is_detected_v
<
has_output_port_t
,
Dynamics
>
)
{
for
(
size_t
i
=
0
,
e
=
std
::
size
(
dyn
.
y
);
i
!=
e
;
++
i
)
{
...
...
@@ -258,46 +258,46 @@ struct editor
switch
(
mdl
->
type
)
{
case
dynamics_type
::
none
:
do_free
(
*
mdl
,
sim
.
none_models
.
get
(
mdl
->
id
));
do_free
(
sim
.
none_models
.
get
(
mdl
->
id
));
break
;
case
dynamics_type
::
integrator
:
do_free
(
*
mdl
,
sim
.
integrator_models
.
get
(
mdl
->
id
));
do_free
(
sim
.
integrator_models
.
get
(
mdl
->
id
));
break
;
case
dynamics_type
::
quantifier
:
do_free
(
*
mdl
,
sim
.
quantifier_models
.
get
(
mdl
->
id
));
do_free
(
sim
.
quantifier_models
.
get
(
mdl
->
id
));
break
;
case
dynamics_type
::
adder_2
:
do_free
(
*
mdl
,
sim
.
adder_2_models
.
get
(
mdl
->
id
));
do_free
(
sim
.
adder_2_models
.
get
(
mdl
->
id
));
break
;
case
dynamics_type
::
adder_3
:
do_free
(
*
mdl
,
sim
.
adder_3_models
.
get
(
mdl
->
id
));
do_free
(
sim
.
adder_3_models
.
get
(
mdl
->
id
));
break
;
case
dynamics_type
::
adder_4
:
do_free
(
*
mdl
,
sim
.
adder_4_models
.
get
(
mdl
->
id
));
do_free
(
sim
.
adder_4_models
.
get
(
mdl
->
id
));
break
;
case
dynamics_type
::
mult_2
:
do_free
(
*
mdl
,
sim
.
mult_2_models
.
get
(
mdl
->
id
));
do_free
(
sim
.
mult_2_models
.
get
(
mdl
->
id
));
break
;
case
dynamics_type
::
mult_3
:
do_free
(
*
mdl
,
sim
.
mult_3_models
.
get
(
mdl
->
id
));
do_free
(
sim
.
mult_3_models
.
get
(
mdl
->
id
));
break
;
case
dynamics_type
::
mult_4
:
do_free
(
*
mdl
,
sim
.
mult_4_models
.
get
(
mdl
->
id
));
do_free
(
sim
.
mult_4_models
.
get
(
mdl
->
id
));
break
;
case
dynamics_type
::
counter
:
do_free
(
*
mdl
,
sim
.
counter_models
.
get
(
mdl
->
id
));
do_free
(
sim
.
counter_models
.
get
(
mdl
->
id
));
break
;
case
dynamics_type
::
generator
:
do_free
(
*
mdl
,
sim
.
generator_models
.
get
(
mdl
->
id
));
do_free
(
sim
.
generator_models
.
get
(
mdl
->
id
));
break
;
case
dynamics_type
::
constant
:
do_free
(
*
mdl
,
sim
.
constant_models
.
get
(
mdl
->
id
));
do_free
(
sim
.
constant_models
.
get
(
mdl
->
id
));
break
;
case
dynamics_type
::
cross
:
do_free
(
*
mdl
,
sim
.
cross_models
.
get
(
mdl
->
id
));
do_free
(
sim
.
cross_models
.
get
(
mdl
->
id
));
break
;
case
dynamics_type
::
time_func
:
do_free
(
*
mdl
,
sim
.
time_func_models
.
get
(
mdl
->
id
));
do_free
(
sim
.
time_func_models
.
get
(
mdl
->
id
));
break
;
default:
irt_bad_return
(
status
::
unknown_dynamics
);
...
...
lib/include/irritator/core.hpp
View file @
2a42ad4a
...
...
@@ -803,7 +803,6 @@ public:
};
public:
using
this_container
=
flat_list
<
T
>
;
using
allocator_type
=
block_allocator
<
node_type
>
;
using
value_type
=
T
;
using
reference
=
T
&
;
...
...
@@ -880,7 +879,7 @@ public:
std
::
swap
(
node
,
other
.
node
);
}
friend
class
this_container
;
friend
class
flat_list
<
T
>
;
};
class
const_iterator
...
...
@@ -954,7 +953,7 @@ public:
std
::
swap
(
node
,
other
.
node
);
}
friend
class
this_container
;
friend
class
flat_list
<
T
>
;
};
private:
...
...
@@ -2452,7 +2451,7 @@ public:
void
free
(
T
&
t
)
noexcept
{
data
.
free
(
id
);
data
.
free
(
t
);
}
/**
...
...
@@ -4170,59 +4169,59 @@ struct simulation
switch
(
mdl
->
type
)
{
case
dynamics_type
::
none
:
do_deallocate
(
*
mdl
,
none_models
.
get
(
mdl
->
id
));
do_deallocate
(
none_models
.
get
(
mdl
->
id
));
none_models
.
free
(
mdl
->
id
);
break
;
case
dynamics_type
::
integrator
:
do_deallocate
(
*
mdl
,
integrator_models
.
get
(
mdl
->
id
));
do_deallocate
(
integrator_models
.
get
(
mdl
->
id
));
integrator_models
.
free
(
mdl
->
id
);
break
;
case
dynamics_type
::
quantifier
:
do_deallocate
(
*
mdl
,
quantifier_models
.
get
(
mdl
->
id
));
do_deallocate
(
quantifier_models
.
get
(
mdl
->
id
));
quantifier_models
.
free
(
mdl
->
id
);
break
;
case
dynamics_type
::
adder_2
:
do_deallocate
(
*
mdl
,
adder_2_models
.
get
(
mdl
->
id
));
do_deallocate
(
adder_2_models
.
get
(
mdl
->
id
));
adder_2_models
.
free
(
mdl
->
id
);
break
;
case
dynamics_type
::
adder_3
:
do_deallocate
(
*
mdl
,
adder_3_models
.
get
(
mdl
->
id
));
do_deallocate
(
adder_3_models
.
get
(
mdl
->
id
));
adder_3_models
.
free
(
mdl
->
id
);
break
;
case
dynamics_type
::
adder_4
:
do_deallocate
(
*
mdl
,
adder_4_models
.
get
(
mdl
->
id
));
do_deallocate
(
adder_4_models
.
get
(
mdl
->
id
));
adder_4_models
.
free
(
mdl
->
id
);
break
;
case
dynamics_type
::
mult_2
:
do_deallocate
(
*
mdl
,
mult_2_models
.
get
(
mdl
->
id
));
do_deallocate
(
mult_2_models
.
get
(
mdl
->
id
));
mult_2_models
.
free
(
mdl
->
id
);
break
;
case
dynamics_type
::
mult_3
:
do_deallocate
(
*
mdl
,
mult_3_models
.
get
(
mdl
->
id
));
do_deallocate
(
mult_3_models
.
get
(
mdl
->
id
));
mult_3_models
.
free
(
mdl
->
id
);
break
;
case
dynamics_type
::
mult_4
:
do_deallocate
(
*
mdl
,
mult_4_models
.
get
(
mdl
->
id
));
do_deallocate
(
mult_4_models
.
get
(
mdl
->
id
));
mult_4_models
.
free
(
mdl
->
id
);
break
;
case
dynamics_type
::
counter
:
do_deallocate
(
*
mdl
,
counter_models
.
get
(
mdl
->
id
));
do_deallocate
(
counter_models
.
get
(
mdl
->
id
));
counter_models
.
free
(
mdl
->
id
);
break
;
case
dynamics_type
::
generator
:
do_deallocate
(
*
mdl
,
generator_models
.
get
(
mdl
->
id
));
do_deallocate
(
generator_models
.
get
(
mdl
->
id
));
generator_models
.
free
(
mdl
->
id
);
break
;
case
dynamics_type
::
constant
:
do_deallocate
(
*
mdl
,
constant_models
.
get
(
mdl
->
id
));
do_deallocate
(
constant_models
.
get
(
mdl
->
id
));
constant_models
.
free
(
mdl
->
id
);
break
;
case
dynamics_type
::
cross
:
do_deallocate
(
*
mdl
,
cross_models
.
get
(
mdl
->
id
));
do_deallocate
(
cross_models
.
get
(
mdl
->
id
));
cross_models
.
free
(
mdl
->
id
);
break
;
case
dynamics_type
::
time_func
:
do_deallocate
(
*
mdl
,
time_func_models
.
get
(
mdl
->
id
));
do_deallocate
(
time_func_models
.
get
(
mdl
->
id
));
time_func_models
.
free
(
mdl
->
id
);
break
;
default:
...
...
@@ -4236,7 +4235,7 @@ struct simulation
}
template
<
typename
Dynamics
>
void
do_deallocate
(
model
&
mdl
,
Dynamics
&
dyn
)
void
do_deallocate
(
[[
maybe_unused
]]
Dynamics
&
dyn
)
noexcept
{
if
constexpr
(
is_detected_v
<
has_output_port_t
,
Dynamics
>
)
{
for
(
size_t
i
=
0
,
e
=
std
::
size
(
dyn
.
y
);
i
!=
e
;
++
i
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment