Changeset 3605


Ignore:
Timestamp:
Oct 27, 2007, 9:29:39 PM (14 years ago)
Author:
charles
Message:

compatability with older C copmilers (ticket #422, patch by fizz)

Location:
branches/0.9x
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/0.9x/configure.ac

    r3537 r3605  
    3939AC_SEARCH_LIBS([socket], [socket net])
    4040AC_SEARCH_LIBS([gethostbyname], [nsl bind])
     41
     42dnl ----------------------------------------------------------------------------
     43dnl
     44dnl va_copy
     45
     46AC_MSG_CHECKING([how to copy va_list])
     47AC_TRY_LINK([#include <stdarg.h>], [va_list ap1, ap2; va_copy(ap1, ap2);],
     48    AC_MSG_RESULT([va_copy]),
     49        [ AH_TEMPLATE([va_copy], [define if va_copy is not available])
     50        AC_TRY_LINK([#include <stdarg.h>], [va_list ap1, ap2; __va_copy(ap1, ap2);],
     51        [ AC_DEFINE([va_copy], [__va_copy])
     52        AC_MSG_RESULT([__va_copy])],
     53        [ AC_DEFINE([va_copy(dest,src)], [memcpy(&dest,&src,sizeof(va_list))])
     54        AC_MSG_RESULT([memcpy])]
     55    )
     56])
     57
    4158
    4259dnl ----------------------------------------------------------------------------
  • branches/0.9x/gtk/tr_torrent.c

    r3484 r3605  
    178178maketorrent( tr_torrent * handle )
    179179{
     180    TrTorrent * tor = g_object_new( TR_TORRENT_TYPE, NULL );
    180181    tr_torrentDisablePex( handle, !pref_flag_get( PREF_KEY_PEX ) );
    181     TrTorrent * tor = g_object_new( TR_TORRENT_TYPE, NULL );
    182182    tor->handle = handle;
    183183    return tor;
  • branches/0.9x/libtransmission/handshake.c

    r3508 r3605  
    969969        && ( !tr_peerIoReconnect( handshake->io ) ) )
    970970    {
     971        int msgSize;
     972        uint8_t * msg;
    971973        dbgmsg( handshake, "handshake failed, trying plaintext..." );
    972         int msgSize;
    973         uint8_t * msg = buildHandshakeMessage( handshake, &msgSize );
     974        msg = buildHandshakeMessage( handshake, &msgSize );
    974975        handshake->haveSentBitTorrentHandshake = 1;
    975976        setReadState( handshake, AWAITING_HANDSHAKE );
  • branches/0.9x/libtransmission/inout.c

    r3571 r3605  
    428428    {
    429429        struct recheck_node tmp;
     430        struct recheck_node * node;
    430431        tmp.torrent = tor;
    431         struct recheck_node * node = tr_list_remove( &recheckList,
    432                                                      &tmp,
    433                                                      compareRecheckByTorrent );
     432        node = tr_list_remove( &recheckList,
     433                               &tmp,
     434                               compareRecheckByTorrent );
    434435        tr_free( node );
    435436        tor->recheckState = TR_RECHECK_NONE;
  • branches/0.9x/libtransmission/peer-mgr.c

    r3553 r3605  
    442442     * so that being on same local network gives us the same allowed pieces */
    443443   
     444    uint8_t *seed;
     445    char buf[4];
     446    uint32_t allowedPieceCount = 0;
     447    tr_bitfield_t * ret;
     448
    444449    printf( "%d piece allowed fast set for torrent with %d pieces and hex infohash\n", setCount, pieceCount );
    445450    printf( "%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x for node with IP %s:\n",
     
    448453            inet_ntoa( *ip ) );
    449454   
    450     uint8_t *seed = malloc(4 + SHA_DIGEST_LENGTH);
    451     char buf[4];
    452     uint32_t allowedPieceCount = 0;
    453     tr_bitfield_t * ret;
     455    seed = malloc(4 + SHA_DIGEST_LENGTH);
    454456   
    455457    ret = tr_bitfieldNew( pieceCount );
     
    16911693        {
    16921694            tr_peerMgr * mgr = t->manager;
    1693 
    16941695            struct peer_atom * atom = candidates[i];
    1695 
    16961696            tr_peerIo * io;
     1697            tr_handshake * handshake;
    16971698
    16981699            tordbg( t, "Starting an OUTGOING connection with %s",
     
    17011702            io = tr_peerIoNewOutgoing( mgr->handle, &atom->addr, atom->port, t->hash );
    17021703
    1703             tr_handshake * handshake = tr_handshakeNew( io,
    1704                                                         mgr->handle->encryptionMode,
    1705                                                         myHandshakeDoneCB,
    1706                                                         mgr );
     1704            handshake = tr_handshakeNew( io,
     1705                                         mgr->handle->encryptionMode,
     1706                                         myHandshakeDoneCB,
     1707                                         mgr );
    17071708
    17081709            assert( tr_peerIoGetTorrentHash( io ) != NULL );
  • branches/0.9x/libtransmission/peer-msgs.c

    r3598 r3605  
    16931693    else {
    16941694        /* This peer is fastpeer-enabled, send it have-all or have-none if appropriate */
     1695        uint32_t peerProgress;
    16951696        float completion = tr_cpPercentComplete( m->torrent->completion );
    16961697        if ( completion == 0.0f ) {
     
    17011702            sendBitfield( m );
    17021703        }
    1703         uint32_t peerProgress = m->torrent->info.pieceCount * m->info->progress;
     1704        peerProgress = m->torrent->info.pieceCount * m->info->progress;
    17041705       
    17051706        if ( peerProgress < MAX_ALLOWED_SET_COUNT )
Note: See TracChangeset for help on using the changeset viewer.