From 27a1b2dc33ee3e4b4d168d7927d97c1d898f0c77 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sun, 12 Dec 2010 16:43:19 +0000 Subject: [PATCH] (trunk) one of the periodic, banal "remove-trailing-spaces from lines of source code" cleanup commits --- daemon/remote.c | 10 +++++----- gtk/file-list.c | 2 +- gtk/makemeta-ui.c | 2 +- gtk/torrent-cell-renderer.c | 2 +- gtk/tr-core.c | 2 +- gtk/tr-window.c | 4 ++-- gtk/util.c | 2 +- libtransmission/history.h | 2 +- libtransmission/list.h | 12 ++++++------ libtransmission/peer-common.h | 1 - libtransmission/session.h | 4 ++-- libtransmission/torrent.c | 4 ++-- libtransmission/torrent.h | 4 ++-- libtransmission/tr-getopt.c | 2 +- libtransmission/transmission.h | 2 +- qt/favicon.cc | 2 +- qt/file-tree.cc | 2 +- qt/filterbar.cc | 6 +++--- qt/torrent-model.cc | 2 +- qt/tracker-delegate.cc | 2 +- qt/tracker-delegate.h | 2 +- qt/utils.h | 2 +- utils/edit.c | 1 - utils/show.c | 4 ++-- 24 files changed, 38 insertions(+), 40 deletions(-) diff --git a/daemon/remote.c b/daemon/remote.c index e9efbbec6..329269847 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -1006,7 +1006,7 @@ printDetails( tr_benc * top ) if (tr_bencDictFindInt (t, "bandwidthPriority", &i)) printf (" Bandwidth Priority: %s\n", bandwidthPriorityNames[(i + 1) & 3]); - + printf( "\n" ); } } @@ -1885,7 +1885,7 @@ processArgs( const char * host, int port, int argc, const char ** argv ) fields = tr_bencDictAddList( args, "fields", 0 ); if( tset != 0 ) { addIdArg( tr_bencDictFind( tset, ARGUMENTS ), id ); status |= flush( host, port, &tset ); } - + switch( c ) { case 'i': tr_bencDictAddInt( top, "tag", TAG_DETAILS ); @@ -2008,7 +2008,7 @@ processArgs( const char * host, int port, int argc, const char ** argv ) targs = ensure_tset( &tset ); else sargs = ensure_sset( &sset ); - + switch( c ) { case 'd': if( targs ) { @@ -2077,9 +2077,9 @@ processArgs( const char * host, int port, int argc, const char ** argv ) args = tr_bencDictFind( tadd, ARGUMENTS ); else args = ensure_tset( &tset ); - + switch( c ) - { + { case 'g': addFiles( args, "files-wanted", optarg ); break; case 'G': addFiles( args, "files-unwanted", optarg ); diff --git a/gtk/file-list.c b/gtk/file-list.c index ba6d1f2c6..b6d0a11f7 100644 --- a/gtk/file-list.c +++ b/gtk/file-list.c @@ -295,7 +295,7 @@ getSelectedFilesForeach( GtkTreeModel * model, if( is_file ) { struct ActiveData * data = gdata; - + /* active means: if it's selected or any ancestor is selected */ gboolean is_active = gtk_tree_selection_iter_is_selected( data->sel, iter ); diff --git a/gtk/makemeta-ui.c b/gtk/makemeta-ui.c index 6437720bc..7f3c2e9a3 100644 --- a/gtk/makemeta-ui.c +++ b/gtk/makemeta-ui.c @@ -303,7 +303,7 @@ updatePiecesLabel( MakeMetaUI * ui ) builder->fileCount ), buf, builder->fileCount ); g_string_append( gstr, "; " ); - + tr_formatter_mem_B( buf, builder->pieceSize, sizeof( buf ) ); g_string_append_printf( gstr, gtr_ngettext( "%1$'d Piece @ %2$s", "%1$'d Pieces @ %2$s", diff --git a/gtk/torrent-cell-renderer.c b/gtk/torrent-cell-renderer.c index 041aa7d88..66cbc0a49 100644 --- a/gtk/torrent-cell-renderer.c +++ b/gtk/torrent-cell-renderer.c @@ -522,7 +522,7 @@ torrent_cell_renderer_get_size( GtkCellRenderer * cell, if( x_offset ) *x_offset = cell_area ? cell_area->x : 0; - + if( y_offset ) *y_offset = cell_area ? (int)((cell_area->height - (cell->ypad*2 +h)) / 2.0) : 0; } diff --git a/gtk/tr-core.c b/gtk/tr-core.c index 9278fc41e..3e70fb42e 100644 --- a/gtk/tr-core.c +++ b/gtk/tr-core.c @@ -1181,7 +1181,7 @@ tr_core_present_window( TrCore * core UNUSED, /* Setting the toggle-main-window GtkCheckMenuItem to make sure its state is correctly set */ action_toggle( "toggle-main-window", TRUE); - + *success = TRUE; return TRUE; } diff --git a/gtk/tr-window.c b/gtk/tr-window.c index 4237e41f0..d16fb6dee 100644 --- a/gtk/tr-window.c +++ b/gtk/tr-window.c @@ -864,7 +864,7 @@ void tr_window_set_busy( TrWindow * w, gboolean isBusy ) { if( w && gtr_widget_get_realized( GTK_WIDGET( w ) ) ) - { + { GdkDisplay * display = gtk_widget_get_display( GTK_WIDGET( w ) ); GdkCursor * cursor = isBusy ? gdk_cursor_new_for_display( display, GDK_WATCH ) : NULL; @@ -872,6 +872,6 @@ tr_window_set_busy( TrWindow * w, gboolean isBusy ) gdk_display_flush( display ); if( cursor ) - gdk_cursor_unref( cursor ); + gdk_cursor_unref( cursor ); } } diff --git a/gtk/util.c b/gtk/util.c index c62f23c8b..5ff7858e0 100644 --- a/gtk/util.c +++ b/gtk/util.c @@ -123,7 +123,7 @@ gtr_compare_double( const double a, const double b, int decimal_places ) const int64_t ia = (int64_t)(a * pow( 10, decimal_places ) ); const int64_t ib = (int64_t)(b * pow( 10, decimal_places ) ); if( ia < ib ) return -1; - if( ia > ib ) return 1; + if( ia > ib ) return 1; return 0; } diff --git a/libtransmission/history.h b/libtransmission/history.h index 9e47a70cd..843f9cd5f 100644 --- a/libtransmission/history.h +++ b/libtransmission/history.h @@ -20,7 +20,7 @@ /** * A generic short-term memory object that remembers how many times * something happened over the last N seconds. - * + * * For example, it could count how many are bytes transferred * to estimate the speed over the last N seconds. */ diff --git a/libtransmission/list.h b/libtransmission/list.h index 3c178bb4d..59719d753 100644 --- a/libtransmission/list.h +++ b/libtransmission/list.h @@ -100,12 +100,12 @@ tr_list* tr_list_find( tr_list * list, const void * b, TrListCompareFunc compare_func ); -/** - * @brief Insert in an ordered list - * @param list pointer to the list - * @param item the item to be inserted - * @param compare the comparison function. - */ +/** + * @brief Insert in an ordered list + * @param list pointer to the list + * @param item the item to be inserted + * @param compare the comparison function. + */ void tr_list_insert_sorted( tr_list ** list, void * data, TrListCompareFunc compare ); diff --git a/libtransmission/peer-common.h b/libtransmission/peer-common.h index 476ca628b..ee6b6d884 100644 --- a/libtransmission/peer-common.h +++ b/libtransmission/peer-common.h @@ -39,7 +39,6 @@ enum most bittorrent clients will reject requests larger than this size. */ MAX_BLOCK_SIZE = ( 1024 * 16 ) - }; typedef enum diff --git a/libtransmission/session.h b/libtransmission/session.h index 389b73519..25fb0c5d1 100644 --- a/libtransmission/session.h +++ b/libtransmission/session.h @@ -181,7 +181,7 @@ struct tr_session struct tr_bandwidth * bandwidth; double desiredRatio; - + uint16_t idleLimitMinutes; struct tr_bindinfo * public_ipv4; @@ -226,7 +226,7 @@ const struct tr_address* tr_sessionGetPublicAddress( const tr_session *, int tr struct tr_bindsockets * tr_sessionGetBindSockets( tr_session * ); -int tr_sessionCountTorrents( const tr_session * session ); +int tr_sessionCountTorrents( const tr_session * session ); enum { diff --git a/libtransmission/torrent.c b/libtransmission/torrent.c index 8a51d532f..6f8ce17a2 100644 --- a/libtransmission/torrent.c +++ b/libtransmission/torrent.c @@ -2307,8 +2307,8 @@ tr_torrentPieceNeedsCheck( const tr_torrent * tor, tr_piece_index_t p ) uint64_t unused; tr_file_index_t f; const tr_info * inf = tr_torrentInfo( tor ); - - /* if we've never checked this piece, then it needs to be checked */ + + /* if we've never checked this piece, then it needs to be checked */ if( !inf->pieces[p].timeChecked ) { tr_tordbg( tor, "[LAZY] piece %zu needs to be tested because it's never been tested", (size_t)p ); return TRUE; diff --git a/libtransmission/torrent.h b/libtransmission/torrent.h index f7274f603..b2df8142d 100644 --- a/libtransmission/torrent.h +++ b/libtransmission/torrent.h @@ -185,7 +185,7 @@ struct tr_torrent time_t dhtAnnounce6At; tr_bool dhtAnnounceInProgress; tr_bool dhtAnnounce6InProgress; - + time_t lpdAnnounceAt; uint64_t downloadedCur; @@ -417,7 +417,7 @@ tr_bool tr_torrentPieceNeedsCheck( const tr_torrent * tor, tr_piece_index_t piec /** * @brief Test a piece against its info dict checksum * @return true if the piece's passes the checksum test - */ + */ tr_bool tr_torrentCheckPiece( tr_torrent * tor, tr_piece_index_t pieceIndex ); uint64_t tr_torrentGetCurrentSizeOnDisk( const tr_torrent * tor ); diff --git a/libtransmission/tr-getopt.c b/libtransmission/tr-getopt.c index 3522e1f9c..a53363169 100644 --- a/libtransmission/tr-getopt.c +++ b/libtransmission/tr-getopt.c @@ -60,7 +60,7 @@ getopts_usage_line( const tr_option * opt, int shortWidth, int argWidth ) { - int len; + int len; const char * longName = opt->longName ? opt->longName : ""; const char * shortName = opt->shortName ? opt->shortName : ""; const char * arg = getArgName( opt ); diff --git a/libtransmission/transmission.h b/libtransmission/transmission.h index d1fc66ce3..92395987c 100644 --- a/libtransmission/transmission.h +++ b/libtransmission/transmission.h @@ -1855,7 +1855,7 @@ typedef struct tr_stat /** The last time we uploaded or downloaded piece data on this torrent. */ time_t activityDate; - + /** Number of seconds since the last activity (or since started). -1 if activity is not seeding or downloading. */ int idleSecs; diff --git a/qt/favicon.cc b/qt/favicon.cc index 003d0ddcd..41b6f3f10 100644 --- a/qt/favicon.cc +++ b/qt/favicon.cc @@ -52,7 +52,7 @@ Favicons :: ensureCacheDirHasBeenScanned( ) if( !hasBeenScanned ) { hasBeenScanned = true; - + QDir cacheDir( getCacheDir( ) ); cacheDir.mkpath( cacheDir.absolutePath( ) ); diff --git a/qt/file-tree.cc b/qt/file-tree.cc index 9d071b385..a252e7092 100644 --- a/qt/file-tree.cc +++ b/qt/file-tree.cc @@ -696,7 +696,7 @@ FileTreeView :: eventFilter( QObject * o, QEvent * event ) } // handle using the keyboard to toggle the - // wanted/unwanted state or the file priority + // wanted/unwanted state or the file priority else if( event->type() == QEvent::KeyPress ) { switch( dynamic_cast(event)->key() ) diff --git a/qt/filterbar.cc b/qt/filterbar.cc index 5b6116bd9..f3d4b60ee 100644 --- a/qt/filterbar.cc +++ b/qt/filterbar.cc @@ -265,7 +265,7 @@ FilterBar :: createActivityCombo( ) /**** ***** -***** +***** ***** ****/ @@ -385,7 +385,7 @@ FilterBar :: createTrackerCombo( QStandardItemModel * model ) /**** ***** -***** +***** ***** ****/ @@ -413,7 +413,7 @@ FilterBar :: FilterBar( Prefs& prefs, TorrentModel& torrents, TorrentFilter& fil myTrackerCombo = createTrackerCombo( myTrackerModel ); h->addWidget( myTrackerCombo, 1 ); h->addSpacing( hmargin*2 ); - + myLineEdit = new QLineEdit( this ); h->addWidget( myLineEdit ); connect( myLineEdit, SIGNAL(textChanged(QString)), this, SLOT(onTextChanged(QString))); diff --git a/qt/torrent-model.cc b/qt/torrent-model.cc index 5f87a1c2a..22163e0cd 100644 --- a/qt/torrent-model.cc +++ b/qt/torrent-model.cc @@ -216,7 +216,7 @@ TorrentModel :: removeTorrent( int id ) beginRemoveRows( QModelIndex(), row, row ); // make the myIdToRow map consistent with list view/model - for( QMap::iterator i = myIdToRow.begin(); i != myIdToRow.end(); ++i ) + for( QMap::iterator i = myIdToRow.begin(); i != myIdToRow.end(); ++i ) if( i.value() > row ) --i.value(); myIdToRow.remove( id ); diff --git a/qt/tracker-delegate.cc b/qt/tracker-delegate.cc index 7ff9ad4ff..c0c7bda05 100644 --- a/qt/tracker-delegate.cc +++ b/qt/tracker-delegate.cc @@ -53,7 +53,7 @@ TrackerDelegate :: sizeHint( const QStyleOptionViewItem& option, const TrackerIn Q_UNUSED( option ); QPixmap favicon = info.st.getFavicon( ); - + const QString text = TrackerDelegate :: getText( info ); QTextDocument textDoc; textDoc.setHtml( text ); diff --git a/qt/tracker-delegate.h b/qt/tracker-delegate.h index cc8e7a784..1bef8398c 100644 --- a/qt/tracker-delegate.h +++ b/qt/tracker-delegate.h @@ -38,7 +38,7 @@ class TrackerDelegate: public QItemDelegate void setShowMore( bool b ); protected: - QString getText( const TrackerInfo& ) const; + QString getText( const TrackerInfo& ) const; QSize margin( const QStyle& style ) const; virtual QSize sizeHint( const QStyleOptionViewItem&, const TrackerInfo& ) const; void drawTracker( QPainter*, const QStyleOptionViewItem&, const TrackerInfo& ) const; diff --git a/qt/utils.h b/qt/utils.h index 0d8e45b39..0557cf3e7 100644 --- a/qt/utils.h +++ b/qt/utils.h @@ -34,7 +34,7 @@ class Utils: public QObject // meh static void toStderr( const QString& qstr ); - /// + /// /// URLs /// diff --git a/utils/edit.c b/utils/edit.c index 494e00776..e846b6040 100644 --- a/utils/edit.c +++ b/utils/edit.c @@ -137,7 +137,6 @@ removeURL( tr_benc * metainfo, const char * url ) } } } - return changed; } diff --git a/utils/show.c b/utils/show.c index 1906ce288..9a71e8ca0 100644 --- a/utils/show.c +++ b/utils/show.c @@ -14,7 +14,7 @@ #include #define CURL_DISABLE_TYPECHECK /* otherwise -Wunreachable-code goes insane */ -#include +#include #include /* struct evbuffer */ @@ -127,7 +127,7 @@ showInfo( const tr_info * inf ) **/ printf( "\nTRACKERS\n" ); - for( i=0; i<(int)inf->trackerCount; ++i ) + for( i=0; i<(int)inf->trackerCount; ++i ) { if( prevTier != inf->trackers[i].tier ) { -- 2.40.0