Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
cb2b377d
Commit
cb2b377d
authored
Dec 08, 2019
by
Simon Giesecke
Committed by
Simon Giesecke
Dec 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: redundant else after return
Solution: remove else
parent
1d9c6bcf
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
47 additions
and
51 deletions
+47
-51
curve_client.cpp
src/curve_client.cpp
+2
-2
ip.cpp
src/ip.cpp
+5
-5
proxy.cpp
src/proxy.cpp
+2
-2
socket_poller.cpp
src/socket_poller.cpp
+3
-4
stream_engine_base.cpp
src/stream_engine_base.cpp
+5
-6
tipc_address.cpp
src/tipc_address.cpp
+2
-1
ws_engine.cpp
src/ws_engine.cpp
+7
-6
ws_listener.cpp
src/ws_listener.cpp
+2
-2
xsub.cpp
src/xsub.cpp
+2
-3
zap_client.cpp
src/zap_client.cpp
+2
-2
zmq.cpp
src/zmq.cpp
+1
-2
test_radio_dish.cpp
tests/test_radio_dish.cpp
+1
-2
test_security_curve.cpp
tests/test_security_curve.cpp
+1
-2
test_xpub_nodrop.cpp
tests/test_xpub_nodrop.cpp
+8
-8
unittest_ip_resolver.cpp
unittests/unittest_ip_resolver.cpp
+2
-2
unittest_udp_address.cpp
unittests/unittest_udp_address.cpp
+2
-2
No files found.
src/curve_client.cpp
View file @
cb2b377d
...
...
@@ -128,8 +128,8 @@ zmq::mechanism_t::status_t zmq::curve_client_t::status () const
return
mechanism_t
::
ready
;
if
(
_state
==
error_received
)
return
mechanism_t
::
error
;
else
return
mechanism_t
::
handshaking
;
return
mechanism_t
::
handshaking
;
}
int
zmq
::
curve_client_t
::
produce_hello
(
msg_t
*
msg_
)
...
...
src/ip.cpp
View file @
cb2b377d
...
...
@@ -255,9 +255,9 @@ int zmq::bind_to_device (fd_t s_, const std::string &bound_device_)
if
(
rc
!=
0
)
{
assert_success_or_recoverable
(
s_
,
rc
);
return
-
1
;
}
else
{
return
0
;
}
return
0
;
#else
LIBZMQ_UNUSED
(
s_
);
LIBZMQ_UNUSED
(
bound_device_
);
...
...
@@ -550,10 +550,10 @@ int zmq::make_fdpair (fd_t *r_, fd_t *w_)
errno_assert
(
errno
==
ENFILE
||
errno
==
EMFILE
);
*
w_
=
*
r_
=
-
1
;
return
-
1
;
}
else
{
*
w_
=
*
r_
=
fd
;
return
0
;
}
*
w_
=
*
r_
=
fd
;
return
0
;
#elif defined ZMQ_HAVE_WINDOWS
#ifdef ZMQ_HAVE_IPC
...
...
src/proxy.cpp
View file @
cb2b377d
...
...
@@ -128,8 +128,8 @@ int forward (class zmq::socket_base_t *from_,
if
(
rc
<
0
)
{
if
(
likely
(
errno
==
EAGAIN
&&
i
>
0
))
return
0
;
// End of burst
else
return
-
1
;
return
-
1
;
}
complete_msg_size
+=
msg_
->
size
();
...
...
src/socket_poller.cpp
View file @
cb2b377d
...
...
@@ -91,11 +91,10 @@ int zmq::socket_poller_t::signaler_fd (fd_t *fd_)
if
(
_signaler
)
{
*
fd_
=
_signaler
->
get_fd
();
return
0
;
}
else
{
// Only thread-safe socket types are guaranteed to have a signaler.
errno
=
EINVAL
;
return
-
1
;
}
// Only thread-safe socket types are guaranteed to have a signaler.
errno
=
EINVAL
;
return
-
1
;
}
int
zmq
::
socket_poller_t
::
add
(
socket_base_t
*
socket_
,
...
...
src/stream_engine_base.cpp
View file @
cb2b377d
...
...
@@ -465,14 +465,13 @@ int zmq::stream_engine_base_t::next_handshake_command (msg_t *msg_)
if
(
_mechanism
->
status
()
==
mechanism_t
::
error
)
{
errno
=
EPROTO
;
return
-
1
;
}
else
{
const
int
rc
=
_mechanism
->
next_handshake_command
(
msg_
);
}
const
int
rc
=
_mechanism
->
next_handshake_command
(
msg_
);
if
(
rc
==
0
)
msg_
->
set_flags
(
msg_t
::
command
);
if
(
rc
==
0
)
msg_
->
set_flags
(
msg_t
::
command
);
return
rc
;
}
return
rc
;
}
int
zmq
::
stream_engine_base_t
::
process_handshake_command
(
msg_t
*
msg_
)
...
...
src/tipc_address.cpp
View file @
cb2b377d
...
...
@@ -108,7 +108,8 @@ int zmq::tipc_address_t::resolve (const char *name_)
address
.
addr
.
nameseq
.
upper
=
upper
;
address
.
scope
=
TIPC_ZONE_SCOPE
;
return
0
;
}
else
if
(
res
==
2
&&
type
>
TIPC_RESERVED_TYPES
)
{
}
if
(
res
==
2
&&
type
>
TIPC_RESERVED_TYPES
)
{
address
.
family
=
AF_TIPC
;
address
.
addrtype
=
TIPC_ADDR_NAME
;
address
.
addr
.
name
.
name
.
type
=
type
;
...
...
src/ws_engine.cpp
View file @
cb2b377d
...
...
@@ -204,8 +204,9 @@ bool zmq::ws_engine_t::select_protocol (char *protocol_)
_process_msg
=
static_cast
<
int
(
stream_engine_base_t
::*
)
(
msg_t
*
)
>
(
&
ws_engine_t
::
process_routing_id_msg
);
return
true
;
}
else
if
(
_options
.
mechanism
==
ZMQ_NULL
&&
strcmp
(
"ZWS2.0/NULL"
,
protocol_
)
==
0
)
{
}
if
(
_options
.
mechanism
==
ZMQ_NULL
&&
strcmp
(
"ZWS2.0/NULL"
,
protocol_
)
==
0
)
{
_mechanism
=
new
(
std
::
nothrow
)
null_mechanism_t
(
session
(),
_peer_address
,
_options
);
alloc_assert
(
_mechanism
);
...
...
@@ -510,8 +511,8 @@ bool zmq::ws_engine_t::server_handshake ()
_insize
--
;
return
true
;
}
else
_server_handshake_state
=
handshake_error
;
}
_server_handshake_state
=
handshake_error
;
}
else
_server_handshake_state
=
handshake_error
;
break
;
...
...
@@ -853,8 +854,8 @@ bool zmq::ws_engine_t::client_handshake ()
_insize
--
;
return
true
;
}
else
_client_handshake_state
=
client_handshake_error
;
}
_client_handshake_state
=
client_handshake_error
;
}
else
_client_handshake_state
=
client_handshake_error
;
break
;
...
...
src/ws_listener.cpp
View file @
cb2b377d
...
...
@@ -126,8 +126,8 @@ std::string zmq::ws_listener_t::get_socket_name (zmq::fd_t fd_,
{
if
(
_wss
)
return
zmq
::
get_socket_name
<
wss_address_t
>
(
fd_
,
socket_end_
);
else
return
zmq
::
get_socket_name
<
ws_address_t
>
(
fd_
,
socket_end_
);
return
zmq
::
get_socket_name
<
ws_address_t
>
(
fd_
,
socket_end_
);
}
int
zmq
::
ws_listener_t
::
create_socket
(
const
char
*
addr_
)
...
...
src/xsub.cpp
View file @
cb2b377d
...
...
@@ -109,10 +109,9 @@ int zmq::xsub_t::xsetsockopt (int option_,
}
_only_first_subscribe
=
(
*
static_cast
<
const
int
*>
(
optval_
)
!=
0
);
return
0
;
}
else
{
errno
=
EINVAL
;
return
-
1
;
}
errno
=
EINVAL
;
return
-
1
;
}
int
zmq
::
xsub_t
::
xsend
(
msg_t
*
msg_
)
...
...
src/zap_client.cpp
View file @
cb2b377d
...
...
@@ -274,8 +274,8 @@ zmq::mechanism_t::status_t zap_client_common_handshake_t::status () const
return
mechanism_t
::
ready
;
if
(
state
==
error_sent
)
return
mechanism_t
::
error
;
else
return
mechanism_t
::
handshaking
;
return
mechanism_t
::
handshaking
;
}
int
zap_client_common_handshake_t
::
zap_msg_available
()
...
...
src/zmq.cpp
View file @
cb2b377d
...
...
@@ -1305,9 +1305,8 @@ int zmq_poller_fd (void *poller_, zmq_fd_t *fd_)
||
!
(
static_cast
<
zmq
::
socket_poller_t
*>
(
poller_
)
->
check_tag
()))
{
errno
=
EFAULT
;
return
-
1
;
}
else
{
return
static_cast
<
zmq
::
socket_poller_t
*>
(
poller_
)
->
signaler_fd
(
fd_
);
}
return
static_cast
<
zmq
::
socket_poller_t
*>
(
poller_
)
->
signaler_fd
(
fd_
);
}
// Peer-specific state
...
...
tests/test_radio_dish.cpp
View file @
cb2b377d
...
...
@@ -257,9 +257,8 @@ static const char *mcast_url (int ipv6_)
{
if
(
ipv6_
)
{
return
"udp://["
MCAST_IPV6
"]:5555"
;
}
else
{
return
"udp://"
MCAST_IPV4
":5555"
;
}
return
"udp://"
MCAST_IPV4
":5555"
;
}
// OSX uses a different name for this socket option
...
...
tests/test_security_curve.cpp
View file @
cb2b377d
...
...
@@ -335,9 +335,8 @@ static uint64_t host_to_network (uint64_t value_)
htonl
(
static_cast
<
uint32_t
>
(
value_
&
0xFFFFFFFFLL
));
return
(
static_cast
<
uint64_t
>
(
low_part
)
<<
32
)
|
high_part
;
}
else
{
return
value_
;
}
return
value_
;
}
template
<
size_t
N
>
void
send_command
(
fd_t
s_
,
char
(
&
command_
)[
N
])
...
...
tests/test_xpub_nodrop.cpp
View file @
cb2b377d
...
...
@@ -73,16 +73,16 @@ void test ()
if
(
rc
==
-
1
)
{
TEST_ASSERT_EQUAL_INT
(
EAGAIN
,
errno
);
break
;
}
else
{
TEST_ASSERT_EQUAL_INT
(
0
,
rc
);
recv_count
++
;
}
TEST_ASSERT_EQUAL_INT
(
0
,
rc
);
recv_count
++
;
if
(
recv_count
==
1
)
{
const
int
sub_rcvtimeo
=
250
;
TEST_ASSERT_SUCCESS_ERRNO
(
zmq_setsockopt
(
sub
,
ZMQ_RCVTIMEO
,
&
sub_rcvtimeo
,
sizeof
(
sub_rcvtimeo
)));
}
if
(
recv_count
==
1
)
{
const
int
sub_rcvtimeo
=
250
;
TEST_ASSERT_SUCCESS_ERRNO
(
zmq_setsockopt
(
sub
,
ZMQ_RCVTIMEO
,
&
sub_rcvtimeo
,
sizeof
(
sub_rcvtimeo
)));
}
}
while
(
true
);
TEST_ASSERT_EQUAL_INT
(
send_count
,
recv_count
);
...
...
unittests/unittest_ip_resolver.cpp
View file @
cb2b377d
...
...
@@ -160,9 +160,9 @@ static void test_resolve (zmq::ip_resolver_options_t opts_,
// TODO also check the expected errno
TEST_ASSERT_EQUAL
(
-
1
,
rc
);
return
;
}
else
{
TEST_ASSERT_SUCCESS_ERRNO
(
rc
);
}
TEST_ASSERT_SUCCESS_ERRNO
(
rc
);
validate_address
(
family
,
&
addr
,
expected_addr_
,
expected_port_
,
expected_zone_
,
expected_addr_v4_failover_
);
...
...
unittests/unittest_udp_address.cpp
View file @
cb2b377d
...
...
@@ -54,9 +54,9 @@ static void test_resolve (bool bind_,
TEST_ASSERT_EQUAL
(
-
1
,
rc
);
TEST_ASSERT_EQUAL
(
EINVAL
,
errno
);
return
;
}
else
{
TEST_ASSERT_EQUAL
(
0
,
rc
);
}
TEST_ASSERT_EQUAL
(
0
,
rc
);
TEST_ASSERT_EQUAL
(
multicast_
,
addr
.
is_mcast
());
...
...
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