[Sumover-dev] [svn commit] r4605 - vic/branches/cc/cc
sumover-dev at cs.ucl.ac.uk
sumover-dev at cs.ucl.ac.uk
Thu Feb 11 17:02:45 GMT 2010
Author: soohyunc
Date: Thu Feb 11 17:02:45 2010
New Revision: 4605
Modified:
vic/branches/cc/cc/tfwc_rcvr.cpp
vic/branches/cc/cc/tfwc_sndr.cpp
Log:
print out debug message to stderr instead of stdout
Modified: vic/branches/cc/cc/tfwc_rcvr.cpp
==============================================================================
--- vic/branches/cc/cc/tfwc_rcvr.cpp (original)
+++ vic/branches/cc/cc/tfwc_rcvr.cpp Thu Feb 11 17:02:45 2010
@@ -147,18 +147,18 @@
// print vector elements
void TfwcRcvr::print_vec(std::vector<int> v) {
std::vector<int>::iterator iter;
- printf("\t>> vec: ");
+ fprintf(stderr, "\t>> vec: ");
for (iter = v.begin(); iter != v.end(); iter++)
- printf("%d ", *iter);
- printf("\n");
+ fprintf(stderr, "%d ", *iter);
+ fprintf(stderr, "\n");
}
// print bit vectors (in decimal format)
void TfwcRcvr::print_tfwcAV() {
- printf("\t>> tfwcAV: ");
+ fprintf(stderr, "\t>> tfwcAV: ");
for (int i = 0; i < numVec_; i++)
- printf("[%d:%d] ", i, tfwcAV[i]);
- printf("\n");
+ fprintf(stderr, "[%d:%d] ", i, tfwcAV[i]);
+ fprintf(stderr, "\n");
}
// reset
Modified: vic/branches/cc/cc/tfwc_sndr.cpp
==============================================================================
--- vic/branches/cc/cc/tfwc_sndr.cpp (original)
+++ vic/branches/cc/cc/tfwc_sndr.cpp Thu Feb 11 17:02:45 2010
@@ -130,8 +130,8 @@
// timestamp vector for loss history update
tsvec_[seqno_%TSZ - 1] = now_;
- printf("\t>> now_:%f, tsvec_[%d]:%f\n",
- now(), seqno_%TSZ - 1, tsvec_[seqno_%TSZ-1]);
+ fprintf(stderr, "\t>> now_:%f, tsvec_[%d]:%f\n",
+ now(), seqno_%TSZ - 1, tsvec_[seqno_%TSZ-1]);
// sequence number must be greater than zero
assert (seqno_ > 0);
@@ -172,7 +172,8 @@
// clone AckVec from Vic
clone_ackv(chunk, num_vec_);
- printf(" [%s +%d] begins:%d, ends:%d, jacked:%d\n",
+ fprintf(stderr,
+ " [%s +%d] begins:%d, ends:%d, jacked:%d\n",
__FILE__, __LINE__, begins_, ends_, jacked_);
// generate seqno vector
@@ -202,7 +203,7 @@
else {
control();
}
- printf("\tnow: %f\tcwnd: %d\n", now_, cwnd_);
+ fprintf(stderr, "\tnow: %f\tcwnd: %d\n", now_, cwnd_);
// set ackofack (real number)
aoa_ = ackofack();
@@ -220,7 +221,8 @@
ntep_++; // number of ts echo packet received
ts_echo_ = chunk[num_vec_ - 1];
- printf(" [%s +%d] ts echo: %f\n", __FILE__,__LINE__, ts_echo_);
+ fprintf(stderr,
+ " [%s +%d] ts echo: %f\n", __FILE__,__LINE__, ts_echo_);
tao_ = now() - ts_echo_;
@@ -281,11 +283,11 @@
u_int32_t tempvec[num];
// generate tempvec elements
- printf("\tcomparing numbers: (");
+ fprintf(stderr, "\tcomparing numbers: (");
for (int i = 0; i < num; i++) {
tempvec[i] = begin + i;
- printf(" %d", tempvec[i]);
- } printf(" )\n");
+ fprintf(stderr, " %d", tempvec[i]);
+ } fprintf(stderr, " )\n");
// compare tempvec and seqvec
for (int i = 0; i < num; i++) {
More information about the Sumover-dev
mailing list