Ignore:
Timestamp:
Jan 19, 2009, 2:05:43 PM (13 years ago)
Author:
charles
Message:

(trunk libT) prefer int' over ssize_t'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peer-io.c

    r7747 r7748  
    237237}
    238238
    239 static ssize_t
     239static int
    240240tr_evbuffer_write( tr_peerIo * io, int fd, size_t howmuch )
    241241{
    242242    int e;
    243     ssize_t n;
     243    int n;
    244244    struct evbuffer * buffer = io->outbuf;
    245245
     
    248248    errno = 0;
    249249#ifdef WIN32
    250     n = send(fd, buffer->buffer, howmuch,  0 );
     250    n = (int) send(fd, buffer->buffer, howmuch,  0 );
    251251#else
    252     n = write(fd, buffer->buffer, howmuch );
     252    n = (int) write(fd, buffer->buffer, howmuch );
    253253#endif
    254254    e = errno;
    255     dbgmsg( io, "wrote %zd to peer (%s)", n, (n==-1?strerror(e):"") );
     255    dbgmsg( io, "wrote %d to peer (%s)", n, (n==-1?strerror(e):"") );
    256256
    257257    if( n > 0 )
     
    763763***/
    764764
    765 static ssize_t
     765static int
    766766tr_peerIoTryRead( tr_peerIo * io, size_t howmuch )
    767767{
    768     ssize_t res = 0;
     768    int res = 0;
    769769
    770770    if(( howmuch = tr_bandwidthClamp( &io->bandwidth, TR_DOWN, howmuch )))
     
    775775        e = errno;
    776776
    777         dbgmsg( io, "read %zd from peer (%s)", res, (res==-1?strerror(e):"") );
     777        dbgmsg( io, "read %d from peer (%s)", res, (res==-1?strerror(e):"") );
    778778
    779779        if( EVBUFFER_LENGTH( io->inbuf ) )
     
    785785            if( res == 0 )
    786786                what |= EVBUFFER_EOF;
    787             dbgmsg( io, "tr_peerIoTryRead got an error. res is %zd, what is %hd, errno is %d (%s)", res, what, e, strerror( e ) );
     787            dbgmsg( io, "tr_peerIoTryRead got an error. res is %d, what is %hd, errno is %d (%s)", res, what, e, strerror( e ) );
    788788            io->gotError( io, what, io->userData );
    789789        }
     
    793793}
    794794
    795 static ssize_t
     795static int
    796796tr_peerIoTryWrite( tr_peerIo * io, size_t howmuch )
    797797{
    798     ssize_t n = 0;
     798    int n = 0;
    799799
    800800    if(( howmuch = tr_bandwidthClamp( &io->bandwidth, TR_UP, howmuch )))
     
    811811        {
    812812            const short what = EVBUFFER_WRITE | EVBUFFER_ERROR;
    813             dbgmsg( io, "tr_peerIoTryWrite got an error. res is %zd, what is %hd, errno is %d (%s)", n, what, e, strerror( e ) );
     813            dbgmsg( io, "tr_peerIoTryWrite got an error. res is %d, what is %hd, errno is %d (%s)", n, what, e, strerror( e ) );
    814814            io->gotError( io, what, io->userData );
    815815        }
     
    819819}
    820820
    821 ssize_t
     821int
    822822tr_peerIoFlush( tr_peerIo  * io, tr_direction dir, size_t limit )
    823823{
    824     ssize_t bytesUsed;
     824    int bytesUsed;
    825825
    826826    assert( tr_isPeerIo( io ) );
     
    835835    }
    836836
    837     dbgmsg( io, "flushing peer-io, direction %d, limit %zu, bytesUsed %zd", (int)dir, limit, bytesUsed );
     837    dbgmsg( io, "flushing peer-io, direction %d, limit %zu, bytesUsed %d", (int)dir, limit, bytesUsed );
    838838    return bytesUsed;
    839839}
Note: See TracChangeset for help on using the changeset viewer.