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
c959f526
Commit
c959f526
authored
Aug 27, 2012
by
Pieter Hintjens
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #415 from Quuxplusone/unused-parameters
Silence all "unused parameter" warnings from Clang.
parents
f6fe600e
08f6a9e7
Hide whitespace changes
Inline
Side-by-side
Showing
43 changed files
with
119 additions
and
56 deletions
+119
-56
blob.hpp
src/blob.hpp
+2
-2
dealer.cpp
src/dealer.cpp
+6
-0
dist.cpp
src/dist.cpp
+3
-0
err.cpp
src/err.cpp
+1
-0
io_object.cpp
src/io_object.cpp
+1
-1
io_thread.cpp
src/io_thread.cpp
+1
-1
lb.cpp
src/lb.cpp
+3
-0
object.cpp
src/object.cpp
+8
-8
pair.cpp
src/pair.cpp
+8
-2
pub.cpp
src/pub.cpp
+1
-1
pull.cpp
src/pull.cpp
+6
-0
push.cpp
src/push.cpp
+3
-0
reaper.cpp
src/reaper.cpp
+1
-1
router.cpp
src/router.cpp
+9
-0
session_base.cpp
src/session_base.cpp
+1
-1
socket_base.cpp
src/socket_base.cpp
+7
-8
sub.cpp
src/sub.cpp
+1
-1
tcp.cpp
src/tcp.cpp
+9
-0
tcp_address.cpp
src/tcp_address.cpp
+2
-2
tcp_address.hpp
src/tcp_address.hpp
+2
-2
tcp_listener.cpp
src/tcp_listener.cpp
+1
-1
xpub.cpp
src/xpub.cpp
+3
-0
xsub.cpp
src/xsub.cpp
+6
-0
zmq.cpp
src/zmq.cpp
+1
-1
test_connect_delay.cpp
tests/test_connect_delay.cpp
+3
-3
test_connect_resolve.cpp
tests/test_connect_resolve.cpp
+1
-1
test_hwm.cpp
tests/test_hwm.cpp
+1
-1
test_invalid_rep.cpp
tests/test_invalid_rep.cpp
+1
-1
test_last_endpoint.cpp
tests/test_last_endpoint.cpp
+1
-1
test_monitor.cpp
tests/test_monitor.cpp
+13
-4
test_msg_flags.cpp
tests/test_msg_flags.cpp
+1
-1
test_pair_inproc.cpp
tests/test_pair_inproc.cpp
+1
-1
test_pair_ipc.cpp
tests/test_pair_ipc.cpp
+1
-1
test_pair_tcp.cpp
tests/test_pair_tcp.cpp
+1
-1
test_reqrep_device.cpp
tests/test_reqrep_device.cpp
+1
-1
test_reqrep_inproc.cpp
tests/test_reqrep_inproc.cpp
+1
-1
test_reqrep_ipc.cpp
tests/test_reqrep_ipc.cpp
+1
-1
test_reqrep_tcp.cpp
tests/test_reqrep_tcp.cpp
+1
-1
test_router_behavior.cpp
tests/test_router_behavior.cpp
+1
-1
test_shutdown_stress.cpp
tests/test_shutdown_stress.cpp
+1
-1
test_sub_forward.cpp
tests/test_sub_forward.cpp
+1
-1
test_term_endpoint.cpp
tests/test_term_endpoint.cpp
+1
-1
test_timeo.cpp
tests/test_timeo.cpp
+1
-1
No files found.
src/blob.hpp
View file @
c959f526
...
...
@@ -96,10 +96,10 @@ namespace std
static
char_type
to_char_type
(
const
int_type
&
__c
)
{
return
char_type
();
}
{
return
char_type
(
__c
);
}
static
int_type
to_int_type
(
const
char_type
&
__c
)
{
return
int_type
();
}
to_int_type
(
const
char_type
&
__c
)
{
return
int_type
(
__c
);
}
static
bool
eq_int_type
(
const
int_type
&
__c1
,
const
int_type
&
__c2
)
...
...
src/dealer.cpp
View file @
c959f526
...
...
@@ -47,6 +47,9 @@ zmq::dealer_t::~dealer_t ()
void
zmq
::
dealer_t
::
xattach_pipe
(
pipe_t
*
pipe_
,
bool
icanhasall_
)
{
// icanhasall_ is unused
(
void
)
icanhasall_
;
zmq_assert
(
pipe_
);
fq
.
attach
(
pipe_
);
lb
.
attach
(
pipe_
);
...
...
@@ -59,6 +62,9 @@ int zmq::dealer_t::xsend (msg_t *msg_, int flags_)
int
zmq
::
dealer_t
::
xrecv
(
msg_t
*
msg_
,
int
flags_
)
{
// flags_ is unused
(
void
)
flags_
;
// If there is a prefetched message, return it.
if
(
prefetched
)
{
int
rc
=
msg_
->
move
(
prefetched_msg
);
...
...
src/dist.cpp
View file @
c959f526
...
...
@@ -128,6 +128,9 @@ int zmq::dist_t::send_to_matching (msg_t *msg_, int flags_)
void
zmq
::
dist_t
::
distribute
(
msg_t
*
msg_
,
int
flags_
)
{
// flags_ is unused
(
void
)
flags_
;
// If there are no matching pipes available, simply drop the message.
if
(
matching
==
0
)
{
int
rc
=
msg_
->
close
();
...
...
src/err.cpp
View file @
c959f526
...
...
@@ -72,6 +72,7 @@ void zmq::zmq_abort(const char *errmsg_)
extra_info
[
0
]
=
(
ULONG_PTR
)
errmsg_
;
RaiseException
(
0x40000015
,
EXCEPTION_NONCONTINUABLE
,
1
,
extra_info
);
#else
(
void
)
errmsg_
;
abort
();
#endif
}
...
...
src/io_object.cpp
View file @
c959f526
...
...
@@ -102,7 +102,7 @@ void zmq::io_object_t::out_event ()
zmq_assert
(
false
);
}
void
zmq
::
io_object_t
::
timer_event
(
int
id_
)
void
zmq
::
io_object_t
::
timer_event
(
int
)
{
zmq_assert
(
false
);
}
src/io_thread.cpp
View file @
c959f526
...
...
@@ -85,7 +85,7 @@ void zmq::io_thread_t::out_event ()
zmq_assert
(
false
);
}
void
zmq
::
io_thread_t
::
timer_event
(
int
id_
)
void
zmq
::
io_thread_t
::
timer_event
(
int
)
{
// No timers here. This function is never called.
zmq_assert
(
false
);
...
...
src/lb.cpp
View file @
c959f526
...
...
@@ -73,6 +73,9 @@ void zmq::lb_t::activated (pipe_t *pipe_)
int
zmq
::
lb_t
::
send
(
msg_t
*
msg_
,
int
flags_
)
{
// flags_ is unused
(
void
)
flags_
;
// Drop the message if required. If we are at the end of the message
// switch back to non-dropping mode.
if
(
dropping
)
{
...
...
src/object.cpp
View file @
c959f526
...
...
@@ -316,17 +316,17 @@ void zmq::object_t::process_plug ()
zmq_assert
(
false
);
}
void
zmq
::
object_t
::
process_own
(
own_t
*
object_
)
void
zmq
::
object_t
::
process_own
(
own_t
*
)
{
zmq_assert
(
false
);
}
void
zmq
::
object_t
::
process_attach
(
i_engine
*
engine_
)
void
zmq
::
object_t
::
process_attach
(
i_engine
*
)
{
zmq_assert
(
false
);
}
void
zmq
::
object_t
::
process_bind
(
pipe_t
*
pipe_
)
void
zmq
::
object_t
::
process_bind
(
pipe_t
*
)
{
zmq_assert
(
false
);
}
...
...
@@ -336,12 +336,12 @@ void zmq::object_t::process_activate_read ()
zmq_assert
(
false
);
}
void
zmq
::
object_t
::
process_activate_write
(
uint64_t
msgs_read_
)
void
zmq
::
object_t
::
process_activate_write
(
uint64_t
)
{
zmq_assert
(
false
);
}
void
zmq
::
object_t
::
process_hiccup
(
void
*
pipe_
)
void
zmq
::
object_t
::
process_hiccup
(
void
*
)
{
zmq_assert
(
false
);
}
...
...
@@ -356,12 +356,12 @@ void zmq::object_t::process_pipe_term_ack ()
zmq_assert
(
false
);
}
void
zmq
::
object_t
::
process_term_req
(
own_t
*
object_
)
void
zmq
::
object_t
::
process_term_req
(
own_t
*
)
{
zmq_assert
(
false
);
}
void
zmq
::
object_t
::
process_term
(
int
linger_
)
void
zmq
::
object_t
::
process_term
(
int
)
{
zmq_assert
(
false
);
}
...
...
@@ -371,7 +371,7 @@ void zmq::object_t::process_term_ack ()
zmq_assert
(
false
);
}
void
zmq
::
object_t
::
process_reap
(
class
socket_base_t
*
socket_
)
void
zmq
::
object_t
::
process_reap
(
class
socket_base_t
*
)
{
zmq_assert
(
false
);
}
...
...
src/pair.cpp
View file @
c959f526
...
...
@@ -38,6 +38,9 @@ zmq::pair_t::~pair_t ()
void
zmq
::
pair_t
::
xattach_pipe
(
pipe_t
*
pipe_
,
bool
icanhasall_
)
{
// icanhasall_ is unused
(
void
)
icanhasall_
;
zmq_assert
(
pipe_
!=
NULL
);
// ZMQ_PAIR socket can only be connected to a single peer.
...
...
@@ -54,13 +57,13 @@ void zmq::pair_t::xterminated (pipe_t *pipe_)
pipe
=
NULL
;
}
void
zmq
::
pair_t
::
xread_activated
(
pipe_t
*
pipe_
)
void
zmq
::
pair_t
::
xread_activated
(
pipe_t
*
)
{
// There's just one pipe. No lists of active and inactive pipes.
// There's nothing to do here.
}
void
zmq
::
pair_t
::
xwrite_activated
(
pipe_t
*
pipe_
)
void
zmq
::
pair_t
::
xwrite_activated
(
pipe_t
*
)
{
// There's just one pipe. No lists of active and inactive pipes.
// There's nothing to do here.
...
...
@@ -85,6 +88,9 @@ int zmq::pair_t::xsend (msg_t *msg_, int flags_)
int
zmq
::
pair_t
::
xrecv
(
msg_t
*
msg_
,
int
flags_
)
{
// flags_ is unused
(
void
)
flags_
;
// Deallocate old content of the message.
int
rc
=
msg_
->
close
();
errno_assert
(
rc
==
0
);
...
...
src/pub.cpp
View file @
c959f526
...
...
@@ -32,7 +32,7 @@ zmq::pub_t::~pub_t ()
{
}
int
zmq
::
pub_t
::
xrecv
(
class
msg_t
*
msg_
,
int
flags_
)
int
zmq
::
pub_t
::
xrecv
(
class
msg_t
*
,
int
)
{
// Messages cannot be received from PUB socket.
errno
=
ENOTSUP
;
...
...
src/pull.cpp
View file @
c959f526
...
...
@@ -36,6 +36,9 @@ zmq::pull_t::~pull_t ()
void
zmq
::
pull_t
::
xattach_pipe
(
pipe_t
*
pipe_
,
bool
icanhasall_
)
{
// icanhasall_ is unused
(
void
)
icanhasall_
;
zmq_assert
(
pipe_
);
fq
.
attach
(
pipe_
);
}
...
...
@@ -52,6 +55,9 @@ void zmq::pull_t::xterminated (pipe_t *pipe_)
int
zmq
::
pull_t
::
xrecv
(
msg_t
*
msg_
,
int
flags_
)
{
// flags_ is unused
(
void
)
flags_
;
return
fq
.
recv
(
msg_
);
}
...
...
src/push.cpp
View file @
c959f526
...
...
@@ -36,6 +36,9 @@ zmq::push_t::~push_t ()
void
zmq
::
push_t
::
xattach_pipe
(
pipe_t
*
pipe_
,
bool
icanhasall_
)
{
// icanhasall_ is unused
(
void
)
icanhasall_
;
zmq_assert
(
pipe_
);
lb
.
attach
(
pipe_
);
}
...
...
src/reaper.cpp
View file @
c959f526
...
...
@@ -78,7 +78,7 @@ void zmq::reaper_t::out_event ()
zmq_assert
(
false
);
}
void
zmq
::
reaper_t
::
timer_event
(
int
id_
)
void
zmq
::
reaper_t
::
timer_event
(
int
)
{
zmq_assert
(
false
);
}
...
...
src/router.cpp
View file @
c959f526
...
...
@@ -61,6 +61,9 @@ zmq::router_t::~router_t ()
void
zmq
::
router_t
::
xattach_pipe
(
pipe_t
*
pipe_
,
bool
icanhasall_
)
{
// icanhasall_ is unused
(
void
)
icanhasall_
;
zmq_assert
(
pipe_
);
bool
identity_ok
=
identify_peer
(
pipe_
);
...
...
@@ -128,6 +131,9 @@ void zmq::router_t::xwrite_activated (pipe_t *pipe_)
int
zmq
::
router_t
::
xsend
(
msg_t
*
msg_
,
int
flags_
)
{
// flags_ is unused
(
void
)
flags_
;
// If this is the first part of the message it's the ID of the
// peer to send the message to.
if
(
!
more_out
)
{
...
...
@@ -193,6 +199,9 @@ int zmq::router_t::xsend (msg_t *msg_, int flags_)
int
zmq
::
router_t
::
xrecv
(
msg_t
*
msg_
,
int
flags_
)
{
// flags_ is unused
(
void
)
flags_
;
if
(
prefetched
)
{
if
(
!
identity_sent
)
{
int
rc
=
msg_
->
move
(
prefetched_id
);
...
...
src/session_base.cpp
View file @
c959f526
...
...
@@ -279,7 +279,7 @@ void zmq::session_base_t::write_activated (pipe_t *pipe_)
engine
->
activate_in
();
}
void
zmq
::
session_base_t
::
hiccuped
(
pipe_t
*
pipe_
)
void
zmq
::
session_base_t
::
hiccuped
(
pipe_t
*
)
{
// Hiccups are always sent from session to socket, not the other
// way round.
...
...
src/socket_base.cpp
View file @
c959f526
...
...
@@ -874,8 +874,7 @@ void zmq::socket_base_t::process_destroy ()
destroyed
=
true
;
}
int
zmq
::
socket_base_t
::
xsetsockopt
(
int
option_
,
const
void
*
optval_
,
size_t
optvallen_
)
int
zmq
::
socket_base_t
::
xsetsockopt
(
int
,
const
void
*
,
size_t
)
{
errno
=
EINVAL
;
return
-
1
;
...
...
@@ -886,7 +885,7 @@ bool zmq::socket_base_t::xhas_out ()
return
false
;
}
int
zmq
::
socket_base_t
::
xsend
(
msg_t
*
msg_
,
int
flags_
)
int
zmq
::
socket_base_t
::
xsend
(
msg_t
*
,
int
)
{
errno
=
ENOTSUP
;
return
-
1
;
...
...
@@ -897,22 +896,22 @@ bool zmq::socket_base_t::xhas_in ()
return
false
;
}
int
zmq
::
socket_base_t
::
xrecv
(
msg_t
*
msg_
,
int
flags_
)
int
zmq
::
socket_base_t
::
xrecv
(
msg_t
*
,
int
)
{
errno
=
ENOTSUP
;
return
-
1
;
}
void
zmq
::
socket_base_t
::
xread_activated
(
pipe_t
*
pipe_
)
void
zmq
::
socket_base_t
::
xread_activated
(
pipe_t
*
)
{
zmq_assert
(
false
);
}
void
zmq
::
socket_base_t
::
xwrite_activated
(
pipe_t
*
pipe_
)
void
zmq
::
socket_base_t
::
xwrite_activated
(
pipe_t
*
)
{
zmq_assert
(
false
);
}
void
zmq
::
socket_base_t
::
xhiccuped
(
pipe_t
*
pipe_
)
void
zmq
::
socket_base_t
::
xhiccuped
(
pipe_t
*
)
{
zmq_assert
(
false
);
}
...
...
@@ -932,7 +931,7 @@ void zmq::socket_base_t::out_event ()
zmq_assert
(
false
);
}
void
zmq
::
socket_base_t
::
timer_event
(
int
id_
)
void
zmq
::
socket_base_t
::
timer_event
(
int
)
{
zmq_assert
(
false
);
}
...
...
src/sub.cpp
View file @
c959f526
...
...
@@ -67,7 +67,7 @@ int zmq::sub_t::xsetsockopt (int option_, const void *optval_,
return
rc
;
}
int
zmq
::
sub_t
::
xsend
(
msg_t
*
msg_
,
int
flags_
)
int
zmq
::
sub_t
::
xsend
(
msg_t
*
,
int
)
{
// Overload the XSUB's send.
errno
=
ENOTSUP
;
...
...
src/tcp.cpp
View file @
c959f526
...
...
@@ -63,6 +63,15 @@ void zmq::tune_tcp_socket (fd_t s_)
void
zmq
::
tune_tcp_keepalives
(
fd_t
s_
,
int
keepalive_
,
int
keepalive_cnt_
,
int
keepalive_idle_
,
int
keepalive_intvl_
)
{
// These options are used only under certain #ifdefs below.
(
void
)
keepalive_
;
(
void
)
keepalive_cnt_
;
(
void
)
keepalive_idle_
;
(
void
)
keepalive_intvl_
;
// If none of the #ifdefs apply, then s_ is unused.
(
void
)
s_
;
// Tuning TCP keep-alives if platform allows it
// All values = -1 means skip and leave it for OS
#ifdef ZMQ_HAVE_SO_KEEPALIVE
...
...
src/tcp_address.cpp
View file @
c959f526
...
...
@@ -488,7 +488,7 @@ zmq::tcp_address_mask_t::tcp_address_mask_t () :
address_mask
=
-
1
;
}
const
int
zmq
::
tcp_address_mask_t
::
mask
()
const
int
zmq
::
tcp_address_mask_t
::
mask
()
const
{
return
address_mask
;
}
...
...
@@ -574,7 +574,7 @@ int zmq::tcp_address_mask_t::to_string (std::string &addr_)
return
0
;
}
const
bool
zmq
::
tcp_address_mask_t
::
match_address
(
const
struct
sockaddr
*
ss
,
const
socklen_t
ss_len
)
const
bool
zmq
::
tcp_address_mask_t
::
match_address
(
const
struct
sockaddr
*
ss
,
const
socklen_t
ss_len
)
const
{
zmq_assert
(
address_mask
!=
-
1
&&
ss
!=
NULL
&&
ss_len
>=
(
socklen_t
)
sizeof
(
struct
sockaddr
));
...
...
src/tcp_address.hpp
View file @
c959f526
...
...
@@ -86,9 +86,9 @@ namespace zmq
// The opposite to resolve()
int
to_string
(
std
::
string
&
addr_
);
const
int
mask
()
const
;
int
mask
()
const
;
const
bool
match_address
(
const
struct
sockaddr
*
ss
,
const
socklen_t
ss_len
)
const
;
bool
match_address
(
const
struct
sockaddr
*
ss
,
const
socklen_t
ss_len
)
const
;
private
:
...
...
src/tcp_listener.cpp
View file @
c959f526
...
...
@@ -238,7 +238,7 @@ zmq::fd_t zmq::tcp_listener_t::accept ()
// Accept one connection and deal with different failure modes.
zmq_assert
(
s
!=
retired_fd
);
struct
sockaddr_storage
ss
=
{
0
};
struct
sockaddr_storage
ss
=
{};
#ifdef ZMQ_HAVE_HPUX
int
ss_len
=
sizeof
(
ss
);
#else
...
...
src/xpub.cpp
View file @
c959f526
...
...
@@ -131,6 +131,9 @@ bool zmq::xpub_t::xhas_out ()
int
zmq
::
xpub_t
::
xrecv
(
msg_t
*
msg_
,
int
flags_
)
{
// flags_ is unused
(
void
)
flags_
;
// If there is at least one
if
(
pending
.
empty
())
{
errno
=
EAGAIN
;
...
...
src/xsub.cpp
View file @
c959f526
...
...
@@ -47,6 +47,9 @@ zmq::xsub_t::~xsub_t ()
void
zmq
::
xsub_t
::
xattach_pipe
(
pipe_t
*
pipe_
,
bool
icanhasall_
)
{
// icanhasall_ is unused
(
void
)
icanhasall_
;
zmq_assert
(
pipe_
);
fq
.
attach
(
pipe_
);
dist
.
attach
(
pipe_
);
...
...
@@ -116,6 +119,9 @@ bool zmq::xsub_t::xhas_out ()
int
zmq
::
xsub_t
::
xrecv
(
msg_t
*
msg_
,
int
flags_
)
{
// flags_ is unused
(
void
)
flags_
;
// If there's already a message prepared by a previous call to zmq_poll,
// return it straight ahead.
if
(
has_message
)
{
...
...
src/zmq.cpp
View file @
c959f526
...
...
@@ -602,7 +602,7 @@ int zmq_msg_get (zmq_msg_t *msg_, int option_)
}
}
int
zmq_msg_set
(
zmq_msg_t
*
msg_
,
int
option_
,
int
optval_
)
int
zmq_msg_set
(
zmq_msg_t
*
,
int
,
int
)
{
// No options supported at present
errno
=
EINVAL
;
...
...
tests/test_connect_delay.cpp
View file @
c959f526
...
...
@@ -28,7 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "../include/zmq.h"
static
void
*
server
(
void
*
c
)
static
void
*
server
(
void
*
)
{
void
*
socket
,
*
context
;
char
buffer
[
16
];
...
...
@@ -88,7 +88,7 @@ static void *server (void *c)
pthread_exit
(
NULL
);
}
static
void
*
worker
(
void
*
n
)
static
void
*
worker
(
void
*
)
{
void
*
socket
,
*
context
;
int
rc
,
hadone
,
val
;
...
...
@@ -131,7 +131,7 @@ static void *worker (void *n)
pthread_exit
(
NULL
);
}
int
main
(
int
argc
,
char
*
argv
[]
)
int
main
(
void
)
{
fprintf
(
stderr
,
"test_connect_delay running...
\n
"
);
int
val
;
...
...
tests/test_connect_resolve.cpp
View file @
c959f526
...
...
@@ -25,7 +25,7 @@
#include "../include/zmq.h"
int
main
(
int
argc
,
char
*
argv
[]
)
int
main
(
void
)
{
fprintf
(
stderr
,
"test_connect_resolve running...
\n
"
);
...
...
tests/test_hwm.cpp
View file @
c959f526
...
...
@@ -24,7 +24,7 @@
#include "testutil.hpp"
int
main
(
int
argc
,
char
*
argv
[]
)
int
main
(
void
)
{
fprintf
(
stderr
,
"test_hwm running...
\n
"
);
...
...
tests/test_invalid_rep.cpp
View file @
c959f526
...
...
@@ -23,7 +23,7 @@
#include <assert.h>
#include <stdio.h>
int
main
(
int
argc
,
char
*
argv
[]
)
int
main
(
void
)
{
fprintf
(
stderr
,
"test_invalid_rep running...
\n
"
);
...
...
tests/test_last_endpoint.cpp
View file @
c959f526
...
...
@@ -35,7 +35,7 @@ static void do_bind_and_verify (void *s, const char *endpoint)
assert
(
rc
==
0
&&
strcmp
(
test
,
endpoint
)
==
0
);
}
int
main
(
int
argc
,
char
*
argv
[]
)
int
main
(
void
)
{
// Create the infrastructure
void
*
ctx
=
zmq_init
(
1
);
...
...
tests/test_monitor.cpp
View file @
c959f526
...
...
@@ -28,29 +28,38 @@
static
int
events
;
void
socket_monitor
(
void
*
s
,
int
event_
,
zmq_event_data_t
*
data_
)
typedef
void
*
ZmqSocket
;
ZmqSocket
rep
,
req
;
void
socket_monitor
(
ZmqSocket
s
,
int
event_
,
zmq_event_data_t
*
data_
)
{
assert
(
s
==
rep
||
s
==
req
);
const
char
*
addr
=
"tcp://127.0.0.1:5560"
;
// Only some of the exceptional events could fire
switch
(
event_
)
{
// listener specific
case
ZMQ_EVENT_LISTENING
:
assert
(
s
==
rep
);
assert
(
data_
->
listening
.
fd
>
0
);
assert
(
!
strcmp
(
data_
->
listening
.
addr
,
addr
));
events
|=
ZMQ_EVENT_LISTENING
;
break
;
case
ZMQ_EVENT_ACCEPTED
:
assert
(
s
==
rep
);
assert
(
data_
->
accepted
.
fd
>
0
);
assert
(
!
strcmp
(
data_
->
accepted
.
addr
,
addr
));
events
|=
ZMQ_EVENT_ACCEPTED
;
break
;
// connecter specific
case
ZMQ_EVENT_CONNECTED
:
assert
(
s
==
req
);
assert
(
data_
->
connected
.
fd
>
0
);
assert
(
!
strcmp
(
data_
->
connected
.
addr
,
addr
));
events
|=
ZMQ_EVENT_CONNECTED
;
break
;
case
ZMQ_EVENT_CONNECT_DELAYED
:
assert
(
s
==
req
);
assert
(
data_
->
connect_delayed
.
err
!=
0
);
assert
(
!
strcmp
(
data_
->
connect_delayed
.
addr
,
addr
));
events
|=
ZMQ_EVENT_CONNECT_DELAYED
;
...
...
@@ -77,7 +86,7 @@ void socket_monitor (void *s, int event_, zmq_event_data_t *data_)
}
}
int
main
(
int
argc
,
char
*
argv
[]
)
int
main
(
void
)
{
int
rc
;
...
...
@@ -87,13 +96,13 @@ int main (int argc, char *argv [])
// set socket monitor
rc
=
zmq_ctx_set_monitor
(
ctx
,
socket_monitor
);
assert
(
rc
==
0
);
void
*
rep
=
zmq_socket
(
ctx
,
ZMQ_REP
);
rep
=
zmq_socket
(
ctx
,
ZMQ_REP
);
assert
(
rep
);
rc
=
zmq_bind
(
rep
,
"tcp://127.0.0.1:5560"
);
assert
(
rc
==
0
);
void
*
req
=
zmq_socket
(
ctx
,
ZMQ_REQ
);
req
=
zmq_socket
(
ctx
,
ZMQ_REQ
);
assert
(
req
);
rc
=
zmq_connect
(
req
,
"tcp://127.0.0.1:5560"
);
...
...
tests/test_msg_flags.cpp
View file @
c959f526
...
...
@@ -24,7 +24,7 @@
#include "../include/zmq.h"
int
main
(
int
argc
,
char
*
argv
[]
)
int
main
(
void
)
{
// Create the infrastructure
void
*
ctx
=
zmq_init
(
0
);
...
...
tests/test_pair_inproc.cpp
View file @
c959f526
...
...
@@ -22,7 +22,7 @@
#include <stdio.h>
#include "testutil.hpp"
int
main
(
int
argc
,
char
*
argv
[]
)
int
main
(
void
)
{
fprintf
(
stderr
,
"test_pair_inproc running...
\n
"
);
...
...
tests/test_pair_ipc.cpp
View file @
c959f526
...
...
@@ -22,7 +22,7 @@
#include <stdio.h>
#include "testutil.hpp"
int
main
(
int
argc
,
char
*
argv
[]
)
int
main
(
void
)
{
fprintf
(
stderr
,
"test_pair_ipc running...
\n
"
);
...
...
tests/test_pair_tcp.cpp
View file @
c959f526
...
...
@@ -23,7 +23,7 @@
#include <stdio.h>
#include "testutil.hpp"
int
main
(
int
argc
,
char
*
argv
[]
)
int
main
(
void
)
{
fprintf
(
stderr
,
"test_pair_tcp running...
\n
"
);
...
...
tests/test_reqrep_device.cpp
View file @
c959f526
...
...
@@ -25,7 +25,7 @@
#include "../include/zmq.h"
int
main
(
int
argc
,
char
*
argv
[]
)
int
main
(
void
)
{
fprintf
(
stderr
,
"test_reqrep_device running...
\n
"
);
...
...
tests/test_reqrep_inproc.cpp
View file @
c959f526
...
...
@@ -22,7 +22,7 @@
#include <stdio.h>
#include "testutil.hpp"
int
main
(
int
argc
,
char
*
argv
[]
)
int
main
(
void
)
{
fprintf
(
stderr
,
"test_reqrep_inproc running...
\n
"
);
...
...
tests/test_reqrep_ipc.cpp
View file @
c959f526
...
...
@@ -22,7 +22,7 @@
#include <stdio.h>
#include "testutil.hpp"
int
main
(
int
argc
,
char
*
argv
[]
)
int
main
(
void
)
{
fprintf
(
stderr
,
"test_reqrep_ipc running...
\n
"
);
...
...
tests/test_reqrep_tcp.cpp
View file @
c959f526
...
...
@@ -23,7 +23,7 @@
#include <stdio.h>
#include "testutil.hpp"
int
main
(
int
argc
,
char
*
argv
[]
)
int
main
(
void
)
{
fprintf
(
stderr
,
"test_reqrep_tcp running...
\n
"
);
...
...
tests/test_router_behavior.cpp
View file @
c959f526
...
...
@@ -23,7 +23,7 @@
#include <stdio.h>
#include "testutil.hpp"
int
main
(
int
argc
,
char
*
argv
[]
)
int
main
(
void
)
{
fprintf
(
stderr
,
"test_router_behavior running...
\n
"
);
...
...
tests/test_shutdown_stress.cpp
View file @
c959f526
...
...
@@ -44,7 +44,7 @@ extern "C"
}
}
int
main
(
int
argc
,
char
*
argv
[]
)
int
main
(
void
)
{
void
*
ctx
;
void
*
s1
;
...
...
tests/test_sub_forward.cpp
View file @
c959f526
...
...
@@ -25,7 +25,7 @@
#include "../include/zmq.h"
#include "../include/zmq_utils.h"
int
main
(
int
argc
,
char
*
argv
[]
)
int
main
(
void
)
{
fprintf
(
stderr
,
"test_sub_forward running...
\n
"
);
...
...
tests/test_term_endpoint.cpp
View file @
c959f526
...
...
@@ -6,7 +6,7 @@
#include "../include/zmq_utils.h"
int
main
(
int
argc
,
char
*
argv
[]
)
int
main
(
void
)
{
int
rc
;
char
buf
[
32
];
...
...
tests/test_timeo.cpp
View file @
c959f526
...
...
@@ -44,7 +44,7 @@ extern "C"
}
}
int
main
(
int
argc
,
char
*
argv
[]
)
int
main
(
void
)
{
fprintf
(
stderr
,
"test_timeo running...
\n
"
);
...
...
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