Skip to content

Commit

Permalink
Removed trailing spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsuhiro-t committed Oct 1, 2012
1 parent 390b2e5 commit 8b0c701
Show file tree
Hide file tree
Showing 238 changed files with 571 additions and 571 deletions.
4 changes: 2 additions & 2 deletions deps/wslay/tests/wslay_event_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ void test_wslay_event_send_fragmented_msg_with_ctrl(void)
memset(&acc, 0, sizeof(acc));
ud.acc = &acc;
wslay_event_context_server_init(&ctx, &callbacks, &ud);

memset(&arg, 0, sizeof(arg));
arg.opcode = WSLAY_TEXT_FRAME;
arg.source.data = &df;
Expand Down Expand Up @@ -231,7 +231,7 @@ void test_wslay_event_send_ctrl_msg_first(void)
memset(&acc, 0, sizeof(acc));
ud.acc = &acc;
wslay_event_context_server_init(&ctx, &callbacks, &ud);

memset(&arg, 0, sizeof(arg));
arg.opcode = WSLAY_PING;
arg.msg_length = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/AbstractDiskWriter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ void AbstractDiskWriter::createFile(int addFlags)
filename_.c_str(),
util::safeStrerror(errNum).c_str()),
error_code::FILE_CREATE_ERROR);
}
}
}

