mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-10 04:50:37 -04:00
Use ev_[u]intptr_t types in place of [u]intptr_t
This commit is contained in:
parent
1fa4c81c71
commit
cef61a2f1b
@ -292,7 +292,7 @@ be_async_flush(struct bufferevent *bev, short what,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
connect_complete(struct event_overlapped *eo, uintptr_t key,
|
connect_complete(struct event_overlapped *eo, ev_uintptr_t key,
|
||||||
ev_ssize_t nbytes, int ok)
|
ev_ssize_t nbytes, int ok)
|
||||||
{
|
{
|
||||||
struct bufferevent_async *bev_a = upcast_connect(eo);
|
struct bufferevent_async *bev_a = upcast_connect(eo);
|
||||||
@ -311,7 +311,7 @@ connect_complete(struct event_overlapped *eo, uintptr_t key,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
read_complete(struct event_overlapped *eo, uintptr_t key,
|
read_complete(struct event_overlapped *eo, ev_uintptr_t key,
|
||||||
ev_ssize_t nbytes, int ok)
|
ev_ssize_t nbytes, int ok)
|
||||||
{
|
{
|
||||||
struct bufferevent_async *bev_a = upcast_read(eo);
|
struct bufferevent_async *bev_a = upcast_read(eo);
|
||||||
@ -344,7 +344,7 @@ read_complete(struct event_overlapped *eo, uintptr_t key,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
write_complete(struct event_overlapped *eo, uintptr_t key,
|
write_complete(struct event_overlapped *eo, ev_uintptr_t key,
|
||||||
ev_ssize_t nbytes, int ok)
|
ev_ssize_t nbytes, int ok)
|
||||||
{
|
{
|
||||||
struct bufferevent_async *bev_a = upcast_write(eo);
|
struct bufferevent_async *bev_a = upcast_write(eo);
|
||||||
|
@ -93,7 +93,7 @@ loop(void *_port)
|
|||||||
|
|
||||||
int
|
int
|
||||||
event_iocp_port_associate(struct event_iocp_port *port, evutil_socket_t fd,
|
event_iocp_port_associate(struct event_iocp_port *port, evutil_socket_t fd,
|
||||||
uintptr_t key)
|
ev_uintptr_t key)
|
||||||
{
|
{
|
||||||
HANDLE h;
|
HANDLE h;
|
||||||
h = CreateIoCompletionPort((HANDLE)fd, port->port, key, port->n_threads);
|
h = CreateIoCompletionPort((HANDLE)fd, port->port, key, port->n_threads);
|
||||||
@ -186,8 +186,8 @@ event_iocp_port_launch(void)
|
|||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
for (i=0; i<port->n_threads; ++i) {
|
for (i=0; i<port->n_threads; ++i) {
|
||||||
uintptr_t th = _beginthread(loop, 0, port);
|
ev_uintptr_t th = _beginthread(loop, 0, port);
|
||||||
if (th == (uintptr_t)-1)
|
if (th == (ev_uintptr_t)-1)
|
||||||
goto err;
|
goto err;
|
||||||
port->threads[i] = (HANDLE)th;
|
port->threads[i] = (HANDLE)th;
|
||||||
++port->n_live_threads;
|
++port->n_live_threads;
|
||||||
@ -254,7 +254,7 @@ event_iocp_shutdown(struct event_iocp_port *port, long waitMsec)
|
|||||||
int
|
int
|
||||||
event_iocp_activate_overlapped(
|
event_iocp_activate_overlapped(
|
||||||
struct event_iocp_port *port, struct event_overlapped *o,
|
struct event_iocp_port *port, struct event_overlapped *o,
|
||||||
uintptr_t key, ev_uint32_t n)
|
ev_uintptr_t key, ev_uint32_t n)
|
||||||
{
|
{
|
||||||
BOOL r;
|
BOOL r;
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ extern "C" {
|
|||||||
struct event_overlapped;
|
struct event_overlapped;
|
||||||
struct event_iocp_port;
|
struct event_iocp_port;
|
||||||
struct evbuffer;
|
struct evbuffer;
|
||||||
typedef void (*iocp_callback)(struct event_overlapped *, uintptr_t, ev_ssize_t, int success);
|
typedef void (*iocp_callback)(struct event_overlapped *, ev_uintptr_t, ev_ssize_t, int success);
|
||||||
|
|
||||||
/* This whole file is actually win32 only. We wrap the structures in a win32
|
/* This whole file is actually win32 only. We wrap the structures in a win32
|
||||||
* ifdef so that we can test-compile code that uses these interfaces on
|
* ifdef so that we can test-compile code that uses these interfaces on
|
||||||
@ -161,7 +161,7 @@ struct event_iocp_port *event_iocp_port_launch(void);
|
|||||||
fd will happen on one of the iocp's worker threads.
|
fd will happen on one of the iocp's worker threads.
|
||||||
*/
|
*/
|
||||||
int event_iocp_port_associate(struct event_iocp_port *port, evutil_socket_t fd,
|
int event_iocp_port_associate(struct event_iocp_port *port, evutil_socket_t fd,
|
||||||
uintptr_t key);
|
ev_uintptr_t key);
|
||||||
|
|
||||||
/** Tell all threads serving an iocp to stop. Wait for up to waitMsec for all
|
/** Tell all threads serving an iocp to stop. Wait for up to waitMsec for all
|
||||||
the threads to finish whatever they're doing. If all the threads are
|
the threads to finish whatever they're doing. If all the threads are
|
||||||
@ -173,7 +173,7 @@ int event_iocp_shutdown(struct event_iocp_port *port, long waitMsec);
|
|||||||
/* FIXME document. */
|
/* FIXME document. */
|
||||||
int event_iocp_activate_overlapped(struct event_iocp_port *port,
|
int event_iocp_activate_overlapped(struct event_iocp_port *port,
|
||||||
struct event_overlapped *o,
|
struct event_overlapped *o,
|
||||||
uintptr_t key, ev_uint32_t n_bytes);
|
ev_uintptr_t key, ev_uint32_t n_bytes);
|
||||||
|
|
||||||
struct event_base;
|
struct event_base;
|
||||||
/* FIXME document. */
|
/* FIXME document. */
|
||||||
|
@ -313,7 +313,7 @@ struct accepting_socket {
|
|||||||
char addrbuf[1];
|
char addrbuf[1];
|
||||||
};
|
};
|
||||||
|
|
||||||
static void accepted_socket_cb(struct event_overlapped *o, uintptr_t key,
|
static void accepted_socket_cb(struct event_overlapped *o, ev_uintptr_t key,
|
||||||
ev_ssize_t n, int ok);
|
ev_ssize_t n, int ok);
|
||||||
static void accepted_socket_invoke_user_cb(struct deferred_cb *cb, void *arg);
|
static void accepted_socket_invoke_user_cb(struct deferred_cb *cb, void *arg);
|
||||||
|
|
||||||
@ -441,7 +441,7 @@ accepted_socket_invoke_user_cb(struct deferred_cb *cb, void *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
accepted_socket_cb(struct event_overlapped *o, uintptr_t key, ev_ssize_t n, int ok)
|
accepted_socket_cb(struct event_overlapped *o, ev_uintptr_t key, ev_ssize_t n, int ok)
|
||||||
{
|
{
|
||||||
struct accepting_socket *as =
|
struct accepting_socket *as =
|
||||||
EVUTIL_UPCAST(o, struct accepting_socket, overlapped);
|
EVUTIL_UPCAST(o, struct accepting_socket, overlapped);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user