From d9a6539e19c0ad0f042fe4d2f877118ed0106d24 Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Mon, 9 Sep 2013 01:32:09 +0000 Subject: [PATCH] fix pedantic compiler warnings --- libtransmission/announcer-udp.c | 16 +++++++++------- libtransmission/peer-io.c | 4 ++-- libtransmission/peer-msgs.c | 2 +- libtransmission/resume.c | 2 +- libtransmission/session.c | 6 +++--- libtransmission/torrent.c | 2 +- libtransmission/web.c | 4 ++-- 7 files changed, 19 insertions(+), 17 deletions(-) diff --git a/libtransmission/announcer-udp.c b/libtransmission/announcer-udp.c index 2b16b3bcb..8562045b9 100644 --- a/libtransmission/announcer-udp.c +++ b/libtransmission/announcer-udp.c @@ -547,7 +547,7 @@ tau_tracker_send_reqs (struct tau_tracker * tracker) for (i=0, n=tr_ptrArraySize (reqs); isent_at) { - dbgmsg (tracker->key, "sending announce req %p", req); + dbgmsg (tracker->key, "sending announce req %p", (void*)req); req->sent_at = now; tau_tracker_send_request (tracker, req->payload, req->payload_len); if (req->callback == NULL) { @@ -563,7 +563,7 @@ tau_tracker_send_reqs (struct tau_tracker * tracker) for (i=0, n=tr_ptrArraySize (reqs); isent_at) { - dbgmsg (tracker->key, "sending scrape req %p", req); + dbgmsg (tracker->key, "sending scrape req %p", (void*)req); req->sent_at = now; tau_tracker_send_request (tracker, req->payload, req->payload_len); if (req->callback == NULL) { @@ -628,7 +628,7 @@ tau_tracker_timeout_reqs (struct tau_tracker * tracker) for (i=0, n=tr_ptrArraySize (reqs); icreated_at + TAU_REQUEST_TTL < now)) { - dbgmsg (tracker->key, "timeout announce req %p", req); + dbgmsg (tracker->key, "timeout announce req %p", (void*)req); tau_announce_request_fail (req, false, true, NULL); tau_announce_request_free (req); tr_ptrArrayRemove (reqs, i); @@ -641,7 +641,7 @@ tau_tracker_timeout_reqs (struct tau_tracker * tracker) for (i=0, n=tr_ptrArraySize (reqs); icreated_at + TAU_REQUEST_TTL < now)) { - dbgmsg (tracker->key, "timeout scrape req %p", req); + dbgmsg (tracker->key, "timeout scrape req %p", (void*)req); tau_scrape_request_fail (req, false, true, NULL); tau_scrape_request_free (req); tr_ptrArrayRemove (reqs, i); @@ -691,9 +691,11 @@ tau_tracker_upkeep (struct tau_tracker * tracker) } dbgmsg (tracker->key, "addr %p -- connected %d (%"TR_PRIuSIZE" %"TR_PRIuSIZE") -- connecting_at %"TR_PRIuSIZE, - tracker->addr, - (int)(tracker->connection_expiration_time > now), (size_t)tracker->connection_expiration_time, (size_t)now, - (size_t)tracker->connecting_at); + (void*)tracker->addr, + (int)(tracker->connection_expiration_time > now), + (size_t)tracker->connection_expiration_time, + (size_t)now, + (size_t)tracker->connecting_at); /* also need a valid connection ID... */ if (tracker->addr diff --git a/libtransmission/peer-io.c b/libtransmission/peer-io.c index 2cb7ca803..253660b8c 100644 --- a/libtransmission/peer-io.c +++ b/libtransmission/peer-io.c @@ -630,8 +630,8 @@ tr_peerIoNew (tr_session * session, io->outbuf = evbuffer_new (); tr_bandwidthConstruct (&io->bandwidth, session, parent); tr_bandwidthSetPeer (&io->bandwidth, io); - dbgmsg (io, "bandwidth is %p; its parent is %p", &io->bandwidth, parent); - dbgmsg (io, "socket is %d, utp_socket is %p", socket, utp_socket); + dbgmsg (io, "bandwidth is %p; its parent is %p", (void*)&io->bandwidth, (void*)parent); + dbgmsg (io, "socket is %d, utp_socket is %p", socket, (void*)utp_socket); if (io->socket >= 0) { io->event_read = event_new (session->event_base, diff --git a/libtransmission/peer-msgs.c b/libtransmission/peer-msgs.c index 998965d46..3c33eaf15 100644 --- a/libtransmission/peer-msgs.c +++ b/libtransmission/peer-msgs.c @@ -1922,7 +1922,7 @@ fillOutputBuffer (tr_peerMsgs * msgs, time_t now) { const size_t len = evbuffer_get_length (msgs->outMessages); /* flush the protocol messages */ - dbgmsg (msgs, "flushing outMessages... to %p (length is %"TR_PRIuSIZE")", msgs->io, len); + dbgmsg (msgs, "flushing outMessages... to %p (length is %"TR_PRIuSIZE")", (void*)msgs->io, len); tr_peerIoWriteBuf (msgs->io, msgs->outMessages, false); msgs->clientSentAnythingAt = now; msgs->outMessagesBatchedAt = 0; diff --git a/libtransmission/resume.c b/libtransmission/resume.c index 473a9ee93..30d5e952c 100644 --- a/libtransmission/resume.c +++ b/libtransmission/resume.c @@ -165,7 +165,7 @@ loadDND (tr_variant * dict, tr_torrent * tor) else { tr_logAddTorDbg (tor, "Couldn't load DND flags. DND list (%p) has %"TR_PRIuSIZE" children; torrent has %d files", - list, tr_variantListSize (list), (int)n); + (void*)list, tr_variantListSize (list), (int)n); } return ret; diff --git a/libtransmission/session.c b/libtransmission/session.c index 041447064..e0d5cac8a 100644 --- a/libtransmission/session.c +++ b/libtransmission/session.c @@ -693,7 +693,7 @@ tr_sessionInitImpl (void * vdata) assert (tr_variantIsDict (clientSettings)); dbgmsg ("tr_sessionInit: the session's top-level bandwidth object is %p", - &session->bandwidth); + (void*)&session->bandwidth); tr_variantInitDict (&settings, 0); tr_sessionGetDefaultSettings (&settings); @@ -1868,7 +1868,7 @@ tr_sessionClose (tr_session * session) assert (tr_isSession (session)); - dbgmsg ("shutting down transmission session %p... now is %"TR_PRIuSIZE", deadline is %"TR_PRIuSIZE, session, (size_t)time (NULL), (size_t)deadline); + dbgmsg ("shutting down transmission session %p... now is %"TR_PRIuSIZE", deadline is %"TR_PRIuSIZE, (void*)session, (size_t)time (NULL), (size_t)deadline); /* close the session */ tr_runInEventThread (session, sessionCloseImpl, session); @@ -1886,7 +1886,7 @@ tr_sessionClose (tr_session * session) && !deadlineReached (deadline)) { dbgmsg ("waiting on port unmap (%p) or announcer (%p)... now %"TR_PRIuSIZE" deadline %"TR_PRIuSIZE, - session->shared, session->announcer, (size_t)time (NULL), (size_t)deadline); + (void*)session->shared, (void*)session->announcer, (size_t)time (NULL), (size_t)deadline); tr_wait_msec (50); } diff --git a/libtransmission/torrent.c b/libtransmission/torrent.c index 3abf6a926..57eecdc45 100644 --- a/libtransmission/torrent.c +++ b/libtransmission/torrent.c @@ -2877,7 +2877,7 @@ deleteLocalData (tr_torrent * tor, tr_fileFunc func) char * tmpdir = NULL; tr_ptrArray files = TR_PTR_ARRAY_INIT; tr_ptrArray folders = TR_PTR_ARRAY_INIT; - const void * const vstrcmp = strcmp; + PtrArrayCompareFunc vstrcmp = (PtrArrayCompareFunc)strcmp; const char * const top = tor->currentDir; /* if it's a magnet link, there's nothing to move... */ diff --git a/libtransmission/web.c b/libtransmission/web.c index a51bbd899..456b3a506 100644 --- a/libtransmission/web.c +++ b/libtransmission/web.c @@ -133,7 +133,7 @@ writeFunc (void * ptr, size_t size, size_t nmemb, void * vtask) } evbuffer_add (task->response, ptr, byteCount); - dbgmsg ("wrote %"TR_PRIuSIZE" bytes to task %p's buffer", byteCount, task); + dbgmsg ("wrote %"TR_PRIuSIZE" bytes to task %p's buffer", byteCount, (void*)task); return byteCount; } @@ -237,7 +237,7 @@ static void task_finish_func (void * vtask) { struct tr_web_task * task = vtask; - dbgmsg ("finished web task %p; got %ld", task, task->code); + dbgmsg ("finished web task %p; got %ld", (void*)task, task->code); if (task->done_func != NULL) task->done_func (task->session, -- 2.40.0