From 1101ba8d571bb5ad07ffd61598dcc9156d706c6d Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Mon, 28 Mar 2011 13:37:46 +0000 Subject: [PATCH] (trunk libT) strip trailing whitespace --- libtransmission/announcer-udp.c | 9 ++++----- libtransmission/announcer.c | 3 +-- libtransmission/utils.c | 4 ++-- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/libtransmission/announcer-udp.c b/libtransmission/announcer-udp.c index 34b622314..36a255dbd 100644 --- a/libtransmission/announcer-udp.c +++ b/libtransmission/announcer-udp.c @@ -52,7 +52,7 @@ tau_sendto( tr_session * session, const void * buf, size_t buflen ) { int sockfd; - + if( ai->ai_addr->sa_family == AF_INET ) sockfd = session->udp_socket; else if( ai->ai_addr->sa_family == AF_INET6 ) @@ -487,7 +487,7 @@ tau_tracker_on_dns( int errcode, struct evutil_addrinfo *addr, void * vtracker ) if ( errcode ) { - char * errmsg = tr_strdup_printf( _( "DNS Lookup failed: %s" ), + char * errmsg = tr_strdup_printf( _( "DNS Lookup failed: %s" ), evdns_err_to_string( errcode ) ); dbgmsg( tracker->key, "%s", errmsg ); tau_tracker_fail_all( tracker, false, false, errmsg ); @@ -652,7 +652,7 @@ tau_tracker_upkeep( struct tau_tracker * tracker ) /* if the address info is too old, expire it */ if( tracker->addr && ( tracker->addr_expiration_time <= now ) ) { - dbgmsg( tracker->host, "Expiring old DNS result" ); + dbgmsg( tracker->host, "Expiring old DNS result" ); evutil_freeaddrinfo( tracker->addr ); tracker->addr = NULL; } @@ -671,7 +671,7 @@ tau_tracker_upkeep( struct tau_tracker * tracker ) hints.ai_socktype = SOCK_DGRAM; hints.ai_protocol = IPPROTO_UDP; tracker->is_asking_dns = true; - dbgmsg( tracker->host, "Trying a new DNS lookup" ); + dbgmsg( tracker->host, "Trying a new DNS lookup" ); evdns_getaddrinfo( tracker->session->evdns_base, tracker->host, NULL, &hints, tau_tracker_on_dns, tracker ); @@ -824,7 +824,6 @@ tr_tracker_udp_close( tr_session * session ) tr_ptrArrayDestruct( &tau->trackers, (PtrArrayForeachFunc)tau_tracker_free ); tr_free( tau ); } - } /* start shutting down. diff --git a/libtransmission/announcer.c b/libtransmission/announcer.c index 043ec89a4..6dc4aa588 100644 --- a/libtransmission/announcer.c +++ b/libtransmission/announcer.c @@ -994,7 +994,6 @@ static void on_announce_done( const tr_announce_response * response, void * vdata ) { - struct announce_data * data = vdata; tr_announcer * announcer = data->session->announcer; tr_tier * tier = getTier( announcer, response->info_hash, data->tierId ); @@ -1496,7 +1495,7 @@ onUpkeepTimer( int foo UNUSED, short bar UNUSED, void * vannouncer ) flushCloseMessages( announcer ); /* maybe send out some announcements to trackers */ - if( !is_closing ) + if( !is_closing ) announceMore( announcer ); /* TAU upkeep */ diff --git a/libtransmission/utils.c b/libtransmission/utils.c index 1e3ce1f9f..022252ed9 100644 --- a/libtransmission/utils.c +++ b/libtransmission/utils.c @@ -1608,7 +1608,7 @@ tr_htonll( uint64_t x ) #else /* fallback code by Runner and Juan Carlos Cobas at * http://www.codeproject.com/KB/cpp/endianness.aspx */ - return (((uint64_t)(htonl((int)((x << 32) >> 32))) << 32) | + return (((uint64_t)(htonl((int)((x << 32) >> 32))) << 32) | (unsigned int)htonl(((int)(x >> 32)))); #endif } @@ -1621,7 +1621,7 @@ tr_ntohll( uint64_t x ) #else /* fallback code by Runner and Juan Carlos Cobas at * http://www.codeproject.com/KB/cpp/endianness.aspx */ - return (((uint64_t)(ntohl((int)((x << 32) >> 32))) << 32) | + return (((uint64_t)(ntohl((int)((x << 32) >> 32))) << 32) | (unsigned int)ntohl(((int)(x >> 32)))); #endif }