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
9105491f
Commit
9105491f
authored
May 18, 2021
by
Gauthier Quesnel
Browse files
core: fix empty external source error
parent
1c6c824b
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/include/irritator/core.hpp
View file @
9105491f
...
...
@@ -4906,18 +4906,27 @@ struct counter
}
};
struct
external_source
;
struct
constant_external_source
{
bool
operator
()(
external_source
&
src
)
noexcept
;
double
value
=
0.0
;
};
inline
static
constant_external_source
default_external_source
;
struct
external_source
{
function_ref
<
bool
(
external_source
&
src
)
>
expand
=
default_external_source
;
double
*
data
=
nullptr
;
// @todo use a std::span<double> instead
sz
index
=
0
;
// of data and size.
double
value
=
0.0
;
sz
size
=
0
;
u32
id
=
0
;
u32
type
=
0
;
function_ref
<
bool
(
external_source
&
src
)
>
expand
;
external_source
()
noexcept
=
default
;
bool
init
()
noexcept
{
data
=
nullptr
;
...
...
@@ -4949,6 +4958,18 @@ struct external_source
}
};
inline
bool
constant_external_source
::
operator
()(
external_source
&
src
)
noexcept
{
src
.
data
=
&
value
;
src
.
index
=
0
;
src
.
size
=
1
;
src
.
id
=
0
;
src
.
type
=
0
;
return
true
;
}
struct
generator
{
port
y
[
1
];
...
...
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