(trunk libT) Fix sparse warnings: symbol 'XXX' shadows an earlier one

This commit is contained in:
Charles Kerr 2009-01-01 18:38:49 +00:00
parent 82c5aca513
commit 2eb2dacd50
8 changed files with 17 additions and 21 deletions

View File

@ -325,9 +325,9 @@ tr_bandwidthAllocate( tr_bandwidth * b,
++i;
else {
/* peer is done writing for now; move it to the end of the list */
tr_peerIo * tmp = peers[i];
tr_peerIo * pio = peers[i];
peers[i] = peers[n-1];
peers[n-1] = tmp;
peers[n-1] = pio;
--n;
}

View File

@ -231,7 +231,6 @@ tr_bencParseImpl( const void * buf_in,
{
int64_t val;
const uint8_t * end;
int err;
tr_benc * node;
if( ( err = tr_bencParseInt( buf, bufend, &end, &val ) ) )
@ -289,7 +288,6 @@ tr_bencParseImpl( const void * buf_in,
const uint8_t * end;
const uint8_t * str;
size_t str_len;
int err;
tr_benc * node;
if( ( err = tr_bencParseStr( buf, bufend, &end, &str, &str_len ) ) )

View File

@ -35,7 +35,6 @@
#include "net.h"
#include "utils.h"
extern int errno;
/***
**** PRIVATE

View File

@ -312,11 +312,12 @@ parsePriorities( tr_torrent * tor,
if( len == (uint32_t)( 2 * tor->info.fileCount ) )
{
const size_t n = tor->info.fileCount;
const size_t len = 2 * n;
const uint8_t * walk = buf;
tr_file_index_t *dnd = NULL, dndCount = 0;
tr_file_index_t *dl = NULL, dlCount = 0;
size_t i;
const uint8_t * walk = buf;
len = 2 * n;
/* set file priorities */
for( i = 0; i < n; ++i )

View File

@ -345,9 +345,9 @@ makeInfoDict( tr_benc * dict,
builder->fileCount );
for( i = 0; i < builder->fileCount; ++i )
{
tr_benc * dict = tr_bencListAddDict( list, 2 );
tr_benc * length = tr_bencDictAdd( dict, "length" );
tr_benc * pathVal = tr_bencDictAdd( dict, "path" );
tr_benc * d = tr_bencListAddDict( list, 2 );
tr_benc * length = tr_bencDictAdd( d, "length" );
tr_benc * pathVal = tr_bencDictAdd( d, "path" );
getFileInfo( builder->top, &builder->files[i], length, pathVal );
}
}

View File

@ -182,7 +182,6 @@ parseFiles( tr_info * inf,
{
tr_benc * file;
tr_benc * path;
int64_t length;
file = tr_bencListChild( files, i );
if( !tr_bencIsDict( file ) )
@ -195,11 +194,11 @@ parseFiles( tr_info * inf,
if( getfile( &inf->files[i].name, inf->name, path ) )
return "path";
if( !tr_bencDictFindInt( file, "length", &length ) )
if( !tr_bencDictFindInt( file, "length", &len ) )
return "length";
inf->files[i].length = length;
inf->totalSize += length;
inf->files[i].length = len;
inf->totalSize += len;
}
}
else if( tr_bencGetInt( length, &len ) ) /* single-file mode */
@ -360,10 +359,10 @@ tr_metainfoParseImpl( const tr_session * session,
else
{
int len;
char * str = tr_bencSave( beInfo, &len );
tr_sha1( inf->hash, str, len, NULL );
char * bstr = tr_bencSave( beInfo, &len );
tr_sha1( inf->hash, bstr, len, NULL );
tr_sha1_to_hex( inf->hashString, inf->hash );
tr_free( str );
tr_free( bstr );
}
/* name */

View File

@ -167,9 +167,9 @@ tr_natpmpPulse( struct tr_natpmp * nat,
logVal( "readnatpmpresponseorretry", val );
if( val >= 0 )
{
const int port = resp.pnu.newportmapping.privateport;
tr_ninf( getKey( ), _( "no longer forwarding port %d" ), port );
if( nat->port == port )
const int p = resp.pnu.newportmapping.privateport;
tr_ninf( getKey( ), _( "no longer forwarding port %d" ), p );
if( nat->port == p )
{
nat->port = -1;
nat->state = TR_NATPMP_IDLE;

View File

@ -68,7 +68,6 @@ getTorrents( tr_session * session,
{
tr_torrent * tor = NULL;
tr_benc * node = tr_bencListChild( ids, i );
int64_t id;
const char * str;
if( tr_bencGetInt( node, &id ) )
tor = tr_torrentFindFromId( session, id );