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
19713b96
Commit
19713b96
authored
Sep 12, 2019
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix "too small to hold all values of enum" warning
parent
e35d7273
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
9 deletions
+14
-9
libcaf_io/caf/io/network/event_handler.hpp
libcaf_io/caf/io/network/event_handler.hpp
+1
-1
libcaf_io/caf/io/receive_policy.hpp
libcaf_io/caf/io/receive_policy.hpp
+7
-3
libcaf_io/src/event_handler.cpp
libcaf_io/src/event_handler.cpp
+5
-4
libcaf_io/src/stream.cpp
libcaf_io/src/stream.cpp
+1
-1
No files found.
libcaf_io/caf/io/network/event_handler.hpp
View file @
19713b96
...
...
@@ -45,7 +45,7 @@ public:
bool
shutting_down
:
1
;
/// Stores what receive policy is currently active.
receive_policy_flag
rd_flag
:
2
;
unsigned
rd_flag
:
2
;
};
event_handler
(
default_multiplexer
&
dm
,
native_socket
sockfd
);
...
...
libcaf_io/caf/io/receive_policy.hpp
View file @
19713b96
...
...
@@ -33,6 +33,10 @@ enum class receive_policy_flag : unsigned {
exactly
};
constexpr
unsigned
to_integer
(
receive_policy_flag
x
)
{
return
static_cast
<
unsigned
>
(
x
);
}
inline
std
::
string
to_string
(
receive_policy_flag
x
)
{
return
x
==
receive_policy_flag
::
at_least
?
"at_least"
...
...
@@ -45,17 +49,17 @@ public:
using
config
=
std
::
pair
<
receive_policy_flag
,
size_t
>
;
static
inline
config
at_least
(
size_t
num_bytes
)
{
static
config
at_least
(
size_t
num_bytes
)
{
CAF_ASSERT
(
num_bytes
>
0
);
return
{
receive_policy_flag
::
at_least
,
num_bytes
};
}
static
inline
config
at_most
(
size_t
num_bytes
)
{
static
config
at_most
(
size_t
num_bytes
)
{
CAF_ASSERT
(
num_bytes
>
0
);
return
{
receive_policy_flag
::
at_most
,
num_bytes
};
}
static
inline
config
exactly
(
size_t
num_bytes
)
{
static
config
exactly
(
size_t
num_bytes
)
{
CAF_ASSERT
(
num_bytes
>
0
);
return
{
receive_policy_flag
::
exactly
,
num_bytes
};
}
...
...
libcaf_io/src/event_handler.cpp
View file @
19713b96
...
...
@@ -33,10 +33,11 @@ namespace io {
namespace
network
{
event_handler
::
event_handler
(
default_multiplexer
&
dm
,
native_socket
sockfd
)
:
fd_
(
sockfd
),
state_
{
true
,
false
,
false
,
false
,
receive_policy_flag
::
at_least
},
eventbf_
(
0
),
backend_
(
dm
)
{
:
fd_
(
sockfd
),
state_
{
true
,
false
,
false
,
false
,
to_integer
(
receive_policy_flag
::
at_least
)},
eventbf_
(
0
),
backend_
(
dm
)
{
set_fd_flags
();
}
...
...
libcaf_io/src/stream.cpp
View file @
19713b96
...
...
@@ -55,7 +55,7 @@ void stream::activate(stream_manager* mgr) {
}
void
stream
::
configure_read
(
receive_policy
::
config
config
)
{
state_
.
rd_flag
=
config
.
first
;
state_
.
rd_flag
=
to_integer
(
config
.
first
)
;
max_
=
config
.
second
;
}
...
...
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