1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 09:13:06 +00:00

(libT) copyediting: whitespace/indentation

This commit is contained in:
Jordan Lee 2013-02-02 20:17:52 +00:00
parent c8e22c46d4
commit 84aed36ba9
5 changed files with 203 additions and 194 deletions

View file

@ -130,7 +130,8 @@ void tr_bandwidthConstruct (tr_bandwidth * bandwidth,
void tr_bandwidthDestruct (tr_bandwidth * bandwidth); void tr_bandwidthDestruct (tr_bandwidth * bandwidth);
/** @brief test to see if the pointer refers to a live bandwidth object */ /** @brief test to see if the pointer refers to a live bandwidth object */
static inline bool tr_isBandwidth (const tr_bandwidth * b) static inline bool
tr_isBandwidth (const tr_bandwidth * b)
{ {
return (b != NULL) && (b->magicNumber == BANDWIDTH_MAGIC_NUMBER); return (b != NULL) && (b->magicNumber == BANDWIDTH_MAGIC_NUMBER);
} }
@ -144,7 +145,8 @@ static inline bool tr_isBandwidth (const tr_bandwidth * b)
* @see tr_bandwidthAllocate * @see tr_bandwidthAllocate
* @see tr_bandwidthGetDesiredSpeed * @see tr_bandwidthGetDesiredSpeed
*/ */
static inline bool tr_bandwidthSetDesiredSpeed_Bps (tr_bandwidth * bandwidth, static inline bool
tr_bandwidthSetDesiredSpeed_Bps (tr_bandwidth * bandwidth,
tr_direction dir, tr_direction dir,
unsigned int desiredSpeed) unsigned int desiredSpeed)
{ {
@ -167,7 +169,8 @@ tr_bandwidthGetDesiredSpeed_Bps (const tr_bandwidth * bandwidth, tr_direction d
/** /**
* @brief Set whether or not this bandwidth should throttle its peer-io's speeds * @brief Set whether or not this bandwidth should throttle its peer-io's speeds
*/ */
static inline bool tr_bandwidthSetLimited (tr_bandwidth * bandwidth, static inline bool
tr_bandwidthSetLimited (tr_bandwidth * bandwidth,
tr_direction dir, tr_direction dir,
bool isLimited) bool isLimited)
{ {
@ -180,7 +183,8 @@ static inline bool tr_bandwidthSetLimited (tr_bandwidth * bandwidth,
/** /**
* @return nonzero if this bandwidth throttles its peer-ios speeds * @return nonzero if this bandwidth throttles its peer-ios speeds
*/ */
static inline bool tr_bandwidthIsLimited (const tr_bandwidth * bandwidth, static inline bool
tr_bandwidthIsLimited (const tr_bandwidth * bandwidth,
tr_direction dir) tr_direction dir)
{ {
return bandwidth->band[dir].isLimited; return bandwidth->band[dir].isLimited;
@ -237,7 +241,8 @@ void tr_bandwidthSetParent (tr_bandwidth * bandwidth,
* But when we set a torrent's speed mode to TR_SPEEDLIMIT_UNLIMITED, then * But when we set a torrent's speed mode to TR_SPEEDLIMIT_UNLIMITED, then
* in that particular case we want to ignore the global speed limit... * in that particular case we want to ignore the global speed limit...
*/ */
static inline bool tr_bandwidthHonorParentLimits (tr_bandwidth * bandwidth, static inline bool
tr_bandwidthHonorParentLimits (tr_bandwidth * bandwidth,
tr_direction direction, tr_direction direction,
bool isEnabled) bool isEnabled)
{ {
@ -247,7 +252,8 @@ static inline bool tr_bandwidthHonorParentLimits (tr_bandwidth * bandwidth,
return didChange; return didChange;
} }
static inline bool tr_bandwidthAreParentLimitsHonored (const tr_bandwidth * bandwidth, static inline bool
tr_bandwidthAreParentLimitsHonored (const tr_bandwidth * bandwidth,
tr_direction direction) tr_direction direction)
{ {
assert (tr_isBandwidth (bandwidth)); assert (tr_isBandwidth (bandwidth));

View file

@ -32,12 +32,12 @@ struct tr_bitfield;
enum enum
{ {
/** when we're making requests from another peer, /* when we're making requests from another peer,
batch them together to send enough requests to batch them together to send enough requests to
meet our bandwidth goals for the next N seconds */ meet our bandwidth goals for the next N seconds */
REQUEST_BUF_SECS = 10, REQUEST_BUF_SECS = 10,
/** this is the maximum size of a block request. /* this is the maximum size of a block request.
most bittorrent clients will reject requests most bittorrent clients will reject requests
larger than this size. */ larger than this size. */
MAX_BLOCK_SIZE = (1024 * 16) MAX_BLOCK_SIZE = (1024 * 16)

View file

@ -37,11 +37,14 @@ tr_peermsgs* tr_peerMsgsNew (struct tr_torrent * torrent,
tr_peer_callback * callback, tr_peer_callback * callback,
void * callback_data); void * callback_data);
void tr_peerMsgsSetChoke (tr_peermsgs *, bool peerIsChoked); void tr_peerMsgsSetChoke (tr_peermsgs * msgs,
bool peerIsChoked);
int tr_peerMsgsIsReadingBlock (const tr_peermsgs * msgs, tr_block_index_t block); int tr_peerMsgsIsReadingBlock (const tr_peermsgs * msgs,
tr_block_index_t block);
void tr_peerMsgsSetInterested (tr_peermsgs *, bool clientIsInterested); void tr_peerMsgsSetInterested (tr_peermsgs * msgs,
bool clientIsInterested);
void tr_peerMsgsHave (tr_peermsgs * msgs, void tr_peerMsgsHave (tr_peermsgs * msgs,
uint32_t pieceIndex); uint32_t pieceIndex);
@ -51,7 +54,7 @@ void tr_peerMsgsPulse (tr_peermsgs * msgs);
void tr_peerMsgsCancel (tr_peermsgs * msgs, void tr_peerMsgsCancel (tr_peermsgs * msgs,
tr_block_index_t block); tr_block_index_t block);
void tr_peerMsgsFree (tr_peermsgs*); void tr_peerMsgsFree (tr_peermsgs * msgs);
size_t tr_generateAllowedSet (tr_piece_index_t * setmePieces, size_t tr_generateAllowedSet (tr_piece_index_t * setmePieces,
size_t desiredSetSize, size_t desiredSetSize,