ssize_t AbstractDiskWriter::writeDataInternal(const unsigned char* data,
Expand Down
2 changes: 1 addition & 1 deletion src/AbstractDiskWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class AbstractDiskWriter : public DiskWriter {
virtual void allocate(int64_t offset, int64_t length);

virtual int64_t size();

virtual void enableReadOnly();

virtual void disableReadOnly();
Expand Down
6 changes: 3 additions & 3 deletions src/AbstractSingleDiskAdaptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,19 @@ class AbstractSingleDiskAdaptor : public DiskAdaptor {
virtual int64_t size();

virtual void truncate(int64_t length);

virtual SharedHandle<FileAllocationIterator> fileAllocationIterator();

// Make sure that DiskWriter is set before calling this function.
virtual void enableReadOnly();

// Make sure that DiskWriter is set before calling this function.
virtual void disableReadOnly();

virtual bool isReadOnlyEnabled() const { return readOnly_; }

virtual void enableMmap();

virtual void cutTrailingGarbage();

virtual const std::string& getFilePath() = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/ActivePeerConnectionCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class ActivePeerConnectionCommand : public Command {
time_t interval);

virtual ~ActivePeerConnectionCommand();

virtual bool execute();

void connectToPeer(const SharedHandle<Peer>& peer);
Expand Down
2 changes: 1 addition & 1 deletion src/AdaptiveFileAllocationIterator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void AdaptiveFileAllocationIterator::allocateChunk()
allocator_->allocateChunk();
}
}

bool AdaptiveFileAllocationIterator::finished()
{
if(!allocator_) {
Expand Down
2 changes: 1 addition & 1 deletion src/AdaptiveFileAllocationIterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class AdaptiveFileAllocationIterator:public FileAllocationIterator
virtual ~AdaptiveFileAllocationIterator();

virtual void allocateChunk();

virtual bool finished();

virtual int64_t getCurrentLength();
Expand Down
18 changes: 9 additions & 9 deletions src/AdaptiveURISelector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@

namespace aria2 {

/* In that URI Selector, select method returns one of the bests
* mirrors for first and reserved connections. For supplementary
* ones, it returns mirrors which has not been tested yet, and
* if each of them already tested, returns mirrors which has to
/* In that URI Selector, select method returns one of the bests
* mirrors for first and reserved connections. For supplementary
* ones, it returns mirrors which has not been tested yet, and
* if each of them already tested, returns mirrors which has to
* be tested again. Otherwise, it doesn't return anymore mirrors.
*/

Expand All @@ -87,7 +87,7 @@ std::string AdaptiveURISelector::select
// failed uris that may succeed with more permissive values
mayRetryWithIncreasedTimeout(fileEntry);
}

std::string selected = selectOne(uris);

if(selected != A2STR::NIL)
Expand Down Expand Up @@ -128,12 +128,12 @@ std::string AdaptiveURISelector::selectOne(const std::deque<std::string>& uris)
const size_t numPieces =
requestGroup_->getDownloadContext()->getNumPieces();

bool reservedContext = numPieces > 0 &&
bool reservedContext = numPieces > 0 &&
static_cast<size_t>(nbConnections_) > std::min
(numPieces,
static_cast<size_t>(requestGroup_->getNumConcurrentCommand()));
bool selectBest = numPieces == 0 || reservedContext;

if(numPieces > 0)
++nbConnections_;

Expand All @@ -148,7 +148,7 @@ std::string AdaptiveURISelector::selectOne(const std::deque<std::string>& uris)
return notTested;
}
}

if(!selectBest && nbConnections_ > 1 && nbServerToEvaluate_ > 0) {
nbServerToEvaluate_--;
std::string notTested = getFirstNotTestedUri(uris);
Expand Down Expand Up @@ -184,7 +184,7 @@ std::string AdaptiveURISelector::getBestMirror
int max = getMaxDownloadSpeed(uris);
int min = max-(int)(max*0.25);
std::deque<std::string> bests = getUrisBySpeed(uris, min);

if (bests.size() < 2) {
std::string uri = getMaxDownloadSpeedUri(uris);
A2_LOG_DEBUG(fmt("AdaptiveURISelector: choosing the best mirror :"
Expand Down
2 changes: 1 addition & 1 deletion src/AdaptiveURISelector.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class AdaptiveURISelector:public URISelector {
int getNbTestedServers(const std::deque<std::string>& uris) const;
std::string getBestMirror(const std::deque<std::string>& uris) const;
public:
AdaptiveURISelector(const SharedHandle<ServerStatMan>& serverStatMan,
AdaptiveURISelector(const SharedHandle<ServerStatMan>& serverStatMan,
RequestGroup* requestGroup);

virtual ~AdaptiveURISelector();
Expand Down
6 changes: 3 additions & 3 deletions src/BitfieldMan.cc
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ bool getSparseMissingUnusedIndex
maxRange = currentRange;
}
nextIndex = currentRange.endIndex;

}
if(maxRange.getSize()) {
if(maxRange.startIndex == 0) {
Expand Down Expand Up @@ -897,7 +897,7 @@ BitfieldMan::Range::Range(size_t startIndex, size_t endIndex)
startIndex(startIndex),
endIndex(endIndex)
{}

size_t BitfieldMan::Range::getSize() const
{
return endIndex-startIndex;
Expand All @@ -912,7 +912,7 @@ bool BitfieldMan::Range::operator<(const Range& range) const
{
return getSize() < range.getSize();
}

bool BitfieldMan::Range::operator==(const Range& range) const
{
return getSize() == range.getSize();
Expand Down
4 changes: 2 additions & 2 deletions src/BitfieldMan.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class BitfieldMan {
Range(size_t startIndex = 0, size_t endIndex = 0);
size_t getSize() const;
size_t getMidIndex() const;
bool operator<(const Range& range) const;
bool operator<(const Range& range) const;
bool operator==(const Range& range) const;
};
public:
Expand Down Expand Up @@ -248,7 +248,7 @@ class BitfieldMan {

// Clears filter and disables filter
void clearFilter();

void enableFilter();
void disableFilter();
bool isFilterEnabled() const
Expand Down
6 changes: 3 additions & 3 deletions src/BtLeecherStateChoke.cc
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ void BtLeecherStateChoke::plannedOptimisticUnchoke
{
std::for_each(peerEntries.begin(), peerEntries.end(),
std::mem_fun_ref(&PeerEntry::disableOptUnchoking));

std::vector<PeerEntry>::iterator i =
std::partition(peerEntries.begin(), peerEntries.end(),
PeerFilter(true, true));
Expand All @@ -168,7 +168,7 @@ void BtLeecherStateChoke::regularUnchoke(std::vector<PeerEntry>& peerEntries)
std::vector<PeerEntry>::iterator rest =
std::partition(peerEntries.begin(), peerEntries.end(),
std::mem_fun_ref(&PeerEntry::isRegularUnchoker));

std::sort(peerEntries.begin(), rest);

// the number of regular unchokers
Expand Down Expand Up @@ -218,7 +218,7 @@ BtLeecherStateChoke::executeChoke
peerEntries.erase(std::remove_if(peerEntries.begin(), peerEntries.end(),
std::mem_fun_ref(&PeerEntry::isSnubbing)),
peerEntries.end());

std::for_each(peerEntries.begin(), peerEntries.end(),
std::mem_fun_ref(&PeerEntry::enableChokingRequired));

Expand Down
2 changes: 1 addition & 1 deletion src/BtRegistry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ BtRegistry::getDownloadContext(const std::string& infoHash) const
infoHash) {
return (*i).second->downloadContext;
}
}
}
return getNull<DownloadContext>();
}

Expand Down
4 changes: 2 additions & 2 deletions src/BtSeederStateChoke.cc
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,13 @@ BtSeederStateChoke::executeChoke

std::transform(peerSet.begin(), peerSet.end(),
std::back_inserter(peerEntries), GenPeerEntry());

peerEntries.erase(std::remove_if(peerEntries.begin(), peerEntries.end(),
NotInterestedPeer()),
peerEntries.end());

unchoke(peerEntries);

if(++round_ == 3) {
round_ = 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/BtSeederStateChoke.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class BtSeederStateChoke {
Timer lastAmUnchoking_;
bool recentUnchoking_;
int uploadSpeed_;

const static time_t TIME_FRAME = 20;
public:
PeerEntry(const SharedHandle<Peer>& peer);
Expand Down
8 changes: 4 additions & 4 deletions src/BtSetup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ void BtSetup::setup(std::vector<Command*>& commands,
c->setPieceStorage(pieceStorage);
c->setBtRuntime(btRuntime);
c->setBtAnnounce(btAnnounce);

commands.push_back(c);
}
if(!metadataGetMode) {
PeerChokeCommand* c =
new PeerChokeCommand(e->newCUID(), e);
c->setPeerStorage(peerStorage);
c->setBtRuntime(btRuntime);

commands.push_back(c);
}
{
Expand All @@ -133,7 +133,7 @@ void BtSetup::setup(std::vector<Command*>& commands,
c->setPieceStorage(pieceStorage);
c->setPeerStorage(peerStorage);
c->setBtAnnounce(btAnnounce);

commands.push_back(c);
}

Expand Down Expand Up @@ -261,7 +261,7 @@ void BtSetup::setup(std::vector<Command*>& commands,
if(btReg->getLpdMessageReceiver()) {
const unsigned char* infoHash =
bittorrent::getInfoHash(requestGroup->getDownloadContext());
A2_LOG_INFO("Initializing LpdMessageDispatcher.");
A2_LOG_INFO("Initializing LpdMessageDispatcher.");
SharedHandle<LpdMessageDispatcher> dispatcher
(new LpdMessageDispatcher
(std::string(&infoHash[0], &infoHash[INFO_HASH_LENGTH]),
Expand Down
2 changes: 1 addition & 1 deletion src/BtStopDownloadCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class BtRuntime;
class BtStopDownloadCommand:public TimeBasedCommand {
private:
RequestGroup* requestGroup_;

time_t timeout_;

Timer checkPoint_;
Expand Down
2 changes: 1 addition & 1 deletion src/Checksum.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void Checksum::setDigest(const std::string& digest)
{
digest_ = digest;
}

void Checksum::setHashType(const std::string& hashType)
{
hashType_ = hashType;
Expand Down
2 changes: 1 addition & 1 deletion src/Checksum.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class Checksum {
{
return digest_;
}

void setHashType(const std::string& type);
const std::string& getHashType() const
{
Expand Down
2 changes: 1 addition & 1 deletion src/ChunkChecksum.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class ChunkChecksum {
size_t countPieceHash() const;

const std::string& getPieceHash(size_t index) const;

void setPieceHashes(const std::vector<std::string>& pieceHashes);
const std::vector<std::string>& getPieceHashes() const
{
Expand Down
2 changes: 1 addition & 1 deletion src/ChunkedDecodingStreamFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ChunkedDecodingStreamFilter : public StreamFilter {
(const SharedHandle<BinaryStream>& out,
const SharedHandle<Segment>& segment,
const unsigned char* inbuf, size_t inlen);

virtual bool finished();

virtual void release();
Expand Down
2 changes: 1 addition & 1 deletion src/CookieStorage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ bool CookieStorage::saveNsFormat(const std::string& filename)
if(fp.close() == EOF) {
A2_LOG_ERROR(fmt("Failed to save cookies to %s", filename.c_str()));
return false;
}
}
}
if(File(tempfilename).renameTo(filename)) {
return true;
Expand Down
4 changes: 2 additions & 2 deletions src/CookieStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,15 @@ class CookieStorage {
// method returns true. Otherwise, this method returns false. now
// is used as creation time and last access time.
bool load(const std::string& filename, time_t now);

// Saves Cookies in Netspace format which is used in
// Firefox1.2/Netscape/Mozilla. If Cookies are successfully saved,
// this method returns true, otherwise returns false.
bool saveNsFormat(const std::string& filename);

// Returns the number of cookies this object stores.
size_t size() const;

// Returns true if this object contains a cookie x where x == cookie
// satisfies.
bool contains(const Cookie& cookie) const;
Expand Down
2 changes: 1 addition & 1 deletion src/DHTAbstractMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class DHTAbstractMessage:public DHTMessage {
}

void setMessageDispatcher(DHTMessageDispatcher* dispatcher);

DHTMessageFactory* getMessageFactory() const
{
return factory_;
Expand Down
Loading

0 comments on commit 8b0c701

Please sign in to comment.