From: Vladislav Vinogradov Date: Tue, 2 Apr 2013 16:21:24 +0000 (+0400) Subject: fixed compilation after CV_IMPLEMENT_QSORT_EX removing X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~3937^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=366f859adae69d6476a902feef6e65680a6f631d;p=platform%2Fupstream%2Fopencv.git fixed compilation after CV_IMPLEMENT_QSORT_EX removing --- diff --git a/modules/gpu/src/hough.cpp b/modules/gpu/src/hough.cpp index 9a39ac6..610384e 100644 --- a/modules/gpu/src/hough.cpp +++ b/modules/gpu/src/hough.cpp @@ -586,8 +586,17 @@ namespace edgePointList.cols = func(edges, dx, dy, edgePointList.ptr(0), edgePointList.ptr(1)); } - #define votes_cmp_gt(l1, l2) (aux[l1].x > aux[l2].x) - static CV_IMPLEMENT_QSORT_EX( sortIndexies, int, votes_cmp_gt, const int3* ) + struct IndexCmp + { + const int3* aux; + + explicit IndexCmp(const int3* _aux) : aux(_aux) {} + + bool operator ()(int l1, int l2) const + { + return aux[l1].x > aux[l2].x; + } + }; void GHT_Pos::filterMinDist() { @@ -600,7 +609,7 @@ namespace indexies.resize(posCount); for (int i = 0; i < posCount; ++i) indexies[i] = i; - sortIndexies(&indexies[0], posCount, &oldVoteBuf[0]); + std::sort(indexies.begin(), indexies.end(), IndexCmp(&oldVoteBuf[0])); newPosBuf.clear(); newVoteBuf.clear();