Commit b47dbefc authored by arq5x's avatar arq5x
Browse files

settle on uint32_t signature for QuickString. Resolves #267 and #271?

parent 86bce5cb
...@@ -83,11 +83,11 @@ void CoverageFile::giveFinalReport(RecordOutputMgr *outputMgr) { ...@@ -83,11 +83,11 @@ void CoverageFile::giveFinalReport(RecordOutputMgr *outputMgr) {
float depthPct = (float)basesAtDepth / (float)_totalQueryLen; float depthPct = (float)basesAtDepth / (float)_totalQueryLen;
_finalOutput = "all\t"; _finalOutput = "all\t";
_finalOutput.append(depth); _finalOutput.append(static_cast<uint32_t>(depth));
_finalOutput.append("\t"); _finalOutput.append("\t");
_finalOutput.append(basesAtDepth); _finalOutput.append(static_cast<uint32_t>(basesAtDepth));
_finalOutput.append("\t"); _finalOutput.append("\t");
_finalOutput.append(_totalQueryLen); _finalOutput.append(static_cast<uint32_t>(_totalQueryLen));
_finalOutput.append("\t"); _finalOutput.append("\t");
format(depthPct); format(depthPct);
...@@ -138,7 +138,7 @@ size_t CoverageFile::countBasesAtDepth(size_t depth) { ...@@ -138,7 +138,7 @@ size_t CoverageFile::countBasesAtDepth(size_t depth) {
void CoverageFile::doCounts(RecordOutputMgr *outputMgr, RecordKeyVector &hits) void CoverageFile::doCounts(RecordOutputMgr *outputMgr, RecordKeyVector &hits)
{ {
_finalOutput = hits.size(); _finalOutput = static_cast<uint32_t>(hits.size());
outputMgr->printRecord(hits.getKey(), _finalOutput); outputMgr->printRecord(hits.getKey(), _finalOutput);
} }
...@@ -147,9 +147,9 @@ void CoverageFile::doPerBase(RecordOutputMgr *outputMgr, RecordKeyVector &hits) ...@@ -147,9 +147,9 @@ void CoverageFile::doPerBase(RecordOutputMgr *outputMgr, RecordKeyVector &hits)
//loop through all bases in query, printing full record and metrics for each //loop through all bases in query, printing full record and metrics for each
const Record * queryRec = hits.getKey(); const Record * queryRec = hits.getKey();
for (size_t i= 0; i < _queryLen; i++) { for (size_t i= 0; i < _queryLen; i++) {
_finalOutput = i +1; _finalOutput = static_cast<uint32_t>(i+1);
_finalOutput.append("\t"); _finalOutput.append("\t");
_finalOutput.append(_depthArray[i]); _finalOutput.append(static_cast<uint32_t>(_depthArray[i]));
outputMgr->printRecord(queryRec, _finalOutput); outputMgr->printRecord(queryRec, _finalOutput);
} }
...@@ -181,11 +181,11 @@ void CoverageFile::doHist(RecordOutputMgr *outputMgr, RecordKeyVector &hits) ...@@ -181,11 +181,11 @@ void CoverageFile::doHist(RecordOutputMgr *outputMgr, RecordKeyVector &hits)
size_t numBasesAtDepth = iter->second; size_t numBasesAtDepth = iter->second;
float coveredBases = (float)numBasesAtDepth / (float)_queryLen; float coveredBases = (float)numBasesAtDepth / (float)_queryLen;
_finalOutput = depth; _finalOutput = static_cast<uint32_t>(depth);
_finalOutput.append("\t"); _finalOutput.append("\t");
_finalOutput.append(numBasesAtDepth); _finalOutput.append(static_cast<uint32_t>(numBasesAtDepth));
_finalOutput.append("\t"); _finalOutput.append("\t");
_finalOutput.append(_queryLen); _finalOutput.append(static_cast<uint32_t>(_queryLen));
_finalOutput.append("\t"); _finalOutput.append("\t");
format(coveredBases); format(coveredBases);
...@@ -199,11 +199,11 @@ void CoverageFile::doDefault(RecordOutputMgr *outputMgr, RecordKeyVector &hits) ...@@ -199,11 +199,11 @@ void CoverageFile::doDefault(RecordOutputMgr *outputMgr, RecordKeyVector &hits)
size_t nonZeroBases = _queryLen - countBasesAtDepth(0); size_t nonZeroBases = _queryLen - countBasesAtDepth(0);
float coveredBases = (float)nonZeroBases / (float)_queryLen; float coveredBases = (float)nonZeroBases / (float)_queryLen;
_finalOutput = hits.size(); _finalOutput = static_cast<uint32_t>(hits.size());
_finalOutput.append("\t"); _finalOutput.append("\t");
_finalOutput.append(nonZeroBases); _finalOutput.append(static_cast<uint32_t>(nonZeroBases));
_finalOutput.append("\t"); _finalOutput.append("\t");
_finalOutput.append(_queryLen); _finalOutput.append(static_cast<uint32_t>(_queryLen));
_finalOutput.append("\t"); _finalOutput.append("\t");
format(coveredBases); format(coveredBases);
......
...@@ -105,11 +105,11 @@ QuickString &QuickString::operator = (uint32_t val) { ...@@ -105,11 +105,11 @@ QuickString &QuickString::operator = (uint32_t val) {
return *this; return *this;
} }
QuickString &QuickString::operator = (size_t val) { // QuickString &QuickString::operator = (size_t val) {
clear(); // clear();
append(val); // append(val);
return *this; // return *this;
} // }
QuickString &QuickString::operator = (float val) { QuickString &QuickString::operator = (float val) {
clear(); clear();
...@@ -158,10 +158,11 @@ QuickString &QuickString::operator += (uint32_t num) { ...@@ -158,10 +158,11 @@ QuickString &QuickString::operator += (uint32_t num) {
return *this; return *this;
} }
QuickString &QuickString::operator += (size_t num) { // QuickString &QuickString::operator += (size_t num) {
append(num); // append(num);
return *this; // return *this;
} // }
QuickString &QuickString::operator += (float num) { QuickString &QuickString::operator += (float num) {
append(num); append(num);
return *this; return *this;
...@@ -276,9 +277,9 @@ void QuickString::append(uint32_t num) { ...@@ -276,9 +277,9 @@ void QuickString::append(uint32_t num) {
int2str((int)num, *this, true); int2str((int)num, *this, true);
} }
void QuickString::append(size_t num) { // void QuickString::append(size_t num) {
int2str((int)num, *this, true); // int2str((int)num, *this, true);
} // }
void QuickString::append(float num) { void QuickString::append(float num) {
append(ToString(num)); append(ToString(num));
......
...@@ -38,7 +38,7 @@ public: ...@@ -38,7 +38,7 @@ public:
QuickString &operator = (char); QuickString &operator = (char);
QuickString &operator = (int); QuickString &operator = (int);
QuickString &operator = (uint32_t); QuickString &operator = (uint32_t);
QuickString &operator = (size_t); //QuickString &operator = (size_t);
QuickString &operator = (float); QuickString &operator = (float);
QuickString &operator = (double); QuickString &operator = (double);
QuickString &operator += (const QuickString &); QuickString &operator += (const QuickString &);
...@@ -47,7 +47,7 @@ public: ...@@ -47,7 +47,7 @@ public:
QuickString &operator += (char); QuickString &operator += (char);
QuickString &operator += (int); QuickString &operator += (int);
QuickString &operator += (uint32_t); QuickString &operator += (uint32_t);
QuickString &operator += (size_t); //QuickString &operator += (size_t);
QuickString &operator += (float); QuickString &operator += (float);
QuickString &operator += (double); QuickString &operator += (double);
...@@ -74,7 +74,7 @@ public: ...@@ -74,7 +74,7 @@ public:
//for better performance. //for better performance.
void append(int num); void append(int num);
void append(uint32_t num); void append(uint32_t num);
void append(size_t num); //void append(size_t num);
void append(float num); void append(float num);
void append(double num); void append(double num);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment