mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-08 03:44:22 -04:00
Clean up lingering _identifiers.
This commit is contained in:
parent
c7848fa019
commit
946b5841c2
@ -479,9 +479,9 @@ arc4random(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
ARC4RANDOM_EXPORT void
|
ARC4RANDOM_EXPORT void
|
||||||
arc4random_buf(void *_buf, size_t n)
|
arc4random_buf(void *buf_, size_t n)
|
||||||
{
|
{
|
||||||
unsigned char *buf = _buf;
|
unsigned char *buf = buf_;
|
||||||
ARC4_LOCK_();
|
ARC4_LOCK_();
|
||||||
arc4_stir_if_needed();
|
arc4_stir_if_needed();
|
||||||
while (n--) {
|
while (n--) {
|
||||||
|
@ -131,7 +131,7 @@ bufferevent_inbuf_wm_cb(struct evbuffer *buf,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
bufferevent_run_deferred_callbacks_locked(struct deferred_cb *_, void *arg)
|
bufferevent_run_deferred_callbacks_locked(struct deferred_cb *cb, void *arg)
|
||||||
{
|
{
|
||||||
struct bufferevent_private *bufev_private = arg;
|
struct bufferevent_private *bufev_private = arg;
|
||||||
struct bufferevent *bufev = &bufev_private->bev;
|
struct bufferevent *bufev = &bufev_private->bev;
|
||||||
@ -164,7 +164,7 @@ bufferevent_run_deferred_callbacks_locked(struct deferred_cb *_, void *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
bufferevent_run_deferred_callbacks_unlocked(struct deferred_cb *_, void *arg)
|
bufferevent_run_deferred_callbacks_unlocked(struct deferred_cb *cb, void *arg)
|
||||||
{
|
{
|
||||||
struct bufferevent_private *bufev_private = arg;
|
struct bufferevent_private *bufev_private = arg;
|
||||||
struct bufferevent *bufev = &bufev_private->bev;
|
struct bufferevent *bufev = &bufev_private->bev;
|
||||||
@ -608,7 +608,7 @@ bufferevent_incref_and_lock_(struct bufferevent *bufev)
|
|||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
static void
|
static void
|
||||||
_bufferevent_transfer_lock_ownership(struct bufferevent *donor,
|
bufferevent_transfer_lock_ownership_(struct bufferevent *donor,
|
||||||
struct bufferevent *recipient)
|
struct bufferevent *recipient)
|
||||||
{
|
{
|
||||||
struct bufferevent_private *d = BEV_UPCAST(donor);
|
struct bufferevent_private *d = BEV_UPCAST(donor);
|
||||||
|
@ -413,9 +413,9 @@ bufferevent_filtered_outbuf_cb(struct evbuffer *buf,
|
|||||||
|
|
||||||
/* Called when the underlying socket has read. */
|
/* Called when the underlying socket has read. */
|
||||||
static void
|
static void
|
||||||
be_filter_readcb(struct bufferevent *underlying, void *_me)
|
be_filter_readcb(struct bufferevent *underlying, void *me_)
|
||||||
{
|
{
|
||||||
struct bufferevent_filtered *bevf = _me;
|
struct bufferevent_filtered *bevf = me_;
|
||||||
enum bufferevent_filter_result res;
|
enum bufferevent_filter_result res;
|
||||||
enum bufferevent_flush_mode state;
|
enum bufferevent_flush_mode state;
|
||||||
struct bufferevent *bufev = downcast(bevf);
|
struct bufferevent *bufev = downcast(bevf);
|
||||||
@ -445,9 +445,9 @@ be_filter_readcb(struct bufferevent *underlying, void *_me)
|
|||||||
/* Called when the underlying socket has drained enough that we can write to
|
/* Called when the underlying socket has drained enough that we can write to
|
||||||
it. */
|
it. */
|
||||||
static void
|
static void
|
||||||
be_filter_writecb(struct bufferevent *underlying, void *_me)
|
be_filter_writecb(struct bufferevent *underlying, void *me_)
|
||||||
{
|
{
|
||||||
struct bufferevent_filtered *bevf = _me;
|
struct bufferevent_filtered *bevf = me_;
|
||||||
struct bufferevent *bev = downcast(bevf);
|
struct bufferevent *bev = downcast(bevf);
|
||||||
int processed_any = 0;
|
int processed_any = 0;
|
||||||
|
|
||||||
@ -458,9 +458,9 @@ be_filter_writecb(struct bufferevent *underlying, void *_me)
|
|||||||
|
|
||||||
/* Called when the underlying socket has given us an error */
|
/* Called when the underlying socket has given us an error */
|
||||||
static void
|
static void
|
||||||
be_filter_eventcb(struct bufferevent *underlying, short what, void *_me)
|
be_filter_eventcb(struct bufferevent *underlying, short what, void *me_)
|
||||||
{
|
{
|
||||||
struct bufferevent_filtered *bevf = _me;
|
struct bufferevent_filtered *bevf = me_;
|
||||||
struct bufferevent *bev = downcast(bevf);
|
struct bufferevent *bev = downcast(bevf);
|
||||||
|
|
||||||
bufferevent_incref_and_lock_(bev);
|
bufferevent_incref_and_lock_(bev);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/* evconfig-private.h template - see "Configuration Header Templates" */
|
/* evconfig-private.h template - see "Configuration Header Templates" */
|
||||||
/* in AC manual. Kevin Bowling <kevin.bowling@kev009.com */
|
/* in AC manual. Kevin Bowling <kevin.bowling@kev009.com */
|
||||||
#ifndef _EVENT_EVCONFIG__PRIVATE_H
|
#ifndef EVCONFIG_PRIVATE_H_INCLUDED_
|
||||||
#define _EVENT_EVCONFIG__PRIVATE_H
|
#define EVCONFIG_PRIVATE_H_INCLUDED_
|
||||||
|
|
||||||
/* Enable extensions on AIX 3, Interix. */
|
/* Enable extensions on AIX 3, Interix. */
|
||||||
#ifndef _ALL_SOURCE
|
#ifndef _ALL_SOURCE
|
||||||
|
16
evdns.c
16
evdns.c
@ -1736,9 +1736,9 @@ evdns_close_server_port(struct evdns_server_port *port)
|
|||||||
|
|
||||||
/* exported function */
|
/* exported function */
|
||||||
int
|
int
|
||||||
evdns_server_request_add_reply(struct evdns_server_request *_req, int section, const char *name, int type, int class, int ttl, int datalen, int is_name, const char *data)
|
evdns_server_request_add_reply(struct evdns_server_request *req_, int section, const char *name, int type, int class, int ttl, int datalen, int is_name, const char *data)
|
||||||
{
|
{
|
||||||
struct server_request *req = TO_SERVER_REQUEST(_req);
|
struct server_request *req = TO_SERVER_REQUEST(req_);
|
||||||
struct server_reply_item **itemp, *item;
|
struct server_reply_item **itemp, *item;
|
||||||
int *countp;
|
int *countp;
|
||||||
int result = -1;
|
int result = -1;
|
||||||
@ -1966,9 +1966,9 @@ overflow:
|
|||||||
|
|
||||||
/* exported function */
|
/* exported function */
|
||||||
int
|
int
|
||||||
evdns_server_request_respond(struct evdns_server_request *_req, int err)
|
evdns_server_request_respond(struct evdns_server_request *req_, int err)
|
||||||
{
|
{
|
||||||
struct server_request *req = TO_SERVER_REQUEST(_req);
|
struct server_request *req = TO_SERVER_REQUEST(req_);
|
||||||
struct evdns_server_port *port = req->port;
|
struct evdns_server_port *port = req->port;
|
||||||
int r = -1;
|
int r = -1;
|
||||||
|
|
||||||
@ -2114,18 +2114,18 @@ server_port_free(struct evdns_server_port *port)
|
|||||||
|
|
||||||
/* exported function */
|
/* exported function */
|
||||||
int
|
int
|
||||||
evdns_server_request_drop(struct evdns_server_request *_req)
|
evdns_server_request_drop(struct evdns_server_request *req_)
|
||||||
{
|
{
|
||||||
struct server_request *req = TO_SERVER_REQUEST(_req);
|
struct server_request *req = TO_SERVER_REQUEST(req_);
|
||||||
server_request_free(req);
|
server_request_free(req);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* exported function */
|
/* exported function */
|
||||||
int
|
int
|
||||||
evdns_server_request_get_requesting_addr(struct evdns_server_request *_req, struct sockaddr *sa, int addr_len)
|
evdns_server_request_get_requesting_addr(struct evdns_server_request *req_, struct sockaddr *sa, int addr_len)
|
||||||
{
|
{
|
||||||
struct server_request *req = TO_SERVER_REQUEST(_req);
|
struct server_request *req = TO_SERVER_REQUEST(req_);
|
||||||
if (addr_len < (int)req->addrlen)
|
if (addr_len < (int)req->addrlen)
|
||||||
return -1;
|
return -1;
|
||||||
memcpy(sa, &(req->addr), req->addrlen);
|
memcpy(sa, &(req->addr), req->addrlen);
|
||||||
|
@ -61,9 +61,9 @@ handle_entry(OVERLAPPED *o, ULONG_PTR completion_key, DWORD nBytes, int ok)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
loop(void *_port)
|
loop(void *port_)
|
||||||
{
|
{
|
||||||
struct event_iocp_port *port = _port;
|
struct event_iocp_port *port = port_;
|
||||||
long ms = port->ms;
|
long ms = port->ms;
|
||||||
HANDLE p = port->port;
|
HANDLE p = port->port;
|
||||||
|
|
||||||
|
28
evmap.c
28
evmap.c
@ -111,30 +111,30 @@ HT_GENERATE(event_io_map, event_map_entry, map_node, hashsocket, eqsocket,
|
|||||||
|
|
||||||
#define GET_IO_SLOT(x, map, slot, type) \
|
#define GET_IO_SLOT(x, map, slot, type) \
|
||||||
do { \
|
do { \
|
||||||
struct event_map_entry _key, *_ent; \
|
struct event_map_entry key_, *ent_; \
|
||||||
_key.fd = slot; \
|
key_.fd = slot; \
|
||||||
_ent = HT_FIND(event_io_map, map, &_key); \
|
ent_ = HT_FIND(event_io_map, map, &key_); \
|
||||||
(x) = _ent ? &_ent->ent.type : NULL; \
|
(x) = ent_ ? &ent_->ent.type : NULL; \
|
||||||
} while (0);
|
} while (0);
|
||||||
|
|
||||||
#define GET_IO_SLOT_AND_CTOR(x, map, slot, type, ctor, fdinfo_len) \
|
#define GET_IO_SLOT_AND_CTOR(x, map, slot, type, ctor, fdinfo_len) \
|
||||||
do { \
|
do { \
|
||||||
struct event_map_entry _key, *_ent; \
|
struct event_map_entry key_, *ent_; \
|
||||||
_key.fd = slot; \
|
key_.fd = slot; \
|
||||||
HT_FIND_OR_INSERT_(event_io_map, map_node, hashsocket, map, \
|
HT_FIND_OR_INSERT_(event_io_map, map_node, hashsocket, map, \
|
||||||
event_map_entry, &_key, ptr, \
|
event_map_entry, &key_, ptr, \
|
||||||
{ \
|
{ \
|
||||||
_ent = *ptr; \
|
ent_ = *ptr; \
|
||||||
}, \
|
}, \
|
||||||
{ \
|
{ \
|
||||||
_ent = mm_calloc(1,sizeof(struct event_map_entry)+fdinfo_len); \
|
ent_ = mm_calloc(1,sizeof(struct event_map_entry)+fdinfo_len); \
|
||||||
if (EVUTIL_UNLIKELY(_ent == NULL)) \
|
if (EVUTIL_UNLIKELY(ent_ == NULL)) \
|
||||||
return (-1); \
|
return (-1); \
|
||||||
_ent->fd = slot; \
|
ent_->fd = slot; \
|
||||||
(ctor)(&_ent->ent.type); \
|
(ctor)(&ent_->ent.type); \
|
||||||
HT_FOI_INSERT_(map_node, map, &_key, _ent, ptr) \
|
HT_FOI_INSERT_(map_node, map, &key_, ent_, ptr) \
|
||||||
}); \
|
}); \
|
||||||
(x) = &_ent->ent.type; \
|
(x) = &ent_->ent.type; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
void evmap_io_initmap_(struct event_io_map *ctx)
|
void evmap_io_initmap_(struct event_io_map *ctx)
|
||||||
|
@ -81,9 +81,9 @@ extern int evthread_lock_debugging_enabled_;
|
|||||||
/** Free a given lock, if it is present and locking is enabled. */
|
/** Free a given lock, if it is present and locking is enabled. */
|
||||||
#define EVTHREAD_FREE_LOCK(lockvar, locktype) \
|
#define EVTHREAD_FREE_LOCK(lockvar, locktype) \
|
||||||
do { \
|
do { \
|
||||||
void *_lock_tmp_ = (lockvar); \
|
void *lock_tmp_ = (lockvar); \
|
||||||
if (_lock_tmp_ && evthread_lock_fns_.free) \
|
if (lock_tmp_ && evthread_lock_fns_.free) \
|
||||||
evthread_lock_fns_.free(_lock_tmp_, (locktype)); \
|
evthread_lock_fns_.free(lock_tmp_, (locktype)); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
/** Acquire a lock. */
|
/** Acquire a lock. */
|
||||||
@ -205,9 +205,9 @@ int evthreadimpl_locking_enabled_(void);
|
|||||||
|
|
||||||
#define EVTHREAD_FREE_LOCK(lockvar, locktype) \
|
#define EVTHREAD_FREE_LOCK(lockvar, locktype) \
|
||||||
do { \
|
do { \
|
||||||
void *_lock_tmp_ = (lockvar); \
|
void *lock_tmp_ = (lockvar); \
|
||||||
if (_lock_tmp_) \
|
if (lock_tmp_) \
|
||||||
evthreadimpl_lock_free_(_lock_tmp_, (locktype)); \
|
evthreadimpl_lock_free_(lock_tmp_, (locktype)); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
/** Acquire a lock. */
|
/** Acquire a lock. */
|
||||||
@ -337,22 +337,22 @@ EVLOCK_TRY_LOCK_(void *lock)
|
|||||||
* so that two threads locking two locks with LOCK2 will not deadlock. */
|
* so that two threads locking two locks with LOCK2 will not deadlock. */
|
||||||
#define EVLOCK_LOCK2(lock1,lock2,mode1,mode2) \
|
#define EVLOCK_LOCK2(lock1,lock2,mode1,mode2) \
|
||||||
do { \
|
do { \
|
||||||
void *_lock1_tmplock = (lock1); \
|
void *lock1_tmplock_ = (lock1); \
|
||||||
void *_lock2_tmplock = (lock2); \
|
void *lock2_tmplock_ = (lock2); \
|
||||||
EVLOCK_SORTLOCKS_(_lock1_tmplock,_lock2_tmplock); \
|
EVLOCK_SORTLOCKS_(lock1_tmplock_,lock2_tmplock_); \
|
||||||
EVLOCK_LOCK(_lock1_tmplock,mode1); \
|
EVLOCK_LOCK(lock1_tmplock_,mode1); \
|
||||||
if (_lock2_tmplock != _lock1_tmplock) \
|
if (lock2_tmplock_ != lock1_tmplock_) \
|
||||||
EVLOCK_LOCK(_lock2_tmplock,mode2); \
|
EVLOCK_LOCK(lock2_tmplock_,mode2); \
|
||||||
} while (0)
|
} while (0)
|
||||||
/** Release both lock1 and lock2. */
|
/** Release both lock1 and lock2. */
|
||||||
#define EVLOCK_UNLOCK2(lock1,lock2,mode1,mode2) \
|
#define EVLOCK_UNLOCK2(lock1,lock2,mode1,mode2) \
|
||||||
do { \
|
do { \
|
||||||
void *_lock1_tmplock = (lock1); \
|
void *lock1_tmplock_ = (lock1); \
|
||||||
void *_lock2_tmplock = (lock2); \
|
void *lock2_tmplock_ = (lock2); \
|
||||||
EVLOCK_SORTLOCKS_(_lock1_tmplock,_lock2_tmplock); \
|
EVLOCK_SORTLOCKS_(lock1_tmplock_,lock2_tmplock_); \
|
||||||
if (_lock2_tmplock != _lock1_tmplock) \
|
if (lock2_tmplock_ != lock1_tmplock_) \
|
||||||
EVLOCK_UNLOCK(_lock2_tmplock,mode2); \
|
EVLOCK_UNLOCK(lock2_tmplock_,mode2); \
|
||||||
EVLOCK_UNLOCK(_lock1_tmplock,mode1); \
|
EVLOCK_UNLOCK(lock1_tmplock_,mode1); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
int evthread_is_debug_lock_held_(void *lock);
|
int evthread_is_debug_lock_held_(void *lock);
|
||||||
|
@ -262,15 +262,15 @@ debug_lock_unlock(unsigned mode, void *lock_)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
debug_cond_wait(void *_cond, void *_lock, const struct timeval *tv)
|
debug_cond_wait(void *cond_, void *lock_, const struct timeval *tv)
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
struct debug_lock *lock = _lock;
|
struct debug_lock *lock = lock_;
|
||||||
EVUTIL_ASSERT(lock);
|
EVUTIL_ASSERT(lock);
|
||||||
EVUTIL_ASSERT(DEBUG_LOCK_SIG == lock->signature);
|
EVUTIL_ASSERT(DEBUG_LOCK_SIG == lock->signature);
|
||||||
EVLOCK_ASSERT_LOCKED(_lock);
|
EVLOCK_ASSERT_LOCKED(lock_);
|
||||||
evthread_debug_lock_mark_unlocked(0, lock);
|
evthread_debug_lock_mark_unlocked(0, lock);
|
||||||
r = original_cond_fns_.wait_condition(_cond, lock->lock, tv);
|
r = original_cond_fns_.wait_condition(cond_, lock->lock, tv);
|
||||||
evthread_debug_lock_mark_locked(0, lock);
|
evthread_debug_lock_mark_locked(0, lock);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
@ -58,17 +58,17 @@ evthread_posix_lock_alloc(unsigned locktype)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
evthread_posix_lock_free(void *_lock, unsigned locktype)
|
evthread_posix_lock_free(void *lock_, unsigned locktype)
|
||||||
{
|
{
|
||||||
pthread_mutex_t *lock = _lock;
|
pthread_mutex_t *lock = lock_;
|
||||||
pthread_mutex_destroy(lock);
|
pthread_mutex_destroy(lock);
|
||||||
mm_free(lock);
|
mm_free(lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
evthread_posix_lock(unsigned mode, void *_lock)
|
evthread_posix_lock(unsigned mode, void *lock_)
|
||||||
{
|
{
|
||||||
pthread_mutex_t *lock = _lock;
|
pthread_mutex_t *lock = lock_;
|
||||||
if (mode & EVTHREAD_TRY)
|
if (mode & EVTHREAD_TRY)
|
||||||
return pthread_mutex_trylock(lock);
|
return pthread_mutex_trylock(lock);
|
||||||
else
|
else
|
||||||
@ -76,9 +76,9 @@ evthread_posix_lock(unsigned mode, void *_lock)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
evthread_posix_unlock(unsigned mode, void *_lock)
|
evthread_posix_unlock(unsigned mode, void *lock_)
|
||||||
{
|
{
|
||||||
pthread_mutex_t *lock = _lock;
|
pthread_mutex_t *lock = lock_;
|
||||||
return pthread_mutex_unlock(lock);
|
return pthread_mutex_unlock(lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,17 +114,17 @@ evthread_posix_cond_alloc(unsigned condflags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
evthread_posix_cond_free(void *_cond)
|
evthread_posix_cond_free(void *cond_)
|
||||||
{
|
{
|
||||||
pthread_cond_t *cond = _cond;
|
pthread_cond_t *cond = cond_;
|
||||||
pthread_cond_destroy(cond);
|
pthread_cond_destroy(cond);
|
||||||
mm_free(cond);
|
mm_free(cond);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
evthread_posix_cond_signal(void *_cond, int broadcast)
|
evthread_posix_cond_signal(void *cond_, int broadcast)
|
||||||
{
|
{
|
||||||
pthread_cond_t *cond = _cond;
|
pthread_cond_t *cond = cond_;
|
||||||
int r;
|
int r;
|
||||||
if (broadcast)
|
if (broadcast)
|
||||||
r = pthread_cond_broadcast(cond);
|
r = pthread_cond_broadcast(cond);
|
||||||
@ -134,11 +134,11 @@ evthread_posix_cond_signal(void *_cond, int broadcast)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
evthread_posix_cond_wait(void *_cond, void *_lock, const struct timeval *tv)
|
evthread_posix_cond_wait(void *cond_, void *lock_, const struct timeval *tv)
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
pthread_cond_t *cond = _cond;
|
pthread_cond_t *cond = cond_;
|
||||||
pthread_mutex_t *lock = _lock;
|
pthread_mutex_t *lock = lock_;
|
||||||
|
|
||||||
if (tv) {
|
if (tv) {
|
||||||
struct timeval now, abstime;
|
struct timeval now, abstime;
|
||||||
|
@ -60,17 +60,17 @@ evthread_win32_lock_create(unsigned locktype)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
evthread_win32_lock_free(void *_lock, unsigned locktype)
|
evthread_win32_lock_free(void *lock_, unsigned locktype)
|
||||||
{
|
{
|
||||||
CRITICAL_SECTION *lock = _lock;
|
CRITICAL_SECTION *lock = lock_;
|
||||||
DeleteCriticalSection(lock);
|
DeleteCriticalSection(lock);
|
||||||
mm_free(lock);
|
mm_free(lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
evthread_win32_lock(unsigned mode, void *_lock)
|
evthread_win32_lock(unsigned mode, void *lock_)
|
||||||
{
|
{
|
||||||
CRITICAL_SECTION *lock = _lock;
|
CRITICAL_SECTION *lock = lock_;
|
||||||
if ((mode & EVTHREAD_TRY)) {
|
if ((mode & EVTHREAD_TRY)) {
|
||||||
return ! TryEnterCriticalSection(lock);
|
return ! TryEnterCriticalSection(lock);
|
||||||
} else {
|
} else {
|
||||||
@ -80,9 +80,9 @@ evthread_win32_lock(unsigned mode, void *_lock)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
evthread_win32_unlock(unsigned mode, void *_lock)
|
evthread_win32_unlock(unsigned mode, void *lock_)
|
||||||
{
|
{
|
||||||
CRITICAL_SECTION *lock = _lock;
|
CRITICAL_SECTION *lock = lock_;
|
||||||
LeaveCriticalSection(lock);
|
LeaveCriticalSection(lock);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -134,17 +134,17 @@ evthread_win32_condvar_alloc(unsigned condflags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
evthread_win32_condvar_free(void *_cond)
|
evthread_win32_condvar_free(void *cond_)
|
||||||
{
|
{
|
||||||
CONDITION_VARIABLE *cond = _cond;
|
CONDITION_VARIABLE *cond = cond_;
|
||||||
/* There doesn't _seem_ to be a cleaup fn here... */
|
/* There doesn't _seem_ to be a cleaup fn here... */
|
||||||
mm_free(cond);
|
mm_free(cond);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
evthread_win32_condvar_signal(void *_cond, int broadcast)
|
evthread_win32_condvar_signal(void *cond, int broadcast)
|
||||||
{
|
{
|
||||||
CONDITION_VARIABLE *cond = _cond;
|
CONDITION_VARIABLE *cond = cond_;
|
||||||
if (broadcast)
|
if (broadcast)
|
||||||
WakeAllConditionVariable_fn(cond);
|
WakeAllConditionVariable_fn(cond);
|
||||||
else
|
else
|
||||||
@ -153,10 +153,10 @@ evthread_win32_condvar_signal(void *_cond, int broadcast)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
evthread_win32_condvar_wait(void *_cond, void *_lock, const struct timeval *tv)
|
evthread_win32_condvar_wait(void *cond_, void *lock_, const struct timeval *tv)
|
||||||
{
|
{
|
||||||
CONDITION_VARIABLE *cond = _cond;
|
CONDITION_VARIABLE *cond = cond_;
|
||||||
CRITICAL_SECTION *lock = _lock;
|
CRITICAL_SECTION *lock = lock_;
|
||||||
DWORD ms, err;
|
DWORD ms, err;
|
||||||
BOOL result;
|
BOOL result;
|
||||||
|
|
||||||
@ -205,18 +205,18 @@ evthread_win32_cond_alloc(unsigned flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
evthread_win32_cond_free(void *_cond)
|
evthread_win32_cond_free(void *cond_)
|
||||||
{
|
{
|
||||||
struct evthread_win32_cond *cond = _cond;
|
struct evthread_win32_cond *cond = cond_;
|
||||||
DeleteCriticalSection(&cond->lock);
|
DeleteCriticalSection(&cond->lock);
|
||||||
CloseHandle(cond->event);
|
CloseHandle(cond->event);
|
||||||
mm_free(cond);
|
mm_free(cond);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
evthread_win32_cond_signal(void *_cond, int broadcast)
|
evthread_win32_cond_signal(void *cond_, int broadcast)
|
||||||
{
|
{
|
||||||
struct evthread_win32_cond *cond = _cond;
|
struct evthread_win32_cond *cond = cond_;
|
||||||
EnterCriticalSection(&cond->lock);
|
EnterCriticalSection(&cond->lock);
|
||||||
if (broadcast)
|
if (broadcast)
|
||||||
cond->n_to_wake = cond->n_waiting;
|
cond->n_to_wake = cond->n_waiting;
|
||||||
@ -229,10 +229,10 @@ evthread_win32_cond_signal(void *_cond, int broadcast)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
evthread_win32_cond_wait(void *_cond, void *_lock, const struct timeval *tv)
|
evthread_win32_cond_wait(void *cond_, void *lock_, const struct timeval *tv)
|
||||||
{
|
{
|
||||||
struct evthread_win32_cond *cond = _cond;
|
struct evthread_win32_cond *cond = cond_;
|
||||||
CRITICAL_SECTION *lock = _lock;
|
CRITICAL_SECTION *lock = lock_;
|
||||||
int generation_at_start;
|
int generation_at_start;
|
||||||
int waiting = 1;
|
int waiting = 1;
|
||||||
int result = -1;
|
int result = -1;
|
||||||
|
2
evutil.c
2
evutil.c
@ -2359,7 +2359,7 @@ evutil_usleep_(const struct timeval *tv)
|
|||||||
long msec = evutil_tv_to_msec_(tv);
|
long msec = evutil_tv_to_msec_(tv);
|
||||||
Sleep((DWORD)msec);
|
Sleep((DWORD)msec);
|
||||||
}
|
}
|
||||||
#elif defined(_EVENT_HAVE_NANOSLEEP_X)
|
#elif defined(EVENT__HAVE_NANOSLEEP_XXX)
|
||||||
{
|
{
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
ts.tv_sec = tv->tv_sec;
|
ts.tv_sec = tv->tv_sec;
|
||||||
|
@ -87,7 +87,7 @@ ev_arc4random_buf(void *buf, size_t n)
|
|||||||
#else /* !EVENT__HAVE_ARC4RANDOM { */
|
#else /* !EVENT__HAVE_ARC4RANDOM { */
|
||||||
|
|
||||||
#ifdef EVENT__ssize_t
|
#ifdef EVENT__ssize_t
|
||||||
#define ssize_t _EVENT_SSIZE_t
|
#define ssize_t EVENT__ssize_t
|
||||||
#endif
|
#endif
|
||||||
#define ARC4RANDOM_EXPORT static
|
#define ARC4RANDOM_EXPORT static
|
||||||
#define ARC4_LOCK_() EVLOCK_LOCK(arc4rand_lock, 0)
|
#define ARC4_LOCK_() EVLOCK_LOCK(arc4rand_lock, 0)
|
||||||
|
@ -601,7 +601,7 @@ struct sockaddr;
|
|||||||
/**
|
/**
|
||||||
Get the address that made a DNS request.
|
Get the address that made a DNS request.
|
||||||
*/
|
*/
|
||||||
int evdns_server_request_get_requesting_addr(struct evdns_server_request *_req, struct sockaddr *sa, int addr_len);
|
int evdns_server_request_get_requesting_addr(struct evdns_server_request *req, struct sockaddr *sa, int addr_len);
|
||||||
|
|
||||||
/** Callback for evdns_getaddrinfo. */
|
/** Callback for evdns_getaddrinfo. */
|
||||||
typedef void (*evdns_getaddrinfo_cb)(int result, struct evutil_addrinfo *res, void *arg);
|
typedef void (*evdns_getaddrinfo_cb)(int result, struct evutil_addrinfo *res, void *arg);
|
||||||
|
@ -272,8 +272,8 @@ void *evrpc_get_reply(struct evrpc_req_generic *req);
|
|||||||
* @param rpc_req the rpc request structure provided to the server callback
|
* @param rpc_req the rpc request structure provided to the server callback
|
||||||
*/
|
*/
|
||||||
#define EVRPC_REQUEST_DONE(rpc_req) do { \
|
#define EVRPC_REQUEST_DONE(rpc_req) do { \
|
||||||
struct evrpc_req_generic *_req = (struct evrpc_req_generic *)(rpc_req); \
|
struct evrpc_req_generic *req_ = (struct evrpc_req_generic *)(rpc_req); \
|
||||||
evrpc_request_done(_req); \
|
evrpc_request_done(req_); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
|
@ -70,8 +70,8 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Some openbsd autoconf versions get the name of this macro wrong. */
|
/* Some openbsd autoconf versions get the name of this macro wrong. */
|
||||||
#if defined(_EVENT_SIZEOF_VOID__) && !defined(EVENT__SIZEOF_VOID_P)
|
#if defined(EVENT__SIZEOF_VOID__) && !defined(EVENT__SIZEOF_VOID_P)
|
||||||
#define EVENT__SIZEOF_VOID_P _EVENT_SIZEOF_VOID__
|
#define EVENT__SIZEOF_VOID_P EVENT__SIZEOF_VOID__
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -422,7 +422,7 @@ const char *evutil_socket_error_to_string(int errcode);
|
|||||||
(vvp)->tv_usec += 1000000; \
|
(vvp)->tv_usec += 1000000; \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
#endif /* !_EVENT_HAVE_HAVE_TIMERADD */
|
#endif /* !EVENT__HAVE_TIMERADD */
|
||||||
|
|
||||||
#ifdef EVENT__HAVE_TIMERCLEAR
|
#ifdef EVENT__HAVE_TIMERCLEAR
|
||||||
#define evutil_timerclear(tvp) timerclear(tvp)
|
#define evutil_timerclear(tvp) timerclear(tvp)
|
||||||
|
12
poll.c
12
poll.c
@ -66,8 +66,8 @@ struct pollop {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static void *poll_init(struct event_base *);
|
static void *poll_init(struct event_base *);
|
||||||
static int poll_add(struct event_base *, int, short old, short events, void *_idx);
|
static int poll_add(struct event_base *, int, short old, short events, void *idx);
|
||||||
static int poll_del(struct event_base *, int, short old, short events, void *_idx);
|
static int poll_del(struct event_base *, int, short old, short events, void *idx);
|
||||||
static int poll_dispatch(struct event_base *, struct timeval *);
|
static int poll_dispatch(struct event_base *, struct timeval *);
|
||||||
static void poll_dealloc(struct event_base *);
|
static void poll_dealloc(struct event_base *);
|
||||||
|
|
||||||
@ -211,11 +211,11 @@ poll_dispatch(struct event_base *base, struct timeval *tv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
poll_add(struct event_base *base, int fd, short old, short events, void *_idx)
|
poll_add(struct event_base *base, int fd, short old, short events, void *idx_)
|
||||||
{
|
{
|
||||||
struct pollop *pop = base->evbase;
|
struct pollop *pop = base->evbase;
|
||||||
struct pollfd *pfd = NULL;
|
struct pollfd *pfd = NULL;
|
||||||
struct pollidx *idx = _idx;
|
struct pollidx *idx = idx_;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
EVUTIL_ASSERT((events & EV_SIGNAL) == 0);
|
EVUTIL_ASSERT((events & EV_SIGNAL) == 0);
|
||||||
@ -272,11 +272,11 @@ poll_add(struct event_base *base, int fd, short old, short events, void *_idx)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static int
|
static int
|
||||||
poll_del(struct event_base *base, int fd, short old, short events, void *_idx)
|
poll_del(struct event_base *base, int fd, short old, short events, void *idx_)
|
||||||
{
|
{
|
||||||
struct pollop *pop = base->evbase;
|
struct pollop *pop = base->evbase;
|
||||||
struct pollfd *pfd = NULL;
|
struct pollfd *pfd = NULL;
|
||||||
struct pollidx *idx = _idx;
|
struct pollidx *idx = idx_;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
EVUTIL_ASSERT((events & EV_SIGNAL) == 0);
|
EVUTIL_ASSERT((events & EV_SIGNAL) == 0);
|
||||||
|
@ -1891,7 +1891,7 @@ end:
|
|||||||
#ifdef EVENT__HAVE_SETENV
|
#ifdef EVENT__HAVE_SETENV
|
||||||
#define SETENV_OK
|
#define SETENV_OK
|
||||||
#elif !defined(EVENT__HAVE_SETENV) && defined(EVENT__HAVE_PUTENV)
|
#elif !defined(EVENT__HAVE_SETENV) && defined(EVENT__HAVE_PUTENV)
|
||||||
static void setenv(const char *k, const char *v, int _o)
|
static void setenv(const char *k, const char *v, int o_)
|
||||||
{
|
{
|
||||||
char b[256];
|
char b[256];
|
||||||
evutil_snprintf(b, sizeof(b), "%s=%s",k,v);
|
evutil_snprintf(b, sizeof(b), "%s=%s",k,v);
|
||||||
@ -2195,9 +2195,9 @@ test_mm_functions(void *arg)
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
static int
|
static int
|
||||||
check_dummy_mem_ok(void *_mem)
|
check_dummy_mem_ok(void *mem_)
|
||||||
{
|
{
|
||||||
char *mem = _mem;
|
char *mem = mem_;
|
||||||
mem -= 16;
|
mem -= 16;
|
||||||
return !memcmp(mem, "{[<guardedram>]}", 16);
|
return !memcmp(mem, "{[<guardedram>]}", 16);
|
||||||
}
|
}
|
||||||
@ -2211,22 +2211,22 @@ dummy_malloc(size_t len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void *
|
static void *
|
||||||
dummy_realloc(void *_mem, size_t len)
|
dummy_realloc(void *mem_, size_t len)
|
||||||
{
|
{
|
||||||
char *mem = _mem;
|
char *mem = mem_;
|
||||||
if (!mem)
|
if (!mem)
|
||||||
return dummy_malloc(len);
|
return dummy_malloc(len);
|
||||||
tt_want(check_dummy_mem_ok(_mem));
|
tt_want(check_dummy_mem_ok(mem_));
|
||||||
mem -= 16;
|
mem -= 16;
|
||||||
mem = realloc(mem, len+16);
|
mem = realloc(mem, len+16);
|
||||||
return mem+16;
|
return mem+16;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
dummy_free(void *_mem)
|
dummy_free(void *mem_)
|
||||||
{
|
{
|
||||||
char *mem = _mem;
|
char *mem = mem_;
|
||||||
tt_want(check_dummy_mem_ok(_mem));
|
tt_want(check_dummy_mem_ok(mem_));
|
||||||
mem -= 16;
|
mem -= 16;
|
||||||
free(mem);
|
free(mem);
|
||||||
}
|
}
|
||||||
|
@ -80,8 +80,8 @@ struct win32op {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static void *win32_init(struct event_base *);
|
static void *win32_init(struct event_base *);
|
||||||
static int win32_add(struct event_base *, evutil_socket_t, short old, short events, void *_idx);
|
static int win32_add(struct event_base *, evutil_socket_t, short old, short events, void *idx_);
|
||||||
static int win32_del(struct event_base *, evutil_socket_t, short old, short events, void *_idx);
|
static int win32_del(struct event_base *, evutil_socket_t, short old, short events, void *idx_);
|
||||||
static int win32_dispatch(struct event_base *base, struct timeval *);
|
static int win32_dispatch(struct event_base *base, struct timeval *);
|
||||||
static void win32_dealloc(struct event_base *);
|
static void win32_dealloc(struct event_base *);
|
||||||
|
|
||||||
@ -177,7 +177,7 @@ do_fd_clear(struct event_base *base,
|
|||||||
|
|
||||||
#define NEVENT 32
|
#define NEVENT 32
|
||||||
void *
|
void *
|
||||||
win32_init(struct event_base *_base)
|
win32_init(struct event_base *base)
|
||||||
{
|
{
|
||||||
struct win32op *winop;
|
struct win32op *winop;
|
||||||
size_t size;
|
size_t size;
|
||||||
@ -199,7 +199,7 @@ win32_init(struct event_base *_base)
|
|||||||
winop->readset_out->fd_count = winop->writeset_out->fd_count
|
winop->readset_out->fd_count = winop->writeset_out->fd_count
|
||||||
= winop->exset_out->fd_count = 0;
|
= winop->exset_out->fd_count = 0;
|
||||||
|
|
||||||
if (evsig_init_(_base) < 0)
|
if (evsig_init_(base) < 0)
|
||||||
winop->signals_are_broken = 1;
|
winop->signals_are_broken = 1;
|
||||||
|
|
||||||
return (winop);
|
return (winop);
|
||||||
@ -215,10 +215,10 @@ win32_init(struct event_base *_base)
|
|||||||
|
|
||||||
int
|
int
|
||||||
win32_add(struct event_base *base, evutil_socket_t fd,
|
win32_add(struct event_base *base, evutil_socket_t fd,
|
||||||
short old, short events, void *_idx)
|
short old, short events, void *idx_)
|
||||||
{
|
{
|
||||||
struct win32op *win32op = base->evbase;
|
struct win32op *win32op = base->evbase;
|
||||||
struct idx_info *idx = _idx;
|
struct idx_info *idx = idx_;
|
||||||
|
|
||||||
if ((events & EV_SIGNAL) && win32op->signals_are_broken)
|
if ((events & EV_SIGNAL) && win32op->signals_are_broken)
|
||||||
return (-1);
|
return (-1);
|
||||||
@ -240,10 +240,10 @@ win32_add(struct event_base *base, evutil_socket_t fd,
|
|||||||
|
|
||||||
int
|
int
|
||||||
win32_del(struct event_base *base, evutil_socket_t fd, short old, short events,
|
win32_del(struct event_base *base, evutil_socket_t fd, short old, short events,
|
||||||
void *_idx)
|
void *idx_)
|
||||||
{
|
{
|
||||||
struct win32op *win32op = base->evbase;
|
struct win32op *win32op = base->evbase;
|
||||||
struct idx_info *idx = _idx;
|
struct idx_info *idx = idx_;
|
||||||
|
|
||||||
event_debug(("%s: Removing event for %d", __func__, fd));
|
event_debug(("%s: Removing event for %d", __func__, fd));
|
||||||
if (events & EV_READ)
|
if (events & EV_READ)
|
||||||
@ -357,11 +357,11 @@ win32_dispatch(struct event_base *base, struct timeval *tv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
win32_dealloc(struct event_base *_base)
|
win32_dealloc(struct event_base *base)
|
||||||
{
|
{
|
||||||
struct win32op *win32op = _base->evbase;
|
struct win32op *win32op = base->evbase;
|
||||||
|
|
||||||
evsig_dealloc_(_base);
|
evsig_dealloc_(base);
|
||||||
if (win32op->readset_in)
|
if (win32op->readset_in)
|
||||||
mm_free(win32op->readset_in);
|
mm_free(win32op->readset_in);
|
||||||
if (win32op->writeset_in)
|
if (win32op->writeset_in)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user