diff options
author | Adrian Thurston <thurston@colm.net> | 2019-09-08 20:48:03 -0600 |
---|---|---|
committer | Adrian Thurston <thurston@colm.net> | 2019-09-08 20:48:42 -0600 |
commit | cf1179fca1bf8c3454730918f149c17c13f49cdc (patch) | |
tree | 6c62ea78bfa2b7ce55a15f586d6a93e7ac2510c6 /aapl | |
parent | df161e15dab0433f61467645e78d43350e7f6151 (diff) | |
download | colm-cf1179fca1bf8c3454730918f149c17c13f49cdc.tar.gz |
merging aapl src dirs: need to call compare with this->
Diffstat (limited to 'aapl')
-rw-r--r-- | aapl/bstcommon.h | 2 | ||||
-rw-r--r-- | aapl/insertsort.h | 2 | ||||
-rw-r--r-- | aapl/quicksort.h | 14 |
3 files changed, 9 insertions, 9 deletions
diff --git a/aapl/bstcommon.h b/aapl/bstcommon.h index b784cf99..391b4ff1 100644 --- a/aapl/bstcommon.h +++ b/aapl/bstcommon.h @@ -509,7 +509,7 @@ template <BST_TEMPL_DEF> Element *BstTable<BST_TEMPL_USE>:: } mid = lower + ((upper-lower)>>1); - keyRelation = compare(key, GET_KEY(*mid)); + keyRelation = this->compare(key, GET_KEY(*mid)); if ( keyRelation < 0 ) upper = mid - 1; diff --git a/aapl/insertsort.h b/aapl/insertsort.h index b80058e4..386fd9c6 100644 --- a/aapl/insertsort.h +++ b/aapl/insertsort.h @@ -74,7 +74,7 @@ template <class T, class Compare> T *smallest = dest; for ( T *src = dest+1; src < data+len; src++ ) { /* If src is smaller than the current src, then use it. */ - if ( compare( *src, *smallest ) < 0 ) + if ( this->compare( *src, *smallest ) < 0 ) smallest = src; } diff --git a/aapl/quicksort.h b/aapl/quicksort.h index af47af89..f23ec2ee 100644 --- a/aapl/quicksort.h +++ b/aapl/quicksort.h @@ -87,17 +87,17 @@ template <class T, class Compare> T *QuickSort<T,Compare>:: T *pivot, *mid = start + (end-start)/2; /* CChoose the pivot. */ - if ( compare(*start, *mid) < 0 ) { - if ( compare(*mid, *end) < 0 ) + if ( this->compare(*start, *mid) < 0 ) { + if ( this->compare(*mid, *end) < 0 ) pivot = mid; - else if ( compare(*start, *end) < 0 ) + else if ( this->compare(*start, *end) < 0 ) pivot = end; else pivot = start; } - else if ( compare(*start, *end) < 0 ) + else if ( this->compare(*start, *end) < 0 ) pivot = start; - else if ( compare(*mid, *end) < 0 ) + else if ( this->compare(*mid, *end) < 0 ) pivot = end; else pivot = mid; @@ -129,7 +129,7 @@ template <class T, class Compare> T *QuickSort<T,Compare>:: first += 1; if ( first == last ) goto done; - if ( compare( *first, *pivot ) > 0 ) { + if ( this->compare( *first, *pivot ) > 0 ) { memcpy(last, first, sizeof(T)); break; } @@ -140,7 +140,7 @@ template <class T, class Compare> T *QuickSort<T,Compare>:: last -= 1; if ( last == first ) goto done; - if ( compare( *last, *pivot ) < 0 ) { + if ( this->compare( *last, *pivot ) < 0 ) { memcpy(first, last, sizeof(T)); break; } |