Skip to content

Commit f9e8da9

Browse files
author
arno
committed
- Small clean up. git-svn-id: http://svn.tribler.org/libswift/branches/ppsp-03@31502 001aeff7-3401-0410-a489-f7902fc005dd
1 parent 9f7c112 commit f9e8da9

File tree

4 files changed

+8
-27
lines changed

4 files changed

+8
-27
lines changed

SConstruct

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ source = [ 'bin.cpp', 'binmap.cpp', 'sha1.cpp','hashtree.cpp',
3030

3131
env = Environment()
3232
if sys.platform == "win32":
33-
#libevent2path = '\\build\\libevent-2.0.19-stable'
3433
libevent2path = '\\build\\libevent-2.0.20-stable-debug'
3534

3635
# "MSVC works out of the box". Sure.
@@ -74,9 +73,6 @@ if sys.platform == "win32":
7473
# Somehow linker can't find uuid.lib
7574
libpath += 'C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\Lib;'
7675

77-
linkflags = '-Wl,-rpath,'+libevent2path+'/lib'
78-
env.Append(LINKFLAGS=linkflags);
79-
8076
# Make the swift.exe a Windows program not a Console program when used inside another prog
8177
linkflags = '/SUBSYSTEM:WINDOWS'
8278
if not DEBUG:
@@ -87,6 +83,8 @@ if sys.platform == "win32":
8783
APPSOURCE=['swift.cpp','statsgw.cpp','getopt.c','getopt_long.c']
8884

8985
else:
86+
# Linux or Mac build
87+
9088
libevent2path = '/arno/pkgs/libevent-2.0.15-arno-http'
9189

9290
# Enable the user defining external includes

ext/live_picker.cpp

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,12 @@ class SimpleLivePiecePicker : public LivePiecePicker {
7676
hint_out_.pop_front();
7777
}
7878

79-
char binstr[32];
80-
8179
// Advance ptr
8280
//dprintf("live: pp: new cur start\n" );
8381
while (transfer_->ack_out()->is_filled(current_bin_))
8482
{
8583
current_bin_ = bin_t(0,current_bin_.layer_offset()+1);
86-
//fprintf(stderr,"live: pp: new cur is %s\n", current_bin_.str(binstr) );
84+
//fprintf(stderr,"live: pp: new cur is %s\n", current_bin_.str().c_str() );
8785
}
8886
//dprintf("live: pp: new cur end\n" );
8987

@@ -92,10 +90,10 @@ class SimpleLivePiecePicker : public LivePiecePicker {
9290
bin_t hint = pickLargestBin(offer,current_bin_);
9391
if (hint == bin_t::NONE)
9492
{
95-
//dprintf("live: pp: Look beyond %s\n", current_bin_.str(binstr) );
93+
//dprintf("live: pp: Look beyond %s\n", current_bin_.str().c_str() );
9694
// See if there is stuff to download beyond current bin
9795
hint = ack_hint_out_.find_empty(current_bin_);
98-
//dprintf("live: pp: Empty is %s boe %llu boc %llu\n", hint.str(binstr), hint.toUInt(), current_bin_.toUInt() );
96+
//dprintf("live: pp: Empty is %s boe %llu boc %llu\n", hint.str().c_str(), hint.toUInt(), current_bin_.toUInt() );
9997

10098
// Safety catch, find_empty(offset) apparently buggy.
10199
if (hint.base_offset() <= current_bin_.base_offset())
@@ -108,7 +106,7 @@ class SimpleLivePiecePicker : public LivePiecePicker {
108106
if (hint == bin_t::NONE)
109107
return hint;
110108

111-
//dprintf("live: pp: Picked %s\n", hint.str(binstr) );
109+
//dprintf("live: pp: Picked %s\n", hint.str().c_str() );
112110

113111
assert(ack_hint_out_.is_empty(hint));
114112
ack_hint_out_.set(hint);
@@ -119,22 +117,21 @@ class SimpleLivePiecePicker : public LivePiecePicker {
119117

120118
bin_t pickLargestBin(binmap_t& offer, bin_t starthint)
121119
{
122-
char binstr[32];
123120
bin_t hint;
124121
if (offer.is_filled(starthint) && ack_hint_out_.is_empty(starthint))
125122
{
126123
// See which is the largest bin that covers starthint
127124
bin_t goodhint = starthint;
128125
hint = starthint;
129-
//dprintf("live: pp: new hint is %s\n", hint.str(binstr) );
126+
//dprintf("live: pp: new hint is %s\n", hint.str().c_str() );
130127

131128
while (hint.is_left() && offer.is_filled(hint.sibling()) && ack_hint_out_.is_empty(hint.sibling()))
132129
{
133130
// hint is a left node and its sibling is filled, so we can
134131
// request the parent too.
135132
goodhint = hint;
136133
hint = hint.parent();
137-
//dprintf("live: pp: Going to parent %s\n", hint.str(binstr) );
134+
//dprintf("live: pp: Going to parent %s\n", hint.str().c_str() );
138135
}
139136
// Previous one was the max.
140137
return goodhint;
@@ -192,8 +189,6 @@ class SimpleLivePiecePicker : public LivePiecePicker {
192189

193190
void EndAddPeerPos(uint32_t channelid)
194191
{
195-
char binstr[32];
196-
197192
if (!hooking_in_)
198193
return;
199194

tests/binstest3.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ TEST(BinsTest,FindFiltered1c) {
6868
filter.reset(bin_t(1,4));
6969
//filter.reset(bin_t(0,13));
7070

71-
char binstr[32];
72-
7371
bin_t s = bin_t(3,1);
7472
fprintf(stderr,"Searching 0,12x from %s ", s.base_left().str().c_str() );
7573
fprintf(stderr,"to %s\n", s.base_right().str().c_str() );
@@ -411,8 +409,6 @@ TEST(BinsTest,FindFiltered17) {
411409
bin_t hint = bin_t::NONE;
412410
while (hint.is_none() && layer <10)
413411
{
414-
char binstr[32];
415-
416412
bin_t curr = bin_t(layer++,0);
417413
binmap.fill(offer);
418414
binmap_t::copy(binmap, ack_hint_out, curr);
@@ -446,8 +442,6 @@ TEST(BinsTest,FindFiltered19) {
446442
bin_t hint = bin_t::NONE;
447443
while (!hint.contains(bin_t(292)))
448444
{
449-
char binstr[32];
450-
451445
twist = rand();
452446

453447
bin_t curr = bin_t(layer,0);
@@ -466,7 +460,6 @@ TEST(BinsTest,FindFiltered19) {
466460
ack_hint_out.set(hint);
467461
}
468462

469-
char binstr[32],binstr2[32];
470463
EXPECT_EQ(bin_t(292),hint);
471464
}
472465

@@ -506,8 +499,6 @@ TEST(BinsTest,FindFiltered20) {
506499
fprintf(stderr,"Layer %d\n", layer );
507500
while (!hint.contains(bin_t(292)))
508501
{
509-
char binstr[32];
510-
511502
twist = rand();
512503

513504
bin_t curr = bin_t(0,292/2);
@@ -539,8 +530,6 @@ void DoFindFilteredRiccardo(bin_t::uint_t twist)
539530
for(int i=0; i<1024; i+=2)
540531
filter.set(bin_t(0,i));
541532

542-
char binstr[32];
543-
544533
// Case 1
545534
bin_t s(1,2);
546535
data.set(s);

tests/chunkaddrtest.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ TEST(ChunkAddrTest,Chunk32ToBin32b)
9292
{
9393
uint32_t sm = 269;
9494
uint32_t em = 312;
95-
char binstr[32];
9695
for (uint32_t s=0; s<sm; s++)
9796
{
9897
for (uint32_t e=s; e<s+em; e++)

0 commit comments

Comments
 (0)