From 60c3dbcfcc41515986c7fcfb39ab2804d6052f9c Mon Sep 17 00:00:00 2001 From: Luke Goodsell Date: Wed, 10 May 2017 09:42:06 +0100 Subject: [PATCH] explicitly cast abs(int)s to avoid ambiguous calls on debian 9 --- src/bddata.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/bddata.cpp b/src/bddata.cpp index 84a147c3..cdf85bd1 100644 --- a/src/bddata.cpp +++ b/src/bddata.cpp @@ -119,7 +119,7 @@ void BDData::loadBDFile(const std::string& filename) firstPos += g_SpacerBeforeAfter; // ??? ask Kai secondPos += g_SpacerBeforeAfter; - if (firstChrName == secondChrName && secondChrName != "" && abs(firstPos - secondPos) < 500) { + if (firstChrName == secondChrName && secondChrName != "" && abs(static_cast(firstPos - secondPos)) < 500) { continue; } if ( firstChrName!="" && secondChrName!="") { @@ -180,16 +180,16 @@ void SortRPByChrPos(std::vector & Reads_RP) { // no interchromosome RP bool RecipicalOverlap(RP_READ & first, RP_READ & second) { int distance = 1000; - if (abs(first.PosA - first.PosA1) > distance) { + if (abs(static_cast(first.PosA - first.PosA1)) > distance) { return false; } - if (abs(first.PosB - first.PosB1) > distance) { + if (abs(static_cast(first.PosB - first.PosB1)) > distance) { return false; } - if (abs(second.PosA - second.PosA1) > distance) { + if (abs(static_cast(second.PosA - second.PosA1)) > distance) { return false; } - if (abs(second.PosB - second.PosB1) > distance) { + if (abs(static_cast(second.PosB - second.PosB1)) > distance) { return false; } float cutoff = 0.9; @@ -424,7 +424,7 @@ void ModifyRP(std::vector & Reads_RP) Reads_RP[first].PosB = Reads_RP[first].PosB + Reads_RP[first].ReadLength; Reads_RP[first].PosB1 = Reads_RP[first].PosB1 + Reads_RP[first].ReadLength; } - if (Reads_RP[first].ChrNameA == Reads_RP[first].ChrNameB && abs(Reads_RP[first].PosA - Reads_RP[first].PosB) < 500) { + if (Reads_RP[first].ChrNameA == Reads_RP[first].ChrNameB && abs(static_cast(Reads_RP[first].PosA - Reads_RP[first].PosB)) < 500) { Reads_RP[first].Visited = true; } //std::cout << "Final: " << Reads_RP[first].ChrNameA << " " << Reads_RP[first].DA << " " << Reads_RP[first].PosA << "\t" << Reads_RP[first].ChrNameB << " " << Reads_RP[first].DB << " " << Reads_RP[first].PosB << std::endl;