From: Jordan Lee Date: Sun, 8 Sep 2013 17:03:11 +0000 (+0000) Subject: use evutil_socket_t instead of int to define socket types. Patch my mikedLd :) X-Git-Tag: 2.83~93 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=605e2e89adff73ce055b591d1066c7b48878d584;p=transmission use evutil_socket_t instead of int to define socket types. Patch my mikedLd :) --- diff --git a/libtransmission/announcer.c b/libtransmission/announcer.c index ed540ed4f..d345ce903 100644 --- a/libtransmission/announcer.c +++ b/libtransmission/announcer.c @@ -159,7 +159,7 @@ tr_announcerHasBacklog (const struct tr_announcer * announcer) } static void -onUpkeepTimer (int foo UNUSED, short bar UNUSED, void * vannouncer); +onUpkeepTimer (evutil_socket_t foo UNUSED, short bar UNUSED, void * vannouncer); void tr_announcerInit (tr_session * session) @@ -1566,7 +1566,7 @@ announceMore (tr_announcer * announcer) } static void -onUpkeepTimer (int foo UNUSED, short bar UNUSED, void * vannouncer) +onUpkeepTimer (evutil_socket_t foo UNUSED, short bar UNUSED, void * vannouncer) { tr_announcer * announcer = vannouncer; tr_session * session = announcer->session; diff --git a/libtransmission/handshake.c b/libtransmission/handshake.c index 04a6ee646..24f7f02fd 100644 --- a/libtransmission/handshake.c +++ b/libtransmission/handshake.c @@ -1176,7 +1176,7 @@ gotError (tr_peerIo * io, **/ static void -handshakeTimeout (int foo UNUSED, short bar UNUSED, void * handshake) +handshakeTimeout (evutil_socket_t foo UNUSED, short bar UNUSED, void * handshake) { tr_handshakeAbort (handshake); } diff --git a/libtransmission/peer-io.c b/libtransmission/peer-io.c index e9faa27ae..06d9bad05 100644 --- a/libtransmission/peer-io.c +++ b/libtransmission/peer-io.c @@ -246,7 +246,7 @@ canReadWrapper (tr_peerIo * io) } static void -event_read_cb (int fd, short event UNUSED, void * vio) +event_read_cb (evutil_socket_t fd, short event UNUSED, void * vio) { int res; int e; @@ -325,7 +325,7 @@ tr_evbuffer_write (tr_peerIo * io, int fd, size_t howmuch) } static void -event_write_cb (int fd, short event UNUSED, void * vio) +event_write_cb (evutil_socket_t fd, short event UNUSED, void * vio) { int res = 0; int e; diff --git a/libtransmission/peer-mgr.c b/libtransmission/peer-mgr.c index 5a2728535..b64eb01b1 100644 --- a/libtransmission/peer-mgr.c +++ b/libtransmission/peer-mgr.c @@ -1475,7 +1475,7 @@ tr_peerMgrDidPeerRequest (const tr_torrent * tor, /* cancel requests that are too old */ static void -refillUpkeep (int foo UNUSED, short bar UNUSED, void * vmgr) +refillUpkeep (evutil_socket_t foo UNUSED, short bar UNUSED, void * vmgr) { time_t now; time_t too_old; @@ -2371,13 +2371,13 @@ tr_peerMgrGetPeers (tr_torrent * tor, return count; } -static void atomPulse (int, short, void *); -static void bandwidthPulse (int, short, void *); -static void rechokePulse (int, short, void *); -static void reconnectPulse (int, short, void *); +static void atomPulse (evutil_socket_t, short, void *); +static void bandwidthPulse (evutil_socket_t, short, void *); +static void rechokePulse (evutil_socket_t, short, void *); +static void reconnectPulse (evutil_socket_t, short, void *); static struct event * -createTimer (tr_session * session, int msec, void (*callback)(int, short, void *), void * cbdata) +createTimer (tr_session * session, int msec, event_callback_fn callback, void * cbdata) { struct event * timer = evtimer_new (session->event_base, callback, cbdata); tr_timerAddMsec (timer, msec); @@ -3159,7 +3159,7 @@ rechokeUploads (tr_swarm * s, const uint64_t now) } static void -rechokePulse (int foo UNUSED, short bar UNUSED, void * vmgr) +rechokePulse (evutil_socket_t foo UNUSED, short bar UNUSED, void * vmgr) { tr_torrent * tor = NULL; tr_peerMgr * mgr = vmgr; @@ -3520,7 +3520,7 @@ enforceSessionPeerLimit (tr_session * session, uint64_t now) static void makeNewPeerConnections (tr_peerMgr * mgr, const int max); static void -reconnectPulse (int foo UNUSED, short bar UNUSED, void * vmgr) +reconnectPulse (evutil_socket_t foo UNUSED, short bar UNUSED, void * vmgr) { tr_torrent * tor; tr_peerMgr * mgr = vmgr; @@ -3607,7 +3607,7 @@ queuePulse (tr_session * session, tr_direction dir) } static void -bandwidthPulse (int foo UNUSED, short bar UNUSED, void * vmgr) +bandwidthPulse (evutil_socket_t foo UNUSED, short bar UNUSED, void * vmgr) { tr_torrent * tor; tr_peerMgr * mgr = vmgr; @@ -3704,7 +3704,7 @@ getMaxAtomCount (const tr_torrent * tor) } static void -atomPulse (int foo UNUSED, short bar UNUSED, void * vmgr) +atomPulse (evutil_socket_t foo UNUSED, short bar UNUSED, void * vmgr) { tr_torrent * tor = NULL; tr_peerMgr * mgr = vmgr; diff --git a/libtransmission/peer-msgs.c b/libtransmission/peer-msgs.c index 7eda860e1..f2c675e63 100644 --- a/libtransmission/peer-msgs.c +++ b/libtransmission/peer-msgs.c @@ -2445,7 +2445,7 @@ sendPex (tr_peerMsgs * msgs) } static void -pexPulse (int foo UNUSED, short bar UNUSED, void * vmsgs) +pexPulse (evutil_socket_t foo UNUSED, short bar UNUSED, void * vmsgs) { struct tr_peerMsgs * msgs = vmsgs; diff --git a/libtransmission/port-forwarding.c b/libtransmission/port-forwarding.c index a3805ba97..eac9d494b 100644 --- a/libtransmission/port-forwarding.c +++ b/libtransmission/port-forwarding.c @@ -126,7 +126,7 @@ set_evtimer_from_status (tr_shared * s) } static void -onTimer (int fd UNUSED, short what UNUSED, void * vshared) +onTimer (evutil_socket_t fd UNUSED, short what UNUSED, void * vshared) { tr_shared * s = vshared; diff --git a/libtransmission/session.c b/libtransmission/session.c index e8aed846f..0e47097ba 100644 --- a/libtransmission/session.c +++ b/libtransmission/session.c @@ -180,7 +180,7 @@ free_incoming_peer_port (tr_session * session) } static void -accept_incoming_peer (int fd, short what UNUSED, void * vsession) +accept_incoming_peer (evutil_socket_t fd, short what UNUSED, void * vsession) { int clientSocket; tr_port clientPort; @@ -548,7 +548,7 @@ tr_sessionSaveSettings (tr_session * session, * in the case of a crash, unclean shutdown, clumsy user, etc. */ static void -onSaveTimer (int foo UNUSED, short bar UNUSED, void * vsession) +onSaveTimer (evutil_socket_t foo UNUSED, short bar UNUSED, void * vsession) { tr_torrent * tor = NULL; tr_session * session = vsession; @@ -629,7 +629,7 @@ tr_sessionInit (const char * tag, static void turtleCheckClock (tr_session * s, struct tr_turtle_info * t); static void -onNowTimer (int foo UNUSED, short bar UNUSED, void * vsession) +onNowTimer (evutil_socket_t foo UNUSED, short bar UNUSED, void * vsession) { int usec; const int min = 100; diff --git a/libtransmission/tr-dht.c b/libtransmission/tr-dht.c index ec786f459..436dcb7d0 100644 --- a/libtransmission/tr-dht.c +++ b/libtransmission/tr-dht.c @@ -66,7 +66,7 @@ static struct event *dht_timer = NULL; static unsigned char myid[20]; static tr_session *session = NULL; -static void timer_callback (int s, short type, void *ignore); +static void timer_callback (evutil_socket_t s, short type, void *ignore); struct bootstrap_closure { tr_session *session; @@ -657,7 +657,7 @@ tr_dhtCallback (unsigned char *buf, int buflen, } static void -timer_callback (int s UNUSED, short type UNUSED, void *session) +timer_callback (evutil_socket_t s UNUSED, short type UNUSED, void *session) { tr_dhtCallback (NULL, 0, NULL, 0, session); } diff --git a/libtransmission/tr-lpd.c b/libtransmission/tr-lpd.c index 2c64d890b..aeeb2d618 100644 --- a/libtransmission/tr-lpd.c +++ b/libtransmission/tr-lpd.c @@ -67,7 +67,7 @@ THE SOFTWARE. * $Id$ */ -static void event_callback (int, short, void*); +static void event_callback (evutil_socket_t, short, void*); enum { UPKEEP_INTERVAL_SECS = 5 @@ -255,7 +255,7 @@ static int lpd_extractParam (const char* const str, const char* const name, int /** * @} */ -static void on_upkeep_timer (int, short, void *); +static void on_upkeep_timer (evutil_socket_t, short, void *); /** * @brief Initializes Local Peer Discovery for this node @@ -619,7 +619,7 @@ tr_lpdAnnounceMore (const time_t now, const int interval) } static void -on_upkeep_timer (int foo UNUSED, short bar UNUSED, void * vsession UNUSED) +on_upkeep_timer (evutil_socket_t foo UNUSED, short bar UNUSED, void * vsession UNUSED) { const time_t now = tr_time (); tr_lpdAnnounceMore (now, UPKEEP_INTERVAL_SECS); @@ -630,7 +630,7 @@ on_upkeep_timer (int foo UNUSED, short bar UNUSED, void * vsession UNUSED) * @brief Processing of timeout notifications and incoming data on the socket * @note maximum rate of read events is limited according to @a lpd_maxAnnounceCap * @see DoS */ -static void event_callback (int s UNUSED, short type, void* ignore UNUSED) +static void event_callback (evutil_socket_t s UNUSED, short type, void* ignore UNUSED) { assert (tr_isSession (session)); diff --git a/libtransmission/tr-udp.c b/libtransmission/tr-udp.c index 44fd057e1..b0e60d64a 100644 --- a/libtransmission/tr-udp.c +++ b/libtransmission/tr-udp.c @@ -188,7 +188,7 @@ rebind_ipv6 (tr_session *ss, bool force) } static void -event_callback (int s, short type UNUSED, void *sv) +event_callback (evutil_socket_t s, short type UNUSED, void *sv) { int rc; socklen_t fromlen; diff --git a/libtransmission/trevent.c b/libtransmission/trevent.c index d99a82bc4..9c5b8fbef 100644 --- a/libtransmission/trevent.c +++ b/libtransmission/trevent.c @@ -160,9 +160,9 @@ struct tr_run_data } while (0) static void -readFromPipe (int fd, - short eventType, - void * veh) +readFromPipe (evutil_socket_t fd, + short eventType, + void * veh) { char ch; int ret;