Skip to content

Commit

Permalink
Clean up lingering _identifiers.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmathewson committed Feb 29, 2012
1 parent c7848fa commit 946b584
Show file tree
Hide file tree
Showing 19 changed files with 126 additions and 126 deletions.
4 changes: 2 additions & 2 deletions arc4random.c
Original file line number Diff line number Diff line change
Expand Up @@ -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--) {
Expand Down
6 changes: 3 additions & 3 deletions bufferevent.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
12 changes: 6 additions & 6 deletions bufferevent_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;

Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions evconfig-private.h.in
Original file line number Diff line number Diff line change
@@ -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
Expand Down
16 changes: 8 additions & 8 deletions evdns.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -1966,9 +1966,9 @@ evdns_server_request_format_response(struct server_request *req, int err)

/* 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;

Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions event_iocp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
28 changes: 14 additions & 14 deletions evmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
36 changes: 18 additions & 18 deletions evthread-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down Expand Up @@ -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. */
Expand Down Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions evthread.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
26 changes: 13 additions & 13 deletions evthread_pthread.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,27 +58,27 @@ 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
return pthread_mutex_lock(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);
}

Expand Down Expand Up @@ -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);
Expand All @@ -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;
Expand Down
Loading

0 comments on commit 946b584

Please sign in to comment.