(trunk) all this commit does is remove trailing whitespace from some c, c++, and javascript source

This commit is contained in:
Charles Kerr 2009-08-12 14:40:32 +00:00
parent 6f547956a4
commit bf1a544939
27 changed files with 96 additions and 98 deletions

View File

@ -215,7 +215,7 @@ main( int argc, char ** argv )
signal( SIGINT, gotsig );
signal( SIGTERM, gotsig );
#ifndef WIN32
#ifndef WIN32
signal( SIGQUIT, gotsig );
signal( SIGPIPE, SIG_IGN );
signal( SIGHUP, SIG_IGN );

View File

@ -1435,7 +1435,7 @@ tr_bencDictChild( tr_benc * dict, size_t n, const char ** key, tr_benc ** val )
return success;
}
void
void
tr_bencMergeDicts( tr_benc * target, const tr_benc * source )
{
size_t i;

View File

@ -341,7 +341,6 @@ tr_cryptoWeakRandInt( int upperBound )
init = TRUE;
}
val = rand( ) % upperBound;
assert( val >= 0 );
assert( val < upperBound );
@ -413,6 +412,6 @@ tr_ssha1_matches( const char * source, const char * pass )
tr_free( hashed );
tr_free( salt );
return result;
}

View File

@ -29,7 +29,7 @@ struct evbuffer;
/**
* @addtogroup utils Utilities
* @{
* @{
*/
typedef struct tr_crypto tr_crypto;

View File

@ -31,7 +31,7 @@
* This older format is kept only for reading older resume files for users
* who upgrade from older versions of Transmission, and may be removed
* after more time has passed.
*/
*/
/***********************************************************************
* Fast resume

View File

@ -39,7 +39,7 @@
#undef read
#endif
#define read _read
#if defined(write)
#undef write
#endif

View File

@ -3,7 +3,7 @@
*
* This file is licensed by the GPL version 2. Works owned by the
* Transmission project are granted a special exemption to clause 2(b)
* so that the bulk of its code can remain under the MIT license.
* so that the bulk of its code can remain under the MIT license.
* This exemption does not extend to derived works not owned by
* the Transmission project.
*

View File

@ -17,7 +17,7 @@
#ifndef TR_NATPMP_H
#define TR_NATPMP_H 1
/**
/**
* @addtogroup port_forwarding Port Forwarding
* @{
*/

View File

@ -71,7 +71,7 @@ typedef struct
tr_peer_event;
#ifdef WIN32
#define EMSGSIZE WSAEMSGSIZE
#define EMSGSIZE WSAEMSGSIZE
#endif
/** @} */

View File

