Changeset 12023


Ignore:
Timestamp:
Feb 24, 2011, 2:59:13 PM (11 years ago)
Author:
jordan
Message:

(2.2x) backport compiler warning fixes from trunk:

r11856: libT #3991 "connection encryption stopped working" -- silence minor compiler warning.
r11857: libT compiler warning: "peer-io.h:282: warning: inlining …
r11861: gtk msgwin.c: silence compiler warning "warning: ‘pinned_to_new’ may be used uninitialized in this function"
r11862: libT fix gcc compiler warning in libtransmission/makemeta.c: "ignoring return value of ‘read’"
r11863: libT silence compiler warning in libtransmission/fdlimit.c: "ignoring return value of ‘ftruncate’"
r11864: libt silence a couple of identical compiler warnings: "ignoring return value of ‘getcwd’"

Location:
branches/2.2x
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2x/daemon/remote.c

    r11809 r12023  
    490490tr_getcwd( void )
    491491{
     492    char * result;
    492493    char buf[2048];
    493494    *buf = '\0';
    494495#ifdef WIN32
    495     _getcwd( buf, sizeof( buf ) );
     496    result = _getcwd( buf, sizeof( buf ) );
    496497#else
    497     getcwd( buf, sizeof( buf ) );
     498    result = getcwd( buf, sizeof( buf ) );
    498499#endif
     500    if( result == NULL )
     501        fprintf( stderr, "getcwd error: \"%s\"", tr_strerror( errno ) );
    499502    return tr_strdup( buf );
    500503}
  • branches/2.2x/gtk/msgwin.c

    r11828 r12023  
    5959is_pinned_to_new( struct MsgData * data )
    6060{
    61     gboolean pinned_to_new;
     61    gboolean pinned_to_new = FALSE;
    6262
    6363    if( data->view == NULL )
  • branches/2.2x/libtransmission/fdlimit.c

    r11817 r12023  
    398398     */
    399399    if( alreadyExisted && ( file_size < (uint64_t)sb.st_size ) )
    400         ftruncate( o->fd, file_size );
     400    {
     401        if( ftruncate( o->fd, file_size ) == -1 )
     402        {
     403            const int err = errno;
     404            tr_err( _( "Couldn't truncate \"%1$s\": %2$s" ), filename, tr_strerror( err ) );
     405            return err;
     406        }
     407    }
    401408
    402409    if( writable && !alreadyExisted && ( allocation == TR_PREALLOCATE_SPARSE ) )
  • branches/2.2x/libtransmission/makemeta.c

    r11709 r12023  
    236236        {
    237237            const size_t n_this_pass = (size_t) MIN( ( b->files[fileIndex].size - off ), leftInPiece );
    238             read( fd, bufptr, n_this_pass );
    239             bufptr += n_this_pass;
    240             off += n_this_pass;
    241             leftInPiece -= n_this_pass;
     238            const ssize_t n_read = read( fd, bufptr, n_this_pass );
     239            bufptr += n_read;
     240            off += n_read;
     241            leftInPiece -= n_read;
    242242            if( off == b->files[fileIndex].size )
    243243            {
  • branches/2.2x/libtransmission/peer-io.c

    r11846 r12023  
    775775    const int n = evbuffer_peek( buf, byteCount, NULL, iovec, vecCount );
    776776    assert( n == vecCount );
    777     *setme_vecCount = vecCount;
     777    *setme_vecCount = n;
    778778    return iovec;
    779779}
     
    815815****
    816816***/
     817
     818void
     819evbuffer_add_uint8( struct evbuffer * outbuf, uint8_t byte )
     820{
     821    evbuffer_add( outbuf, &byte, 1 );
     822}
    817823
    818824void
  • branches/2.2x/libtransmission/peer-io.h

    r11709 r12023  
    279279}
    280280
    281 static inline void
    282 evbuffer_add_uint8( struct evbuffer * outbuf, uint8_t byte )
    283 {
    284     evbuffer_add( outbuf, &byte, 1 );
    285 }
    286 
     281void evbuffer_add_uint8 ( struct evbuffer * outbuf, uint8_t byte );
    287282void evbuffer_add_uint16( struct evbuffer * outbuf, uint16_t hs );
    288283void evbuffer_add_uint32( struct evbuffer * outbuf, uint32_t hl );
  • branches/2.2x/utils/create.c

    r11709 r12023  
    1111 */
    1212
     13#include <errno.h>
    1314#include <stdio.h>
    1415#include <unistd.h> /* getcwd() */
     
    7879tr_getcwd( void )
    7980{
     81    char * result;
    8082    char buf[2048];
    8183    *buf = '\0';
    8284#ifdef WIN32
    83     _getcwd( buf, sizeof( buf ) );
     85    result = _getcwd( buf, sizeof( buf ) );
    8486#else
    85     getcwd( buf, sizeof( buf ) );
     87    result = getcwd( buf, sizeof( buf ) );
    8688#endif
     89    if( result == NULL )
     90        fprintf( stderr, "getcwd error: \"%s\"", tr_strerror( errno ) );
    8791    return tr_strdup( buf );
    8892}
Note: See TracChangeset for help on using the changeset viewer.