mirror of
https://github.com/cuberite/libevent.git
synced 2025-08-03 09:16:30 -04:00
Clean up lingering _identifiers.
This commit is contained in:
parent
c7848fa019
commit
946b5841c2
@ -479,9 +479,9 @@ arc4random(void)
|
||||
#endif
|
||||
|
||||
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_stir_if_needed();
|
||||
while (n--) {
|
||||
|
@ -131,7 +131,7 @@ bufferevent_inbuf_wm_cb(struct evbuffer *buf,
|
||||
}
|
||||
|
||||
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 *bufev = &bufev_private->bev;
|
||||
@ -164,7 +164,7 @@ bufferevent_run_deferred_callbacks_locked(struct deferred_cb *_, void *arg)
|
||||
}
|
||||
|
||||
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 *bufev = &bufev_private->bev;
|
||||
@ -608,7 +608,7 @@ bufferevent_incref_and_lock_(struct bufferevent *bufev)
|
||||
|
||||
#if 0
|
||||
static void
|
||||
_bufferevent_transfer_lock_ownership(struct bufferevent *donor,
|
||||
bufferevent_transfer_lock_ownership_(struct bufferevent *donor,
|
||||
struct bufferevent *recipient)
|
||||
{
|
||||
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. */
|
||||
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_flush_mode state;
|
||||
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
|
||||
it. */
|
||||
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);
|
||||
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 */
|
||||
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);
|
||||
|
||||
bufferevent_incref_and_lock_(bev);
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* evconfig-private.h template - see "Configuration Header Templates" */
|
||||
/* in AC manual. Kevin Bowling <kevin.bowling@kev009.com */
|
||||
#ifndef _EVENT_EVCONFIG__PRIVATE_H
|
||||
#define _EVENT_EVCONFIG__PRIVATE_H
|
||||
#ifndef EVCONFIG_PRIVATE_H_INCLUDED_
|
||||
#define EVCONFIG_PRIVATE_H_INCLUDED_
|
||||
|
||||
/* Enable extensions on AIX 3, Interix. */
|
||||
#ifndef _ALL_SOURCE
|
||||
|
16
evdns.c
16
evdns.c
@ -1736,9 +1736,9 @@ evdns_close_server_port(struct evdns_server_port *port)
|
||||
|
||||
/* exported function */
|
||||
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;
|
||||
int *countp;
|
||||
int result = -1;
|
||||
@ -1966,9 +1966,9 @@ overflow:
|
||||
|
||||
/* exported function */
|
||||
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;
|
||||
int r = -1;
|
||||
|
||||
@ -2114,18 +2114,18 @@ server_port_free(struct evdns_server_port *port)
|
||||
|
||||
/* exported function */
|
||||
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);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* exported function */
|
||||
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)
|
||||
return -1;
|
||||
memcpy(sa, &(req->addr), req->addrlen);
|
||||
|
@ -61,9 +61,9 @@ handle_entry(OVERLAPPED *o, ULONG_PTR completion_key, DWORD nBytes, int ok)
|
||||
}
|
||||
|
||||
static void
|
||||
loop(void *_port)
|
||||
loop(void *port_)
|
||||
{
|
||||
struct event_iocp_port *port = _port;
|
||||
struct event_iocp_port *port = port_;
|
||||
long ms = port->ms;
|
||||
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) \
|
||||
do { \
|
||||
struct event_map_entry _key, *_ent; \
|
||||
_key.fd = slot; \
|
||||
_ent = HT_FIND(event_io_map, map, &_key); \
|
||||
(x) = _ent ? &_ent->ent.type : NULL; \
|
||||
struct event_map_entry key_, *ent_; \
|
||||
key_.fd = slot; \
|
||||
ent_ = HT_FIND(event_io_map, map, &key_); \
|
||||
(x) = ent_ ? &ent_->ent.type : NULL; \
|
||||
} while (0);
|
||||
|
||||
#define GET_IO_SLOT_AND_CTOR(x, map, slot, type, ctor, fdinfo_len) \
|
||||
do { \
|
||||
struct event_map_entry _key, *_ent; \
|
||||
_key.fd = slot; \
|
||||
struct event_map_entry key_, *ent_; \
|
||||
key_.fd = slot; \
|
||||
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); \
|
||||
if (EVUTIL_UNLIKELY(_ent == NULL)) \
|
||||
ent_ = mm_calloc(1,sizeof(struct event_map_entry)+fdinfo_len); \
|
||||
if (EVUTIL_UNLIKELY(ent_ == NULL)) \
|
||||
return (-1); \
|
||||
_ent->fd = slot; \
|
||||
(ctor)(&_ent->ent.type); \
|
||||
HT_FOI_INSERT_(map_node, map, &_key, _ent, ptr) \
|
||||
ent_->fd = slot; \
|
||||
(ctor)(&ent_->ent.type); \
|
||||
HT_FOI_INSERT_(map_node, map, &key_, ent_, ptr) \
|
||||
}); \
|
||||
(x) = &_ent->ent.type; \
|
||||
(x) = &ent_->ent.type; \
|
||||
} while (0)
|
||||
|
||||
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. */
|
||||
#define EVTHREAD_FREE_LOCK(lockvar, locktype) \
|
||||
do { \
|
||||
void *_lock_tmp_ = (lockvar); \
|
||||
if (_lock_tmp_ && evthread_lock_fns_.free) \
|
||||
evthread_lock_fns_.free(_lock_tmp_, (locktype)); \
|
||||
void *lock_tmp_ = (lockvar); \
|
||||
if (lock_tmp_ && evthread_lock_fns_.free) \
|
||||
evthread_lock_fns_.free(lock_tmp_, (locktype)); \
|
||||
} while (0)
|
||||
|
||||
/** Acquire a lock. */
|
||||
@ -205,9 +205,9 @@ int evthreadimpl_locking_enabled_(void);
|
||||
|
||||
#define EVTHREAD_FREE_LOCK(lockvar, locktype) \
|
||||
do { \
|
||||
void *_lock_tmp_ = (lockvar); \
|
||||
if (_lock_tmp_) \
|
||||
evthreadimpl_lock_free_(_lock_tmp_, (locktype)); \
|
||||
void *lock_tmp_ = (lockvar); \
|
||||
if (lock_tmp_) \
|
||||
evthreadimpl_lock_free_(lock_tmp_, (locktype)); \
|
||||
} while (0)
|
||||
|
||||
/** Acquire a lock. */
|
||||
@ -337,22 +337,22 @@ EVLOCK_TRY_LOCK_(void *lock)
|
||||
* so that two threads locking two locks with LOCK2 will not deadlock. */
|
||||
#define EVLOCK_LOCK2(lock1,lock2,mode1,mode2) \
|
||||
do { \
|
||||
void *_lock1_tmplock = (lock1); \
|
||||
void *_lock2_tmplock = (lock2); \
|
||||
EVLOCK_SORTLOCKS_(_lock1_tmplock,_lock2_tmplock); \
|
||||
EVLOCK_LOCK(_lock1_tmplock,mode1); \
|
||||
if (_lock2_tmplock != _lock1_tmplock) \
|
||||
EVLOCK_LOCK(_lock2_tmplock,mode2); \
|
||||
void *lock1_tmplock_ = (lock1); \
|
||||
void *lock2_tmplock_ = (lock2); \
|
||||
EVLOCK_SORTLOCKS_(lock1_tmplock_,lock2_tmplock_); \
|
||||
EVLOCK_LOCK(lock1_tmplock_,mode1); \
|
||||
if (lock2_tmplock_ != lock1_tmplock_) \
|
||||
EVLOCK_LOCK(lock2_tmplock_,mode2); \
|
||||
} while (0)
|
||||
/** Release both lock1 and lock2. */
|
||||
#define EVLOCK_UNLOCK2(lock1,lock2,mode1,mode2) \
|
||||
do { \
|
||||
void *_lock1_tmplock = (lock1); \
|
||||
void *_lock2_tmplock = (lock2); \
|
||||
EVLOCK_SORTLOCKS_(_lock1_tmplock,_lock2_tmplock); \
|
||||
if (_lock2_tmplock != _lock1_tmplock) \
|
||||
EVLOCK_UNLOCK(_lock2_tmplock,mode2); \
|
||||
EVLOCK_UNLOCK(_lock1_tmplock,mode1); \
|
||||
void *lock1_tmplock_ = (lock1); \
|
||||
void *lock2_tmplock_ = (lock2); \
|
||||
EVLOCK_SORTLOCKS_(lock1_tmplock_,lock2_tmplock_); \
|
||||
if (lock2_tmplock_ != lock1_tmplock_) \
|
||||
EVLOCK_UNLOCK(lock2_tmplock_,mode2); \
|
||||
EVLOCK_UNLOCK(lock1_tmplock_,mode1); \
|
||||
} while (0)
|
||||
|
||||
int evthread_is_debug_lock_held_(void *lock);
|
||||
|
@ -262,15 +262,15 @@ debug_lock_unlock(unsigned mode, void *lock_)
|
||||
}
|
||||
|
||||
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;
|
||||
struct debug_lock *lock = _lock;
|
||||
struct debug_lock *lock = lock_;
|
||||
EVUTIL_ASSERT(lock);
|
||||
EVUTIL_ASSERT(DEBUG_LOCK_SIG == lock->signature);
|
||||
EVLOCK_ASSERT_LOCKED(_lock);
|
||||
EVLOCK_ASSERT_LOCKED(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);
|
||||
return r;
|
||||
}
|
||||
|
@ -58,17 +58,17 @@ evthread_posix_lock_alloc(unsigned locktype)
|
||||
}
|
||||
|
||||
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);
|
||||
mm_free(lock);
|
||||
}
|
||||
|
||||
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)
|
||||
return pthread_mutex_trylock(lock);
|
||||
else
|
||||
@ -76,9 +76,9 @@ evthread_posix_lock(unsigned mode, void *_lock)
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@ -114,17 +114,17 @@ evthread_posix_cond_alloc(unsigned condflags)
|
||||
}
|
||||
|
||||
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);
|
||||
mm_free(cond);
|
||||
}
|
||||
|
||||
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;
|
||||
if (broadcast)
|
||||
r = pthread_cond_broadcast(cond);
|
||||
@ -134,11 +134,11 @@ evthread_posix_cond_signal(void *_cond, int broadcast)
|
||||
}
|
||||
|
||||
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;
|
||||
pthread_cond_t *cond = _cond;
|
||||
pthread_mutex_t *lock = _lock;
|
||||
pthread_cond_t *cond = cond_;
|
||||
pthread_mutex_t *lock = lock_;
|
||||
|
||||
if (tv) {
|
||||
struct timeval now, abstime;
|
||||
|
@ -60,17 +60,17 @@ evthread_win32_lock_create(unsigned locktype)
|
||||
}
|
||||
|
||||
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);
|
||||
mm_free(lock);
|
||||
}
|
||||
|
||||
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)) {
|
||||
return ! TryEnterCriticalSection(lock);
|
||||
} else {
|
||||
@ -80,9 +80,9 @@ evthread_win32_lock(unsigned mode, void *_lock)
|
||||
}
|
||||
|
||||
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);
|
||||
return 0;
|
||||
}
|
||||
@ -134,17 +134,17 @@ evthread_win32_condvar_alloc(unsigned condflags)
|
||||
}
|
||||
|
||||
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... */
|
||||
mm_free(cond);
|
||||
}
|
||||
|
||||
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)
|
||||
WakeAllConditionVariable_fn(cond);
|
||||
else
|
||||
@ -153,10 +153,10 @@ evthread_win32_condvar_signal(void *_cond, int broadcast)
|
||||
}
|
||||
|
||||
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;
|
||||
CRITICAL_SECTION *lock = _lock;
|
||||
CONDITION_VARIABLE *cond = cond_;
|
||||
CRITICAL_SECTION *lock = lock_;
|
||||
DWORD ms, err;
|
||||
BOOL result;
|
||||
|
||||
@ -205,18 +205,18 @@ evthread_win32_cond_alloc(unsigned flags)
|
||||
}
|
||||
|
||||
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);
|
||||
CloseHandle(cond->event);
|
||||
mm_free(cond);
|
||||
}
|
||||
|
||||
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);
|
||||
if (broadcast)
|
||||
cond->n_to_wake = cond->n_waiting;
|
||||
@ -229,10 +229,10 @@ evthread_win32_cond_signal(void *_cond, int broadcast)
|
||||
}
|
||||
|
||||
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;
|
||||
CRITICAL_SECTION *lock = _lock;
|
||||
struct evthread_win32_cond *cond = cond_;
|
||||
CRITICAL_SECTION *lock = lock_;
|
||||
int generation_at_start;
|
||||
int waiting = 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);
|
||||
Sleep((DWORD)msec);
|
||||
}
|
||||
#elif defined(_EVENT_HAVE_NANOSLEEP_X)
|
||||
#elif defined(EVENT__HAVE_NANOSLEEP_XXX)
|
||||
{
|
||||
struct timespec ts;
|
||||
ts.tv_sec = tv->tv_sec;
|
||||
|
@ -87,7 +87,7 @@ ev_arc4random_buf(void *buf, size_t n)
|
||||
#else /* !EVENT__HAVE_ARC4RANDOM { */
|
||||
|
||||
#ifdef EVENT__ssize_t
|
||||
#define ssize_t _EVENT_SSIZE_t
|
||||
#define ssize_t EVENT__ssize_t
|
||||
#endif
|
||||
#define ARC4RANDOM_EXPORT static
|
||||
#define ARC4_LOCK_() EVLOCK_LOCK(arc4rand_lock, 0)
|
||||
|
@ -601,7 +601,7 @@ struct sockaddr;
|
||||
/**
|
||||
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. */
|
||||
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
|
||||
*/
|
||||
#define EVRPC_REQUEST_DONE(rpc_req) do { \
|
||||
struct evrpc_req_generic *_req = (struct evrpc_req_generic *)(rpc_req); \
|
||||
evrpc_request_done(_req); \
|
||||
struct evrpc_req_generic *req_ = (struct evrpc_req_generic *)(rpc_req); \
|
||||
evrpc_request_done(req_); \
|
||||
} while (0)
|
||||
|
||||
|
||||
|
@ -70,8 +70,8 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/* Some openbsd autoconf versions get the name of this macro wrong. */
|
||||
#if defined(_EVENT_SIZEOF_VOID__) && !defined(EVENT__SIZEOF_VOID_P)
|
||||
#define EVENT__SIZEOF_VOID_P _EVENT_SIZEOF_VOID__
|
||||
#if defined(EVENT__SIZEOF_VOID__) && !defined(EVENT__SIZEOF_VOID_P)
|
||||
#define EVENT__SIZEOF_VOID_P EVENT__SIZEOF_VOID__
|
||||
#endif
|
||||
|
||||
/**
|
||||
@ -422,7 +422,7 @@ const char *evutil_socket_error_to_string(int errcode);
|
||||
(vvp)->tv_usec += 1000000; \
|
||||
} \
|
||||
} while (0)
|
||||
#endif /* !_EVENT_HAVE_HAVE_TIMERADD */
|
||||
#endif /* !EVENT__HAVE_TIMERADD */
|
||||
|
||||
#ifdef EVENT__HAVE_TIMERCLEAR
|
||||
#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 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_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_dispatch(struct event_base *, struct timeval *);
|
||||
static void poll_dealloc(struct event_base *);
|
||||
|
||||
@ -211,11 +211,11 @@ poll_dispatch(struct event_base *base, struct timeval *tv)
|
||||
}
|
||||
|
||||
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 pollfd *pfd = NULL;
|
||||
struct pollidx *idx = _idx;
|
||||
struct pollidx *idx = idx_;
|
||||
int i;
|
||||
|
||||
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
|
||||
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 pollfd *pfd = NULL;
|
||||
struct pollidx *idx = _idx;
|
||||
struct pollidx *idx = idx_;
|
||||
int i;
|
||||
|
||||
EVUTIL_ASSERT((events & EV_SIGNAL) == 0);
|
||||
|
@ -1891,7 +1891,7 @@ end:
|
||||
#ifdef EVENT__HAVE_SETENV
|
||||
#define SETENV_OK
|
||||
#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];
|
||||
evutil_snprintf(b, sizeof(b), "%s=%s",k,v);
|
||||
@ -2195,9 +2195,9 @@ test_mm_functions(void *arg)
|
||||
}
|
||||
#else
|
||||
static int
|
||||
check_dummy_mem_ok(void *_mem)
|
||||
check_dummy_mem_ok(void *mem_)
|
||||
{
|
||||
char *mem = _mem;
|
||||
char *mem = mem_;
|
||||
mem -= 16;
|
||||
return !memcmp(mem, "{[<guardedram>]}", 16);
|
||||
}
|
||||
@ -2211,22 +2211,22 @@ dummy_malloc(size_t len)
|
||||
}
|
||||
|
||||
static void *
|
||||
dummy_realloc(void *_mem, size_t len)
|
||||
dummy_realloc(void *mem_, size_t len)
|
||||
{
|
||||
char *mem = _mem;
|
||||
char *mem = mem_;
|
||||
if (!mem)
|
||||
return dummy_malloc(len);
|
||||
tt_want(check_dummy_mem_ok(_mem));
|
||||
tt_want(check_dummy_mem_ok(mem_));
|
||||
mem -= 16;
|
||||
mem = realloc(mem, len+16);
|
||||
return mem+16;
|
||||
}
|
||||
|
||||
static void
|
||||
dummy_free(void *_mem)
|
||||
dummy_free(void *mem_)
|
||||
{
|
||||
char *mem = _mem;
|
||||
tt_want(check_dummy_mem_ok(_mem));
|
||||
char *mem = mem_;
|
||||
tt_want(check_dummy_mem_ok(mem_));
|
||||
mem -= 16;
|
||||
free(mem);
|
||||
}
|
||||
|
@ -80,8 +80,8 @@ struct win32op {
|
||||
};
|
||||
|
||||
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_del(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_dispatch(struct event_base *base, struct timeval *);
|
||||
static void win32_dealloc(struct event_base *);
|
||||
|
||||
@ -177,7 +177,7 @@ do_fd_clear(struct event_base *base,
|
||||
|
||||
#define NEVENT 32
|
||||
void *
|
||||
win32_init(struct event_base *_base)
|
||||
win32_init(struct event_base *base)
|
||||
{
|
||||
struct win32op *winop;
|
||||
size_t size;
|
||||
@ -199,7 +199,7 @@ win32_init(struct event_base *_base)
|
||||
winop->readset_out->fd_count = winop->writeset_out->fd_count
|
||||
= winop->exset_out->fd_count = 0;
|
||||
|
||||
if (evsig_init_(_base) < 0)
|
||||
if (evsig_init_(base) < 0)
|
||||
winop->signals_are_broken = 1;
|
||||
|
||||
return (winop);
|
||||
@ -215,10 +215,10 @@ win32_init(struct event_base *_base)
|
||||
|
||||
int
|
||||
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 idx_info *idx = _idx;
|
||||
struct idx_info *idx = idx_;
|
||||
|
||||
if ((events & EV_SIGNAL) && win32op->signals_are_broken)
|
||||
return (-1);
|
||||
@ -240,10 +240,10 @@ win32_add(struct event_base *base, evutil_socket_t fd,
|
||||
|
||||
int
|
||||
win32_del(struct event_base *base, evutil_socket_t fd, short old, short events,
|
||||
void *_idx)
|
||||
void *idx_)
|
||||
{
|
||||
struct win32op *win32op = base->evbase;
|
||||
struct idx_info *idx = _idx;
|
||||
struct idx_info *idx = idx_;
|
||||
|
||||
event_debug(("%s: Removing event for %d", __func__, fd));
|
||||
if (events & EV_READ)
|
||||
@ -357,11 +357,11 @@ win32_dispatch(struct event_base *base, struct timeval *tv)
|
||||
}
|
||||
|
||||
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)
|
||||
mm_free(win32op->readset_in);
|
||||
if (win32op->writeset_in)
|
||||
|
Loading…
x
Reference in New Issue
Block a user