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
49df2f41
Commit
49df2f41
authored
May 15, 2011
by
Martin Sustrik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes warning when compiling with MSVC on Win64
Signed-off-by:
Martin Sustrik
<
sustrik@250bpm.com
>
parent
49387874
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
38 additions
and
35 deletions
+38
-35
array.hpp
src/array.hpp
+4
-4
dist.cpp
src/dist.cpp
+1
-1
encoder.hpp
src/encoder.hpp
+1
-1
err.cpp
src/err.cpp
+1
-1
fq.cpp
src/fq.cpp
+3
-3
ip.cpp
src/ip.cpp
+5
-5
lb.cpp
src/lb.cpp
+1
-1
own.cpp
src/own.cpp
+1
-1
select.cpp
src/select.cpp
+4
-3
tcp_socket.cpp
src/tcp_socket.cpp
+8
-8
tcp_socket.hpp
src/tcp_socket.hpp
+4
-2
xrep.cpp
src/xrep.cpp
+3
-4
zmq.cpp
src/zmq.cpp
+2
-1
No files found.
src/array.hpp
View file @
49df2f41
...
...
@@ -99,7 +99,7 @@ namespace zmq
inline
void
push_back
(
T
*
item_
)
{
if
(
item_
)
item_
->
set_array_index
(
items
.
size
());
item_
->
set_array_index
(
(
int
)
items
.
size
());
items
.
push_back
(
item_
);
}
...
...
@@ -109,7 +109,7 @@ namespace zmq
inline
void
erase
(
size_type
index_
)
{
if
(
items
.
back
())
items
.
back
()
->
set_array_index
(
index_
);
items
.
back
()
->
set_array_index
(
(
int
)
index_
);
items
[
index_
]
=
items
.
back
();
items
.
pop_back
();
}
...
...
@@ -117,9 +117,9 @@ namespace zmq
inline
void
swap
(
size_type
index1_
,
size_type
index2_
)
{
if
(
items
[
index1_
])
items
[
index1_
]
->
set_array_index
(
index2_
);
items
[
index1_
]
->
set_array_index
(
(
int
)
index2_
);
if
(
items
[
index2_
])
items
[
index2_
]
->
set_array_index
(
index1_
);
items
[
index2_
]
->
set_array_index
(
(
int
)
index1_
);
std
::
swap
(
items
[
index1_
],
items
[
index2_
]);
}
...
...
src/dist.cpp
View file @
49df2f41
...
...
@@ -69,7 +69,7 @@ void zmq::dist_t::terminate ()
zmq_assert
(
!
terminating
);
terminating
=
true
;
sink
->
register_term_acks
(
pipes
.
size
());
sink
->
register_term_acks
(
(
int
)
pipes
.
size
());
for
(
pipes_t
::
size_type
i
=
0
;
i
!=
pipes
.
size
();
i
++
)
pipes
[
i
]
->
terminate
();
}
...
...
src/encoder.hpp
View file @
49df2f41
...
...
@@ -86,7 +86,7 @@ namespace zmq
// first-message-offset.
if
(
beginning
)
{
if
(
offset_
&&
*
offset_
==
-
1
)
*
offset_
=
pos
;
*
offset_
=
(
int
)
pos
;
beginning
=
false
;
}
}
...
...
src/err.cpp
View file @
49df2f41
...
...
@@ -190,7 +190,7 @@ void zmq::win_error (char *buffer_, size_t buffer_size_)
DWORD
errcode
=
GetLastError
();
DWORD
rc
=
FormatMessageA
(
FORMAT_MESSAGE_FROM_SYSTEM
|
FORMAT_MESSAGE_IGNORE_INSERTS
,
NULL
,
errcode
,
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_DEFAULT
),
buffer_
,
buffer_size_
,
NULL
);
SUBLANG_DEFAULT
),
buffer_
,
(
DWORD
)
buffer_size_
,
NULL
);
zmq_assert
(
rc
);
}
...
...
src/fq.cpp
View file @
49df2f41
...
...
@@ -81,7 +81,7 @@ void zmq::fq_t::terminate ()
zmq_assert
(
!
terminating
);
terminating
=
true
;
sink
->
register_term_acks
(
pipes
.
size
());
sink
->
register_term_acks
(
(
int
)
pipes
.
size
());
for
(
pipes_t
::
size_type
i
=
0
;
i
!=
pipes
.
size
();
i
++
)
pipes
[
i
]
->
terminate
();
}
...
...
@@ -100,7 +100,7 @@ int zmq::fq_t::recv (msg_t *msg_, int flags_)
errno_assert
(
rc
==
0
);
// Round-robin over the pipes to get the next message.
for
(
int
count
=
active
;
count
!=
0
;
count
--
)
{
for
(
pipes_t
::
size_type
count
=
active
;
count
!=
0
;
count
--
)
{
// Try to fetch new message. If we've already read part of the message
// subsequent part should be immediately available.
...
...
@@ -149,7 +149,7 @@ bool zmq::fq_t::has_in ()
// queueing algorithm. If there are no messages available current will
// get back to its original value. Otherwise it'll point to the first
// pipe holding messages, skipping only pipes with no messages available.
for
(
int
count
=
active
;
count
!=
0
;
count
--
)
{
for
(
pipes_t
::
size_type
count
=
active
;
count
!=
0
;
count
--
)
{
if
(
pipes
[
current
]
->
check_read
())
return
true
;
...
...
src/ip.cpp
View file @
49df2f41
...
...
@@ -200,7 +200,7 @@ int zmq::resolve_ip_interface (sockaddr_storage* addr_, socklen_t *addr_len_,
// Initialize temporary output pointers with ip4_addr
sockaddr
*
out_addr
=
(
sockaddr
*
)
&
ip4_addr
;
s
ize_t
out_addrlen
=
sizeof
(
ip4_addr
);
s
ocklen_t
out_addrlen
=
(
socklen_t
)
sizeof
(
ip4_addr
);
// 0 is not a valid port.
if
(
!
ip4_addr
.
sin_port
)
{
...
...
@@ -211,7 +211,7 @@ int zmq::resolve_ip_interface (sockaddr_storage* addr_, socklen_t *addr_len_,
// * resolves to INADDR_ANY.
if
(
iface
.
compare
(
"*"
)
==
0
)
{
ip4_addr
.
sin_addr
.
s_addr
=
htonl
(
INADDR_ANY
);
zmq_assert
(
out_addrlen
<=
sizeof
(
*
addr_
));
zmq_assert
(
out_addrlen
<=
(
socklen_t
)
sizeof
(
*
addr_
));
memcpy
(
addr_
,
out_addr
,
out_addrlen
);
*
addr_len_
=
out_addrlen
;
return
0
;
...
...
@@ -222,7 +222,7 @@ int zmq::resolve_ip_interface (sockaddr_storage* addr_, socklen_t *addr_len_,
if
(
rc
!=
0
&&
errno
!=
ENODEV
)
return
rc
;
if
(
rc
==
0
)
{
zmq_assert
(
out_addrlen
<=
sizeof
(
*
addr_
));
zmq_assert
(
out_addrlen
<=
(
socklen_t
)
sizeof
(
*
addr_
));
memcpy
(
addr_
,
out_addr
,
out_addrlen
);
*
addr_len_
=
out_addrlen
;
return
0
;
...
...
@@ -259,7 +259,7 @@ int zmq::resolve_ip_interface (sockaddr_storage* addr_, socklen_t *addr_len_,
// Use the first result.
zmq_assert
((
size_t
)
(
res
->
ai_addrlen
)
<=
sizeof
(
*
addr_
));
memcpy
(
addr_
,
res
->
ai_addr
,
res
->
ai_addrlen
);
*
addr_len_
=
res
->
ai_addrlen
;
*
addr_len_
=
(
socklen_t
)
res
->
ai_addrlen
;
// Cleanup getaddrinfo after copying the possibly referenced result.
if
(
res
)
...
...
@@ -308,7 +308,7 @@ int zmq::resolve_ip_hostname (sockaddr_storage *addr_, socklen_t *addr_len_,
// Copy first result to output addr with hostname and service.
zmq_assert
((
size_t
)
(
res
->
ai_addrlen
)
<=
sizeof
(
*
addr_
));
memcpy
(
addr_
,
res
->
ai_addr
,
res
->
ai_addrlen
);
*
addr_len_
=
res
->
ai_addrlen
;
*
addr_len_
=
(
socklen_t
)
res
->
ai_addrlen
;
freeaddrinfo
(
res
);
...
...
src/lb.cpp
View file @
49df2f41
...
...
@@ -58,7 +58,7 @@ void zmq::lb_t::terminate ()
zmq_assert
(
!
terminating
);
terminating
=
true
;
sink
->
register_term_acks
(
pipes
.
size
());
sink
->
register_term_acks
(
(
int
)
pipes
.
size
());
for
(
pipes_t
::
size_type
i
=
0
;
i
!=
pipes
.
size
();
i
++
)
pipes
[
i
]
->
terminate
();
}
...
...
src/own.cpp
View file @
49df2f41
...
...
@@ -161,7 +161,7 @@ void zmq::own_t::process_term (int linger_)
// Send termination request to all owned objects.
for
(
owned_t
::
iterator
it
=
owned
.
begin
();
it
!=
owned
.
end
();
++
it
)
send_term
(
*
it
,
linger_
);
register_term_acks
(
owned
.
size
());
register_term_acks
(
(
int
)
owned
.
size
());
owned
.
clear
();
// Start termination process and check whether by chance we cannot
...
...
src/select.cpp
View file @
49df2f41
...
...
@@ -159,12 +159,13 @@ void zmq::select_t::loop ()
// Wait for events.
struct
timeval
tv
=
{(
long
)
(
timeout
/
1000
),
(
long
)
(
timeout
%
1000
*
1000
)};
int
rc
=
select
(
maxfd
+
1
,
&
readfds
,
&
writefds
,
&
exceptfds
,
timeout
?
&
tv
:
NULL
);
#ifdef ZMQ_HAVE_WINDOWS
int
rc
=
select
(
0
,
&
readfds
,
&
writefds
,
&
exceptfds
,
timeout
?
&
tv
:
NULL
);
wsa_assert
(
rc
!=
SOCKET_ERROR
);
#else
int
rc
=
select
(
maxfd
+
1
,
&
readfds
,
&
writefds
,
&
exceptfds
,
timeout
?
&
tv
:
NULL
);
if
(
rc
==
-
1
&&
errno
==
EINTR
)
continue
;
errno_assert
(
rc
!=
-
1
);
...
...
src/tcp_socket.cpp
View file @
49df2f41
...
...
@@ -69,9 +69,9 @@ zmq::fd_t zmq::tcp_socket_t::get_fd ()
return
s
;
}
int
zmq
::
tcp_socket_t
::
write
(
const
void
*
data
,
int
size
)
int
zmq
::
tcp_socket_t
::
write
(
const
void
*
data
_
,
size_t
size_
)
{
int
nbytes
=
send
(
s
,
(
char
*
)
data
,
size
,
0
);
int
nbytes
=
send
(
s
,
(
char
*
)
data
_
,
(
int
)
size_
,
0
);
// If not a single byte can be written to the socket in non-blocking mode
// we'll get an error (this may happen during the speculative write).
...
...
@@ -93,9 +93,9 @@ int zmq::tcp_socket_t::write (const void *data, int size)
return
(
size_t
)
nbytes
;
}
int
zmq
::
tcp_socket_t
::
read
(
void
*
data
,
in
t
size
)
int
zmq
::
tcp_socket_t
::
read
(
void
*
data
_
,
size_
t
size
)
{
int
nbytes
=
recv
(
s
,
(
char
*
)
data
,
size
,
0
);
int
nbytes
=
recv
(
s
,
(
char
*
)
data
_
,
(
int
)
size_
,
0
);
// If not a single byte can be read from the socket in non-blocking mode
// we'll get an error (this may happen during the speculative read).
...
...
@@ -176,9 +176,9 @@ zmq::fd_t zmq::tcp_socket_t::get_fd ()
return
s
;
}
int
zmq
::
tcp_socket_t
::
write
(
const
void
*
data
,
int
size
)
int
zmq
::
tcp_socket_t
::
write
(
const
void
*
data
_
,
size_t
size_
)
{
ssize_t
nbytes
=
send
(
s
,
data
,
size
,
0
);
ssize_t
nbytes
=
send
(
s
,
data
_
,
size_
,
0
);
// Several errors are OK. When speculative write is being done we may not
// be able to write a single byte to the socket. Also, SIGSTOP issued
...
...
@@ -195,9 +195,9 @@ int zmq::tcp_socket_t::write (const void *data, int size)
return
(
size_t
)
nbytes
;
}
int
zmq
::
tcp_socket_t
::
read
(
void
*
data
,
int
size
)
int
zmq
::
tcp_socket_t
::
read
(
void
*
data
_
,
size_t
size_
)
{
ssize_t
nbytes
=
recv
(
s
,
data
,
size
,
0
);
ssize_t
nbytes
=
recv
(
s
,
data
_
,
size_
,
0
);
// Several errors are OK. When speculative read is being done we may not
// be able to read a single byte to the socket. Also, SIGSTOP issued
...
...
src/tcp_socket.hpp
View file @
49df2f41
...
...
@@ -21,6 +21,8 @@
#ifndef __ZMQ_TCP_SOCKET_HPP_INCLUDED__
#define __ZMQ_TCP_SOCKET_HPP_INCLUDED__
#include <stddef.h>
#include "fd.hpp"
#include "stdint.hpp"
...
...
@@ -49,13 +51,13 @@ namespace zmq
// Writes data to the socket. Returns the number of bytes actually
// written (even zero is to be considered to be a success). In case
// of error or orderly shutdown by the other peer -1 is returned.
int
write
(
const
void
*
data
,
int
size
);
int
write
(
const
void
*
data
_
,
size_t
size_
);
// Reads data from the socket (up to 'size' bytes). Returns the number
// of bytes actually read (even zero is to be considered to be
// a success). In case of error or orderly shutdown by the other
// peer -1 is returned.
int
read
(
void
*
data
,
int
size
);
int
read
(
void
*
data
_
,
size_t
size_
);
private
:
...
...
src/xrep.cpp
View file @
49df2f41
...
...
@@ -83,7 +83,7 @@ void zmq::xrep_t::process_term (int linger_)
{
terminating
=
true
;
register_term_acks
(
inpipes
.
size
()
+
outpipes
.
size
(
));
register_term_acks
(
(
int
)
(
inpipes
.
size
()
+
outpipes
.
size
()
));
for
(
inpipes_t
::
iterator
it
=
inpipes
.
begin
();
it
!=
inpipes
.
end
();
++
it
)
...
...
@@ -257,7 +257,7 @@ int zmq::xrep_t::xrecv (msg_t *msg_, int flags_)
}
// Round-robin over the pipes to get the next message.
for
(
in
t
count
=
inpipes
.
size
();
count
!=
0
;
count
--
)
{
for
(
in
pipes_t
::
size_type
count
=
inpipes
.
size
();
count
!=
0
;
count
--
)
{
// Try to fetch new message.
if
(
inpipes
[
current_in
].
active
)
...
...
@@ -299,7 +299,6 @@ int zmq::xrep_t::rollback (void)
return
0
;
}
bool
zmq
::
xrep_t
::
xhas_in
()
{
// There are subsequent parts of the partly-read message available.
...
...
@@ -310,7 +309,7 @@ bool zmq::xrep_t::xhas_in ()
// queueing algorithm. If there are no messages available current will
// get back to its original value. Otherwise it'll point to the first
// pipe holding messages, skipping only pipes with no messages available.
for
(
in
t
count
=
inpipes
.
size
();
count
!=
0
;
count
--
)
{
for
(
in
pipes_t
::
size_type
count
=
inpipes
.
size
();
count
!=
0
;
count
--
)
{
if
(
inpipes
[
current_in
].
active
&&
inpipes
[
current_in
].
reader
->
check_read
())
return
true
;
...
...
src/zmq.cpp
View file @
49df2f41
...
...
@@ -587,10 +587,11 @@ int zmq_poll (zmq_pollitem_t *items_, int nitems_, long timeout_)
memcpy
(
&
inset
,
&
pollset_in
,
sizeof
(
fd_set
));
memcpy
(
&
outset
,
&
pollset_out
,
sizeof
(
fd_set
));
memcpy
(
&
errset
,
&
pollset_err
,
sizeof
(
fd_set
));
int
rc
=
select
(
maxfd
+
1
,
&
inset
,
&
outset
,
&
errset
,
ptimeout
);
#if defined ZMQ_HAVE_WINDOWS
int
rc
=
select
(
0
,
&
inset
,
&
outset
,
&
errset
,
ptimeout
);
wsa_assert
(
rc
!=
SOCKET_ERROR
);
#else
int
rc
=
select
(
maxfd
+
1
,
&
inset
,
&
outset
,
&
errset
,
ptimeout
);
if
(
rc
==
-
1
&&
errno
==
EINTR
)
return
-
1
;
errno_assert
(
rc
>=
0
);
...
...
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