Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
b52c9432
Commit
b52c9432
authored
Sep 12, 2019
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix maybe-uninitialized warnings
parent
667e1828
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
8 deletions
+35
-8
libcaf_core/caf/data_processor.hpp
libcaf_core/caf/data_processor.hpp
+1
-1
libcaf_core/test/inspector.cpp
libcaf_core/test/inspector.cpp
+34
-7
No files found.
libcaf_core/caf/data_processor.hpp
View file @
b52c9432
...
@@ -176,7 +176,7 @@ public:
...
@@ -176,7 +176,7 @@ public:
lhs
=
static_cast
<
underlying
>
(
rhs
);
lhs
=
static_cast
<
underlying
>
(
rhs
);
}
}
}
assign
;
}
assign
;
underlying
tmp
;
underlying
tmp
=
0
;
return
convert_apply
(
dref
(),
x
,
tmp
,
assign
);
return
convert_apply
(
dref
(),
x
,
tmp
,
assign
);
}
}
...
...
libcaf_core/test/inspector.cpp
View file @
b52c9432
...
@@ -228,22 +228,49 @@ CAF_TEST(stringification_inspector) {
...
@@ -228,22 +228,49 @@ CAF_TEST(stringification_inspector) {
}
}
namespace
{
namespace
{
template
<
class
T
>
struct
is_integral_or_enum
{
static
constexpr
bool
value
=
std
::
is_integral
<
T
>::
value
||
std
::
is_enum
<
T
>::
value
;
};
struct
binary_serialization_policy
{
struct
binary_serialization_policy
{
execution_unit
&
context
;
execution_unit
&
context
;
template
<
class
T
>
template
<
class
T
>
bool
operator
()(
T
&
x
)
{
std
::
vector
<
char
>
to_buf
(
const
T
&
x
)
{
std
::
vector
<
char
>
buf
;
std
::
vector
<
char
>
result
;
binary_serializer
f
{
&
context
,
buf
};
binary_serializer
f
{
&
context
,
result
};
f
(
x
);
if
(
auto
err
=
f
(
x
))
binary_deserializer
g
{
&
context
,
buf
};
CAF_FAIL
(
"failed to serialize "
<<
x
<<
": "
<<
err
);
return
result
;
}
template
<
class
T
>
detail
::
enable_if_t
<
is_integral_or_enum
<
T
>::
value
,
bool
>
operator
()(
T
&
x
)
{
auto
buf
=
to_buf
(
x
);
binary_deserializer
f
{
&
context
,
buf
};
auto
y
=
static_cast
<
T
>
(
0
);
if
(
auto
err
=
f
(
y
))
CAF_FAIL
(
"failed to deserialize from buffer: "
<<
err
);
CAF_CHECK_EQUAL
(
x
,
y
);
return
detail
::
safe_equal
(
x
,
y
);
}
template
<
class
T
>
detail
::
enable_if_t
<!
is_integral_or_enum
<
T
>::
value
,
bool
>
operator
()(
T
&
x
)
{
auto
buf
=
to_buf
(
x
);
binary_deserializer
f
{
&
context
,
buf
};
T
y
;
T
y
;
g
(
y
);
if
(
auto
err
=
f
(
y
))
CAF_FAIL
(
"failed to deserialize from buffer: "
<<
err
);
CAF_CHECK_EQUAL
(
x
,
y
);
CAF_CHECK_EQUAL
(
x
,
y
);
return
detail
::
safe_equal
(
x
,
y
);
return
detail
::
safe_equal
(
x
,
y
);
}
}
};
};
}
// namespace <anonymous>
}
// namespace
CAF_TEST
(
binary_serialization_inspectors
)
{
CAF_TEST
(
binary_serialization_inspectors
)
{
actor_system_config
cfg
;
actor_system_config
cfg
;
...
...
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