@ -390,7 +390,7 @@ static TR_INLINE double tr_peerIoGetPieceSpeed( const tr_peerIo * io, uint64_t n
void tr_peerIoSetEnabled( tr_peerIo * io,
tr_direction dir,
tr_bool isEnabled );
int tr_peerIoFlush( tr_peerIo * io,
tr_direction dir,
size_t byteLimit );

View File

@ -20,7 +20,7 @@
#include "transmission.h"
#include "net.h"
/**
/**
* @addtogroup port_forwarding Port Forwarding
* @{
*/

View File

@ -519,7 +519,7 @@ handle_rpc( struct evhttp_request * req,
data->req = req;
data->server = server;
if( req->type == EVHTTP_REQ_GET )
{
const char * q;
@ -769,7 +769,7 @@ tr_rpcSetWhitelist( tr_rpc_server * server,
tr_ninf( MY_NAME, "Adding address to whitelist: %s (And it has a '+' or '-'! Are you using an old ACL by mistake?)", token );
else
tr_ninf( MY_NAME, "Adding address to whitelist: %s", token );
if( walk[len]=='\0' )
break;
walk += len + 1;

View File

@ -23,7 +23,7 @@ extern "C" {
struct tr_benc;
/* FIXME(libevent2): make "response" an evbuffer and remove response_len */
/* FIXME(libevent2): make "response" an evbuffer and remove response_len */
typedef void( *tr_rpc_response_func )( tr_session * session,
const char * response,
size_t response_len,

View File

@ -53,7 +53,7 @@ struct tr_session
tr_bool isRatioLimited;
tr_benc removedTorrents;
int umask;
int speedLimit[2];

View File

@ -3,7 +3,7 @@
*
* This file is licensed by the GPL version 2. Works owned by the
* Transmission project are granted a special exemption to clause 2(b)
* so that the bulk of its code can remain under the MIT license.
* so that the bulk of its code can remain under the MIT license.
* This exemption does not extend to derived works not owned by
* the Transmission project.
*

View File

@ -160,8 +160,8 @@ tr_dhtInit(tr_session *ss, tr_address * tr_addr)
v[0] = 'T';
v[1] = 'R';
v[2] = (SVN_REVISION_NUM >> 8) & 0xFF;
v[3] = SVN_REVISION_NUM & 0xFF;
v[2] = (SVN_REVISION_NUM >> 8) & 0xFF;
v[3] = SVN_REVISION_NUM & 0xFF;
rc = dht_init( dht_socket, myid, (const unsigned char*)v );
if(rc < 0)
goto fail;

View File

@ -19,7 +19,7 @@ extern "C" {
/**
* @addtogroup utils Utilities
* @{
* @{
*/
extern int tr_optind;

View File

@ -590,7 +590,7 @@ tr_bool tr_sessionIsSpeedLimited ( const tr_session *, tr_direction );
/***
**** Alternative speed limits that are used during scheduled times
**** Alternative speed limits that are used during scheduled times
***/
void tr_sessionSetAltSpeed ( tr_session *, tr_direction, int KB_s );
@ -1432,7 +1432,7 @@ typedef struct tr_stat
Range is [0..1]
@see tr_stat.leftUntilDone */
float percentDone;
/** The percentage of the actual ratio to the seed ratio. This will be
equal to 1 if the ratio is reached or the torrent is set to seed forever.
Range is [0..1] */
@ -1530,7 +1530,7 @@ typedef struct tr_stat
uint64_t haveUnchecked;
/**
* This is a human-readable string with the last scrape's results.
* This is a human-readable string with the last scrape's results.
* 1. If an http error occurred, the response code and description is given.
* 2. If the tracker gave an error or warning messae, that is given.
* 3. If everything went fine, "Success" is given.

View File

@ -17,7 +17,7 @@
#ifndef TR_UPNP_H
#define TR_UPNP_H 1
/**
/**
* @addtogroup port_forwarding Port Forwarding
* @{
*/

View File

@ -64,7 +64,7 @@ class Details: public QDialog
private:
Session& mySession;
TorrentModel& myModel;
TorrentModel& myModel;
QSet<int> myIds;
QTimer myTimer;
bool myHavePendingRefresh;

View File

@ -150,7 +150,6 @@ class FileTreeView: public QTreeView
private:
FileTreeModel myModel;
FileTreeDelegate myDelegate;
};
#endif

View File

@ -43,7 +43,7 @@
#include <QtGui/QIcon>
// This is the QtIconLoader
// This is the QtIconLoader
// Version 0.1
//

View File

@ -25,7 +25,7 @@ function testSafari3()
var toInt = parseInt(version[i]);
var versionField = isNaN(toInt) ? 0 : toInt;
var minimumField = minimum[i];
if (versionField > minimumField) return true;
if (versionField < minimumField) return false;
}
@ -108,7 +108,7 @@ function setInnerHTML( e, html )
};
/*
* Converts file & folder byte size values to more
* Converts file & folder byte size values to more
* readable values (bytes, KB, MB, GB or TB).
*
* @param integer bytes
@ -117,24 +117,24 @@ function setInnerHTML( e, html )
Math.formatBytes = function(bytes) {
var size;
var unit;
// Terabytes (TB).
if ( bytes >= 1099511627776 ) {
if ( bytes >= 1099511627776 ) {
size = bytes / 1099511627776;
unit = ' TB';
unit = ' TB';
// Gigabytes (GB).
} else if ( bytes >= 1073741824 ) {
} else if ( bytes >= 1073741824 ) {
size = bytes / 1073741824;
unit = ' GB';
// Megabytes (MB).
} else if ( bytes >= 1048576 ) {
} else if ( bytes >= 1048576 ) {
size = bytes / 1048576;
unit = ' MB';
// Kilobytes (KB).
} else if ( bytes >= 1024 ) {
} else if ( bytes >= 1024 ) {
size = bytes / 1024;
unit = ' KB';
@ -145,12 +145,12 @@ Math.formatBytes = function(bytes) {
}
// Single-digit numbers have greater precision
var precision = 1;
var precision = 1;
if (size < 10) {
precision = 2;
}
size = Math.roundWithPrecision(size, precision);
// Add the decimal if this is an integer
if ((size % 1) == 0 && unit != ' bytes') {
size = size + '.0';
@ -172,14 +172,14 @@ Math.formatSeconds = function(seconds)
var days = Math.floor(seconds / 86400);
var hours = Math.floor((seconds % 86400) / 3600);
var minutes = Math.floor((seconds % 3600) / 60);
var seconds = Math.floor((seconds % 3600) % 60);
var seconds = Math.floor((seconds % 3600) % 60);
if (days > 0 && hours == 0)
result = days + ' days';
else if (days > 0 && hours > 0)
result = days + ' days ' + hours + ' hr';
else if (hours > 0 && minutes == 0)
result = hours + ' hr';
result = hours + ' hr';
else if (hours > 0 && minutes > 0)
result = hours + ' hr ' + minutes + ' min';
else if (minutes > 0 && seconds == 0)
@ -187,7 +187,7 @@ Math.formatSeconds = function(seconds)
else if (minutes > 0 && seconds > 0)
result = minutes + ' min ' + seconds + ' seconds';
else
result = seconds + ' seconds';
result = seconds + ' seconds';
return result;
};
@ -205,7 +205,7 @@ Math.formatTimestamp = function(seconds) {
};
/*
* Round a float to a specified number of decimal
* Round a float to a specified number of decimal
* places, stripping trailing zeroes
*
* @param float floatnum

View File

@ -9,7 +9,7 @@
function Dialog(){
this.initialize();
}
Dialog.prototype = {
/*
@ -36,11 +36,11 @@ Dialog.prototype = {
/*--------------------------------------------
*
*
* E V E N T F U N C T I O N S
*
*
*--------------------------------------------*/
hideDialog: function( )
@ -69,11 +69,11 @@ Dialog.prototype = {
},
/*--------------------------------------------
*
*
* I N T E R F A C E F U N C T I O N S
*
*
*--------------------------------------------*/
/*
* Display a confirm dialog
*/
@ -102,7 +102,7 @@ Dialog.prototype = {
setTimeout("$('div#dialog_container div.dialog_window').css('top', '0px');",10);
}
},
/*
* Display an alert dialog
*/

View File

@ -8,7 +8,7 @@
function Torrent( transferListParent, fileListParent, controller, data) {
this.initialize( transferListParent, fileListParent, controller, data);
}
}
// Constants
Torrent._StatusWaitingToCheck = 1;
@ -151,9 +151,9 @@ Torrent.prototype =
},
/*--------------------------------------------
*
*
* S E T T E R S / G E T T E R S
*
*
*--------------------------------------------*/
/* Return the DOM element for this torrent (a <LI> element) */
@ -226,9 +226,9 @@ Torrent.prototype =
},
/*--------------------------------------------
*
*
* E V E N T F U N C T I O N S
*
*
*--------------------------------------------*/
/*
@ -298,9 +298,9 @@ Torrent.prototype =
},
/*--------------------------------------------
*
*
* I N T E R F A C E F U N C T I O N S
*
*
*--------------------------------------------*/
refresh: function(data) {

View File

@ -5,17 +5,17 @@
*
* Class Transmission
*/
function Transmission(){
this.initialize();
}
}
Transmission.prototype =
{
/*--------------------------------------------
*
*
* C O N S T R U C T O R
*
*
*--------------------------------------------*/
initialize: function()
@ -162,7 +162,7 @@ Transmission.prototype =
for( var i=0, row; row=arguments[i]; ++i )
jQuery("<img>").attr("src", row);
},
/*
* Set up the preference validation
*/
@ -179,7 +179,7 @@ Transmission.prototype =
}
});
},
/*
* Load the clutch prefs and init the GUI according to those prefs
*/
@ -260,7 +260,7 @@ Transmission.prototype =
contextDeselectAll: function( ) {
this.deselectAll( true );
},
/*
* Create the torrent right-click menu
*/
@ -288,13 +288,13 @@ Transmission.prototype =
boundingElement: $('div#torrent_container'),
boundingRightPad: 20,
boundingBottomPad: 5,
onContextMenu: function(e) {
tr.setSelectedTorrent( $(e.target).closest('.torrent')[0]._torrent, true );
return true;
onContextMenu: function(e) {
tr.setSelectedTorrent( $(e.target).closest('.torrent')[0]._torrent, true );
return true;
}
});
},
/*
* Create the footer settings menu
*/
@ -309,12 +309,12 @@ Transmission.prototype =
$('#unlimited_download_rate').selectMenuItem();
$('#unlimited_upload_rate').selectMenuItem();
},
/*--------------------------------------------
*
*
* U T I L I T I E S
*
*
*--------------------------------------------*/
getAllTorrents: function()
@ -404,9 +404,9 @@ Transmission.prototype =
},
/*--------------------------------------------
*
*
* S E L E C T I O N
*
*
*--------------------------------------------*/
setSelectedTorrent: function( torrent, doUpdate ) {
@ -486,11 +486,11 @@ Transmission.prototype =
},
/*--------------------------------------------
*
*
* E V E N T F U N C T I O N S
*
*
*--------------------------------------------*/
/*
* Process key event
*/
@ -521,7 +521,7 @@ Transmission.prototype =
tr.selectRow( i, true );
}
},
isButtonEnabled: function(e) {
var p = e.target ? e.target.parentNode : e.srcElement.parentNode;
return p.className!='disabled' && p.parentNode.className!='disabled';
@ -640,7 +640,7 @@ Transmission.prototype =
// Select the clicked tab, unselect the others,
// and display the appropriate info
var tab_ids = $(tab).parent('#inspector_tabs').find('.inspector_tab').map(
function() { return $(this).attr('id'); }
function() { return $(this).attr('id'); }
);
for( var i=0, row; row=tab_ids[i]; ++i ) {
if (tab.id == row) {
@ -733,11 +733,11 @@ Transmission.prototype =
},
/*--------------------------------------------
*
*
* I N T E R F A C E F U N C T I O N S
*
*
*--------------------------------------------*/
showPrefsDialog: function( ) {
$('body').addClass('prefs_showing');
$('#prefs_container').show();
@ -761,7 +761,7 @@ Transmission.prototype =
}
this.updateButtonStates( );
},
/*
* Process got some new session data from the server
*/
@ -798,7 +798,7 @@ Transmission.prototype =
$(key).deselectMenuSiblings().selectMenuItem();
}
},
setSearch: function( search ) {
this._current_search = search ? search.trim() : null;
this.refilter( );
@ -869,7 +869,7 @@ Transmission.prototype =
tr.remote.savePrefs( args );
break;
// Sort the torrent list
// Sort the torrent list
case 'footer_sort_menu':
// The 'reverse sort' option state can be toggled independently of the other options
@ -905,7 +905,7 @@ Transmission.prototype =
{
this._last_torrent_clicked = torrent;
},
/*
* Update the inspector with the latest data for the selected torrents
*/
@ -1023,7 +1023,7 @@ Transmission.prototype =
var tracker = t._tracker;
if( total_tracker == null )
total_tracker = tracker;
else if ( total_tracker.search ( tracker ) == -1 )
else if ( total_tracker.search ( tracker ) == -1 )
total_tracker += ', ' + tracker;
if( t._is_private )
have_private = true;
@ -1074,7 +1074,7 @@ Transmission.prototype =
jQuery.each( this.getDeselectedTorrents(), function() { this.hideFileList(); } );
}
},
/*
* Toggle the visibility of the inspector (used by the context menu)
*/
@ -1102,7 +1102,7 @@ Transmission.prototype =
this.setPref( Prefs._ShowInspector, true );
this.updateInspector( );
},
/*
* Hide the inspector
*/
@ -1263,7 +1263,7 @@ Transmission.prototype =
row.toggleClass('even', isEven);
}
},
updateStatusbar: function()
{
var torrents = this.getAllTorrents();
@ -1296,7 +1296,7 @@ Transmission.prototype =
if( iPhone ) s = 'DL: ' + s;
setInnerHTML( $('#torrent_global_download')[0], s );
},
/*
* Select a torrent file to upload
* FIXME
@ -1306,7 +1306,7 @@ Transmission.prototype =
// Display the upload dialog
if (! confirmed) {
$('input#torrent_upload_file').attr('value', '');
$('input#torrent_upload_url').attr('value', '');
$('input#torrent_upload_url').attr('value', '');
$('#upload_container').show();
if (!iPhone && Safari3) {
setTimeout("$('div#upload_container div.dialog_window').css('top', '0px');",10);
@ -1333,7 +1333,7 @@ Transmission.prototype =
}
}
},
removeSelectedTorrents: function() {
var torrents = this.getSelectedTorrents( );
if( torrents.length )
@ -1355,7 +1355,7 @@ Transmission.prototype =
var message = 'Once removed, continuing the transfer will require the torrent file. Are you sure you want to remove it?';
dialog.confirm( header, message, 'Remove', 'transmission.removeTorrents', torrents );
}
else
else
{
var header = 'Remove ' + torrents.length + ' transfers?';
var message = 'Once removed, continuing the transfers will require the torrent files. Are you sure you want to remove them?';
@ -1372,7 +1372,7 @@ Transmission.prototype =
message = 'All data downloaded for this torrent will be deleted. Are you sure you want to remove it?';
dialog.confirm( header, message, 'Remove', 'transmission.removeTorrentsAndData', torrents );
}
else
else
{
var header = 'Remove ' + torrents.length + ' transfers and delete data?',
message = 'All data downloaded for these torrents will be deleted. Are you sure you want to remove them?';
@ -1416,7 +1416,7 @@ Transmission.prototype =
var tr = this;
this.remote.verifyTorrents( torrent_ids, function(){ tr.refreshTorrents(torrent_ids) } );
},
stopSelectedTorrents: function( ) {
this.stopTorrents( this.getSelectedTorrents( ) );
},

View File

@ -59,8 +59,8 @@ TransmissionRemote.prototype =
if( !remote._error.length )
remote._error = 'Server not responding';
dialog.confirm('Connection Failed',
'Could not connect to the server. You may need to reload the page to reconnect.',
dialog.confirm('Connection Failed',
'Could not connect to the server. You may need to reload the page to reconnect.',
'Details',
'alert(remote._error);',
null,