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
8b45b58f
Commit
8b45b58f
authored
Dec 12, 2014
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix conversion warnings
parent
b35e41a8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
12 deletions
+14
-12
examples/remote_actors/group_server.cpp
examples/remote_actors/group_server.cpp
+4
-4
libcaf_core/caf/detail/single_reader_queue.hpp
libcaf_core/caf/detail/single_reader_queue.hpp
+1
-1
libcaf_core/caf/string_algorithms.hpp
libcaf_core/caf/string_algorithms.hpp
+5
-4
libcaf_core/cppa/opt.hpp
libcaf_core/cppa/opt.hpp
+2
-1
libcaf_io/src/basp_broker.cpp
libcaf_io/src/basp_broker.cpp
+2
-2
No files found.
examples/remote_actors/group_server.cpp
View file @
8b45b58f
...
...
@@ -8,8 +8,8 @@
* - ./build/bin/group_chat -g remote:chatroom@localhost:4242 -n bob *
\ ******************************************************************************/
#include <cstdlib>
#include <string>
#include <cstdlib>
#include <iostream>
#include "caf/all.hpp"
...
...
@@ -20,9 +20,9 @@ using namespace caf;
optional
<
uint16_t
>
to_port
(
const
string
&
arg
)
{
char
*
last
=
nullptr
;
auto
res
=
strtol
(
arg
.
c_str
(),
&
last
,
10
);
if
(
last
==
(
arg
.
c_str
()
+
arg
.
size
())
&&
res
>
1024
)
{
return
res
;
auto
res
=
strto
u
l
(
arg
.
c_str
(),
&
last
,
10
);
if
(
last
==
(
arg
.
c_str
()
+
arg
.
size
())
&&
res
<=
65536
)
{
return
static_cast
<
uint16_t
>
(
res
)
;
}
return
none
;
}
...
...
libcaf_core/caf/detail/single_reader_queue.hpp
View file @
8b45b58f
...
...
@@ -336,7 +336,7 @@ class single_reader_queue {
pointer
reader_blocked_dummy
()
{
// we are not going to dereference this pointer either
return
reinterpret_cast
<
pointer
>
(
reinterpret_cast
<
intptr_t
>
(
this
)
+
s
izeof
(
void
*
));
+
s
tatic_cast
<
intptr_t
>
(
sizeof
(
void
*
)
));
}
bool
is_dummy
(
pointer
ptr
)
{
...
...
libcaf_core/caf/string_algorithms.hpp
View file @
8b45b58f
...
...
@@ -72,21 +72,22 @@ void splice(std::string& str, const std::string& glue, T&& arg, Ts&&... args) {
splice
(
str
,
glue
,
std
::
forward
<
Ts
>
(
args
)...);
}
template
<
size_t
WhatSize
,
size
_t
WithSize
>
template
<
ptrdiff_t
WhatSize
,
ptrdiff
_t
WithSize
>
void
replace_all
(
std
::
string
&
str
,
const
char
(
&
what
)[
WhatSize
],
const
char
(
&
with
)[
WithSize
])
{
// end(what) - 1 points to the null-terminator
auto
next
=
[
&
](
std
::
string
::
iterator
pos
)
->
std
::
string
::
iterator
{
auto
next
=
[
&
](
std
::
string
::
iterator
pos
)
->
std
::
string
::
iterator
{
return
std
::
search
(
pos
,
str
.
end
(),
std
::
begin
(
what
),
std
::
end
(
what
)
-
1
);
};
auto
i
=
next
(
std
::
begin
(
str
));
while
(
i
!=
std
::
end
(
str
))
{
auto
before
=
static_cast
<
size_t
>
(
std
::
distance
(
std
::
begin
(
str
),
i
));
auto
before
=
std
::
distance
(
std
::
begin
(
str
),
i
);
CAF_REQUIRE
(
before
>=
0
);
str
.
replace
(
i
,
i
+
WhatSize
-
1
,
with
);
// i became invalidated -> use new iterator pointing
// to the first character after the replaced text
i
=
next
(
st
d
::
begin
(
str
)
+
before
+
(
WithSize
-
1
));
i
=
next
(
st
r
.
begin
(
)
+
before
+
(
WithSize
-
1
));
}
}
...
...
libcaf_core/cppa/opt.hpp
View file @
8b45b58f
...
...
@@ -41,7 +41,8 @@ using string_proj = std::function<optional<std::string> (const std::string&)>;
inline
string_proj
extract_longopt_arg
(
const
std
::
string
&
prefix
)
{
return
[
prefix
](
const
std
::
string
&
arg
)
->
optional
<
std
::
string
>
{
if
(
arg
.
compare
(
0
,
prefix
.
size
(),
prefix
)
==
0
)
{
return
std
::
string
(
arg
.
begin
()
+
prefix
.
size
(),
arg
.
end
());
return
std
::
string
(
arg
.
begin
()
+
static_cast
<
ptrdiff_t
>
(
prefix
.
size
()),
arg
.
end
());
}
return
none
;
};
...
...
libcaf_io/src/basp_broker.cpp
View file @
8b45b58f
...
...
@@ -263,7 +263,7 @@ void basp_broker::dispatch(const actor_addr& from, const actor_addr& to,
}
auto
&
buf
=
wr_buf
(
route
.
hdl
);
// reserve space in the buffer to write the broker message later on
auto
wr_pos
=
buf
.
size
(
);
auto
wr_pos
=
static_cast
<
ptrdiff_t
>
(
buf
.
size
()
);
char
placeholder
[
basp
::
header_size
];
buf
.
insert
(
buf
.
end
(),
std
::
begin
(
placeholder
),
std
::
end
(
placeholder
));
auto
before
=
buf
.
size
();
...
...
@@ -639,7 +639,7 @@ void basp_broker::init_handshake_as_sever(connection_context& ctx,
CAF_LOG_TRACE
(
CAF_ARG
(
this
));
CAF_REQUIRE
(
node
()
!=
invalid_node_id
);
auto
&
buf
=
wr_buf
(
ctx
.
hdl
);
auto
wrpos
=
buf
.
size
(
);
auto
wrpos
=
static_cast
<
ptrdiff_t
>
(
buf
.
size
()
);
char
padding
[
basp
::
header_size
];
buf
.
insert
(
buf
.
end
(),
std
::
begin
(
padding
),
std
::
end
(
padding
));
auto
before
=
buf
.
size
();
...
...
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