fix pedantic compiler warnings

This commit is contained in:
Jordan Lee 2013-09-09 01:32:09 +00:00
parent 80a5815c0c
commit d9a6539e19
7 changed files with 19 additions and 17 deletions

View File

@ -547,7 +547,7 @@ tau_tracker_send_reqs (struct tau_tracker * tracker)
for (i=0, n=tr_ptrArraySize (reqs); i<n; ++i) {
struct tau_announce_request * req = tr_ptrArrayNth (reqs, i);
if (!req->sent_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); i<n; ++i) {
struct tau_scrape_request * req = tr_ptrArrayNth (reqs, i);
if (!req->sent_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); i<n; ++i) {
struct tau_announce_request * req = tr_ptrArrayNth (reqs, i);
if (cancel_all || (req->created_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); i<n; ++i) {
struct tau_scrape_request * req = tr_ptrArrayNth (reqs, i);
if (cancel_all || (req->created_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

View File

@ -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,

View File

@ -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;

View File

@ -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;

View File

@ -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);
}

View File

@ -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... */

View File

@ -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,