(trunk) remove trailing spaces from code lines ;)

This commit is contained in:
Jordan Lee
2012-02-03 16:44:07 +00:00
parent 00714200f3
commit b2d65db45f
7 changed files with 109 additions and 110 deletions

View File

@@ -226,8 +226,8 @@ main( int argc, char ** argv )
const char * configDir; const char * configDir;
uint8_t * fileContents; uint8_t * fileContents;
size_t fileLength; size_t fileLength;
const char * str; const char * str;
char buf[TR_PATH_MAX]; char buf[TR_PATH_MAX];
tr_formatter_mem_init( MEM_K, MEM_K_STR, MEM_M_STR, MEM_G_STR, MEM_T_STR ); tr_formatter_mem_init( MEM_K, MEM_K_STR, MEM_M_STR, MEM_G_STR, MEM_T_STR );
tr_formatter_size_init( DISK_K,DISK_K_STR, DISK_M_STR, DISK_G_STR, DISK_T_STR ); tr_formatter_size_init( DISK_K,DISK_K_STR, DISK_M_STR, DISK_G_STR, DISK_T_STR );

View File

@@ -137,35 +137,35 @@ dnl ----------------------------------------------------------------------------
dnl dnl
dnl file monitoring for the daemon dnl file monitoring for the daemon
AC_CHECK_HEADER([sys/inotify.h], AC_CHECK_HEADER([sys/inotify.h],
[AC_CHECK_FUNC([inotify_init],[have_inotify="yes"],[have_inotify="no"])], [AC_CHECK_FUNC([inotify_init],[have_inotify="yes"],[have_inotify="no"])],
[have_inotify="no"]) [have_inotify="no"])
AC_ARG_WITH([inotify], AC_ARG_WITH([inotify],
[AS_HELP_STRING([--with-inotify],[Enable inotify support (default=auto)])], [AS_HELP_STRING([--with-inotify],[Enable inotify support (default=auto)])],
[want_inotify=${withval}], [want_inotify=${withval}],
[want_inotify=${have_inotify}]) [want_inotify=${have_inotify}])
if test "x$want_inotify" = "xyes" ; then if test "x$want_inotify" = "xyes" ; then
if test "x$have_inotify" = "xyes"; then if test "x$have_inotify" = "xyes"; then
AC_DEFINE([WITH_INOTIFY],[1]) AC_DEFINE([WITH_INOTIFY],[1])
else else
AC_MSG_ERROR("inotify not found!") AC_MSG_ERROR("inotify not found!")
fi fi
fi fi
AC_CHECK_HEADER([sys/event.h], AC_CHECK_HEADER([sys/event.h],
[AC_CHECK_FUNC([kqueue],[have_kqueue="yes"],[have_kqueue="no"])], [AC_CHECK_FUNC([kqueue],[have_kqueue="yes"],[have_kqueue="no"])],
[have_kqueue="no"]) [have_kqueue="no"])
AC_ARG_WITH([kqueue], AC_ARG_WITH([kqueue],
[AS_HELP_STRING([--with-kqueue],[Enable kqueue support (default=auto)])], [AS_HELP_STRING([--with-kqueue],[Enable kqueue support (default=auto)])],
[want_kqueue=${withval}], [want_kqueue=${withval}],
[want_kqueue=${have_kqueue}]) [want_kqueue=${have_kqueue}])
if test "x$want_kqueue" = "xyes" ; then if test "x$want_kqueue" = "xyes" ; then
if test "x$have_kqueue" = "xyes"; then if test "x$have_kqueue" = "xyes"; then
AC_DEFINE([WITH_KQUEUE],[1]) AC_DEFINE([WITH_KQUEUE],[1])
else else
AC_MSG_ERROR("kqueue not found!") AC_MSG_ERROR("kqueue not found!")
fi fi
fi fi
AC_CHECK_HEADERS([sys/statvfs.h \ AC_CHECK_HEADERS([sys/statvfs.h \
xfs/xfs.h]) xfs/xfs.h])
@@ -219,7 +219,7 @@ AC_ARG_ENABLE([utp],
[want_utp=${enableval}], [want_utp=${enableval}],
[want_utp=${have_utp}]) [want_utp=${have_utp}])
if test "x$want_utp" = "xyes" ; then if test "x$want_utp" = "xyes" ; then
if test "x$have_utp" = "xyes"; then if test "x$have_utp" = "xyes"; then
LIBUTP_CFLAGS="-I\$(top_srcdir)/third-party/" LIBUTP_CFLAGS="-I\$(top_srcdir)/third-party/"
LIBUTP_LIBS="\$(top_builddir)/third-party/libutp/libutp.a" LIBUTP_LIBS="\$(top_builddir)/third-party/libutp/libutp.a"
if test "x$libutp_extra_libs" != "x" ; then if test "x$libutp_extra_libs" != "x" ; then
@@ -227,10 +227,10 @@ if test "x$want_utp" = "xyes" ; then
fi fi
AC_DEFINE([WITH_UTP],[1]) AC_DEFINE([WITH_UTP],[1])
build_utp="yes" build_utp="yes"
else else
AC_MSG_ERROR("Unable to build uTP support -- C++ compiler not found") AC_MSG_ERROR("Unable to build uTP support -- C++ compiler not found")
fi fi
fi fi
AC_SUBST(LIBUTP_CFLAGS) AC_SUBST(LIBUTP_CFLAGS)
AC_SUBST(LIBUTP_LIBS) AC_SUBST(LIBUTP_LIBS)
AM_CONDITIONAL([BUILD_UTP],[test "x$build_utp" = "xyes"]) AM_CONDITIONAL([BUILD_UTP],[test "x$build_utp" = "xyes"])
@@ -243,70 +243,70 @@ dnl
AC_MSG_CHECKING([supported miniupnp library]) AC_MSG_CHECKING([supported miniupnp library])
upnp_version="none" upnp_version="none"
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lminiupnpc" LIBS="-lminiupnpc"
# See if the OS has its miniupnp 1.5 installed # See if the OS has its miniupnp 1.5 installed
AC_TRY_LINK([ AC_TRY_LINK([
#include <stdlib.h> #include <stdlib.h>
#include <miniupnpc/miniupnpc.h> #include <miniupnpc/miniupnpc.h>
#include <miniupnpc/upnpcommands.h> #include <miniupnpc/upnpcommands.h>
],[ ],[
struct UPNPDev * devlist; struct UPNPDev * devlist;
struct UPNPUrls urls; struct UPNPUrls urls;
struct IGDdatas data; struct IGDdatas data;
char lanaddr[16]; char lanaddr[16];
char portStr[8]; char portStr[8];
char intPort[8]; char intPort[8];
char intClient[16]; char intClient[16];
upnpDiscover( 2000, NULL, NULL, 0 ); upnpDiscover( 2000, NULL, NULL, 0 );
UPNP_GetValidIGD( devlist, &urls, &data, lanaddr, sizeof( lanaddr ) ); UPNP_GetValidIGD( devlist, &urls, &data, lanaddr, sizeof( lanaddr ) );
UPNP_GetSpecificPortMappingEntry( urls.controlURL, data.first.servicetype, UPNP_GetSpecificPortMappingEntry( urls.controlURL, data.first.servicetype,
portStr, "TCP", intClient, intPort ); portStr, "TCP", intClient, intPort );
],[ ],[
AC_DEFINE(HAVE_MINIUPNP_15, 1, [Define to 1 if you have miniupnpc version 1.5]) AC_DEFINE(HAVE_MINIUPNP_15, 1, [Define to 1 if you have miniupnpc version 1.5])
upnp_version="1.5"]) upnp_version="1.5"])
# See if the OS has its miniupnp 1.6 installed # See if the OS has its miniupnp 1.6 installed
AC_TRY_LINK([ AC_TRY_LINK([
#include <stdlib.h> #include <stdlib.h>
#include <errno.h> #include <errno.h>
#include <miniupnpc/miniupnpc.h> #include <miniupnpc/miniupnpc.h>
#include <miniupnpc/upnpcommands.h> #include <miniupnpc/upnpcommands.h>
],[ ],[
struct UPNPDev * devlist; struct UPNPDev * devlist;
struct UPNPUrls urls; struct UPNPUrls urls;
struct IGDdatas data; struct IGDdatas data;
char lanaddr[16]; char lanaddr[16];
char portStr[8]; char portStr[8];
char intPort[8]; char intPort[8];
char intClient[16]; char intClient[16];
upnpDiscover( 2000, NULL, NULL, 0, 0, &errno ); upnpDiscover( 2000, NULL, NULL, 0, 0, &errno );
UPNP_GetValidIGD( devlist, &urls, &data, lanaddr, sizeof( lanaddr ) ); UPNP_GetValidIGD( devlist, &urls, &data, lanaddr, sizeof( lanaddr ) );
UPNP_GetSpecificPortMappingEntry( urls.controlURL, data.first.servicetype, UPNP_GetSpecificPortMappingEntry( urls.controlURL, data.first.servicetype,
portStr, "TCP", intClient, intPort, NULL, NULL, NULL ); portStr, "TCP", intClient, intPort, NULL, NULL, NULL );
],[ ],[
AC_DEFINE(HAVE_MINIUPNP_16, 1, [Define to 1 if you have miniupnpc version 1.6]) AC_DEFINE(HAVE_MINIUPNP_16, 1, [Define to 1 if you have miniupnpc version 1.6])
upnp_version="1.6"]) upnp_version="1.6"])
# ... and the results of our tests # ... and the results of our tests
LIBS="$ac_save_LIBS" LIBS="$ac_save_LIBS"
AC_MSG_RESULT([$upnp_version]) AC_MSG_RESULT([$upnp_version])
AM_CONDITIONAL([BUILD_MINIUPNP],[test "x$upnp_version" = "xnone"]) AM_CONDITIONAL([BUILD_MINIUPNP],[test "x$upnp_version" = "xnone"])
if test "x$upnp_version" = "xnone" ; then if test "x$upnp_version" = "xnone" ; then
LIBUPNP_CFLAGS="-I\$(top_srcdir)/third-party/" LIBUPNP_CFLAGS="-I\$(top_srcdir)/third-party/"
LIBUPNP_LIBS="\$(top_builddir)/third-party/miniupnp/libminiupnp.a" LIBUPNP_LIBS="\$(top_builddir)/third-party/miniupnp/libminiupnp.a"
LIBUPNP_LIBS_QT="\$\${TRANSMISSION_TOP}/third-party/miniupnp/libminiupnp.a" LIBUPNP_LIBS_QT="\$\${TRANSMISSION_TOP}/third-party/miniupnp/libminiupnp.a"
dnl because this is the version that we bundle... dnl because this is the version that we bundle...
AC_DEFINE(HAVE_MINIUPNP_16, 1, [Define to 1 if you have miniupnpc version 1.6]) AC_DEFINE(HAVE_MINIUPNP_16, 1, [Define to 1 if you have miniupnpc version 1.6])
else else
AC_DEFINE([SYSTEM_MINIUPNP]) AC_DEFINE([SYSTEM_MINIUPNP])
LIBUPNP_CFLAGS="" LIBUPNP_CFLAGS=""
LIBUPNP_LIBS="-lminiupnpc" LIBUPNP_LIBS="-lminiupnpc"
LIBUPNP_LIBS_QT="-lminiupnpc" LIBUPNP_LIBS_QT="-lminiupnpc"
fi fi
AC_SUBST(LIBUPNP_CFLAGS) AC_SUBST(LIBUPNP_CFLAGS)
AC_SUBST(LIBUPNP_LIBS) AC_SUBST(LIBUPNP_LIBS)
AC_SUBST(LIBUPNP_LIBS_QT) AC_SUBST(LIBUPNP_LIBS_QT)
dnl ---------------------------------------------------------------------------- dnl ----------------------------------------------------------------------------
@@ -327,7 +327,7 @@ fi
if test "x$with_gtk" = "x3" ; then if test "x$with_gtk" = "x3" ; then
PKG_CHECK_EXISTS([gtk+-3.0 >= $GTK3_MINIMUM],[gtk_version="3" with_gtk="yes"],[gtk_version="none" with_gtk="no"]) PKG_CHECK_EXISTS([gtk+-3.0 >= $GTK3_MINIMUM],[gtk_version="3" with_gtk="yes"],[gtk_version="none" with_gtk="no"])
fi fi
AC_ARG_ENABLE([nls], AC_ARG_ENABLE([nls],
[AS_HELP_STRING([--enable-nls],[enable native language support])],, [AS_HELP_STRING([--enable-nls],[enable native language support])],,
[enable_nls=yes]) [enable_nls=yes])
AM_CONDITIONAL([BUILD_GTK],[test "x$with_gtk" = "xyes"]) AM_CONDITIONAL([BUILD_GTK],[test "x$with_gtk" = "xyes"])
@@ -370,7 +370,7 @@ if test "x$with_gtk" = "xyes" ; then
if test "x$have_libappindicator" = "xyes"; then if test "x$have_libappindicator" = "xyes"; then
use_libappindicator=yes use_libappindicator=yes
AC_DEFINE([HAVE_LIBAPPINDICATOR], 1) AC_DEFINE([HAVE_LIBAPPINDICATOR], 1)
else else
LIBAPPINDICATOR_CFLAGS= LIBAPPINDICATOR_CFLAGS=
LIBAPPINDICATOR_LIBS= LIBAPPINDICATOR_LIBS=
@@ -436,9 +436,9 @@ AC_ARG_ENABLE([lightweight],
AS_HELP_STRING([--enable-lightweight],[optimize libtransmission for low-resource systems: smaller cache size, prefer unencrypted peer connections, etc.]), AS_HELP_STRING([--enable-lightweight],[optimize libtransmission for low-resource systems: smaller cache size, prefer unencrypted peer connections, etc.]),
[enable_lightweight=${enableval}], [enable_lightweight=${enableval}],
[enable_lightweight="no"]) [enable_lightweight="no"])
if test "x$enable_lightweight" = "xyes" ; then if test "x$enable_lightweight" = "xyes" ; then
AC_DEFINE([TR_LIGHTWEIGHT],[1],[optimize libtransmission for low-resource systems]) AC_DEFINE([TR_LIGHTWEIGHT],[1],[optimize libtransmission for low-resource systems])
fi fi
AC_ARG_ENABLE([cli], AC_ARG_ENABLE([cli],
[AS_HELP_STRING([--enable-cli],[build command-line client])], [AS_HELP_STRING([--enable-cli],[build command-line client])],

View File

@@ -363,7 +363,7 @@ on_scrape_done( tr_session * session,
tr_benc * flags; tr_benc * flags;
const char * str; const char * str;
const int benc_loaded = !tr_bencLoad( msg, msglen, &top, NULL ); const int benc_loaded = !tr_bencLoad( msg, msglen, &top, NULL );
if( getenv( "TR_CURL_VERBOSE" ) != NULL ) if( getenv( "TR_CURL_VERBOSE" ) != NULL )
{ {
if( !benc_loaded ) if( !benc_loaded )
@@ -378,7 +378,7 @@ on_scrape_done( tr_session * session,
tr_free( str ); tr_free( str );
} }
} }
if( benc_loaded ) if( benc_loaded )
{ {
if( tr_bencDictFindStr( &top, "failure reason", &str ) ) if( tr_bencDictFindStr( &top, "failure reason", &str ) )

View File

@@ -2675,7 +2675,6 @@ tr_sessionSetQueueStalledMinutes( tr_session * session, int minutes )
assert( minutes > 0 ); assert( minutes > 0 );
session->queueStalledMinutes = minutes; session->queueStalledMinutes = minutes;
} }
void void
@@ -2686,7 +2685,7 @@ tr_sessionSetQueueStalledEnabled( tr_session * session, bool is_enabled )
session->stalledEnabled = is_enabled; session->stalledEnabled = is_enabled;
} }
bool bool
tr_sessionGetQueueStalledEnabled( const tr_session * session ) tr_sessionGetQueueStalledEnabled( const tr_session * session )
{ {

View File

@@ -759,7 +759,7 @@ void tr_torrentSetPriority( tr_torrent *, tr_priority_t );
**** Torrents can be moved in the queue using the simple functions **** Torrents can be moved in the queue using the simple functions
**** tr_torrentQueueMove{Top,Up,Down,Bottom}. They can be moved to **** tr_torrentQueueMove{Top,Up,Down,Bottom}. They can be moved to
**** arbitrary points in the queue with tr_torrentSetQueuePosition(). **** arbitrary points in the queue with tr_torrentSetQueuePosition().
**** ****
***/ ***/

View File

@@ -1634,12 +1634,12 @@ tr_htonll( uint64_t x )
#ifdef HAVE_HTONLL #ifdef HAVE_HTONLL
return htonll( x ); return htonll( x );
#else #else
/* fallback code by bdonlan at /* fallback code by bdonlan at
* http://stackoverflow.com/questions/809902/64-bit-ntohl-in-c/875505#875505 */ * http://stackoverflow.com/questions/809902/64-bit-ntohl-in-c/875505#875505 */
union { uint32_t lx[2]; uint64_t llx; } u; union { uint32_t lx[2]; uint64_t llx; } u;
u.lx[0] = htonl(x >> 32); u.lx[0] = htonl(x >> 32);
u.lx[1] = htonl(x & 0xFFFFFFFFULL); u.lx[1] = htonl(x & 0xFFFFFFFFULL);
return u.llx; return u.llx;
#endif #endif
} }
@@ -1649,11 +1649,11 @@ tr_ntohll( uint64_t x )
#ifdef HAVE_NTOHLL #ifdef HAVE_NTOHLL
return ntohll( x ); return ntohll( x );
#else #else
/* fallback code by bdonlan at /* fallback code by bdonlan at
* http://stackoverflow.com/questions/809902/64-bit-ntohl-in-c/875505#875505 */ * http://stackoverflow.com/questions/809902/64-bit-ntohl-in-c/875505#875505 */
union { uint32_t lx[2]; uint64_t llx; } u; union { uint32_t lx[2]; uint64_t llx; } u;
u.llx = x; u.llx = x;
return ((uint64_t)ntohl(u.lx[0]) << 32) | (uint64_t)ntohl(u.lx[1]); return ((uint64_t)ntohl(u.lx[0]) << 32) | (uint64_t)ntohl(u.lx[1]);
#endif #endif
} }

View File

@@ -242,7 +242,7 @@ addURL( tr_benc * metainfo, const char * url )
if( !had_announce_list ) if( !had_announce_list )
{ {
announce_list = tr_bencDictAddList( metainfo, "announce-list", 2 ); announce_list = tr_bencDictAddList( metainfo, "announce-list", 2 );
if( had_announce ) if( had_announce )
{ {
/* we're moving from an 'announce' to an 'announce-list', /* we're moving from an 'announce' to an 'announce-list',