From 7be0ef62b0e45c55059e58a9766a10fe25de2daa Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 2 Aug 2017 18:25:20 +0200 Subject: [PATCH] Test --- basilisk/basilisk_DEX.c | 2 +- crypto777/iguana_utils.c | 18 +++++++++--------- iguana/iguana_bundles.c | 2 +- iguana/iguana_txidfind.c | 2 +- iguana/iguana_unspents.c | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/basilisk/basilisk_DEX.c b/basilisk/basilisk_DEX.c index 35da560b9..71aaee206 100755 --- a/basilisk/basilisk_DEX.c +++ b/basilisk/basilisk_DEX.c @@ -418,7 +418,7 @@ struct basilisk_request *_basilisk_requests_uniq(struct supernet_info *myinfo,in } } } - mergesort(requests,m,sizeof(*requests),_cmp_requests); + heapsort(requests,m,sizeof(*requests),_cmp_requests); *nump = m; return(requests); } diff --git a/crypto777/iguana_utils.c b/crypto777/iguana_utils.c index dce1f85b5..3251be13f 100755 --- a/crypto777/iguana_utils.c +++ b/crypto777/iguana_utils.c @@ -585,31 +585,31 @@ static int _decreasing_uint32(const void *a,const void *b) int32_t sortds(double *buf,uint32_t num,int32_t size) { - mergesort(buf,num,size,_increasing_double); + heapsort(buf,num,size,_increasing_double); return(0); } int32_t revsortds(double *buf,uint32_t num,int32_t size) { - mergesort(buf,num,size,_decreasing_double); + heapsort(buf,num,size,_decreasing_double); return(0); } int32_t sort64s(uint64_t *buf,uint32_t num,int32_t size) { - mergesort(buf,num,size,_increasing_uint64); + heapsort(buf,num,size,_increasing_uint64); return(0); } int32_t revsort64s(uint64_t *buf,uint32_t num,int32_t size) { - mergesort(buf,num,size,_decreasing_uint64); + heapsort(buf,num,size,_decreasing_uint64); return(0); } int32_t revsort32(uint32_t *buf,uint32_t num,int32_t size) { - mergesort(buf,num,size,_decreasing_uint32); + heapsort(buf,num,size,_decreasing_uint32); return(0); } @@ -619,17 +619,17 @@ int32_t revsort32(uint32_t *buf,uint32_t num,int32_t size) if ( dir > 0 ) { if ( size == 32 ) - mergesort(buf,num,structsize,_increasing_bits256); + heapsort(buf,num,structsize,_increasing_bits256); else if ( size == 20 ) - mergesort(buf,num,structsize,_increasing_rmd160); + heapsort(buf,num,structsize,_increasing_rmd160); else retval = -1; } else { if ( size == 32 ) - mergesort(buf,num,structsize,_decreasing_bits256); + heapsort(buf,num,structsize,_decreasing_bits256); else if ( size == 20 ) - mergesort(buf,num,structsize,_decreasing_rmd160); + heapsort(buf,num,structsize,_decreasing_rmd160); else retval = -1; } if ( retval < 0 ) diff --git a/iguana/iguana_bundles.c b/iguana/iguana_bundles.c index 3ac2cd36f..113a2d9ff 100755 --- a/iguana/iguana_bundles.c +++ b/iguana/iguana_bundles.c @@ -1173,7 +1173,7 @@ int32_t iguana_bundleiters(struct supernet_info *myinfo,struct iguana_info *coin static int32_t revsortds(double *buf,uint32_t num,int32_t size) { - mergesort(buf,num,size,_decreasing_double); + heapsort(buf,num,size,_decreasing_double); return(0); }*/ diff --git a/iguana/iguana_txidfind.c b/iguana/iguana_txidfind.c index 601a5079b..209dbccf7 100755 --- a/iguana/iguana_txidfind.c +++ b/iguana/iguana_txidfind.c @@ -563,7 +563,7 @@ int64_t iguana_fastfindcreate(struct iguana_info *coin) { OS_removefile(fname,0); num = (int32_t)allocsize/sizeof(bits256); - mergesort(sortbuf,num,sizeof(bits256),_bignum_cmp); + heapsort(sortbuf,num,sizeof(bits256),_bignum_cmp); strcat(fname,".all"); if ( (coin->fastfps[i]= fopen(fname,"wb")) != 0 ) { diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index f7e8dd05e..935b11ae6 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -853,7 +853,7 @@ int32_t iguana_staker_sort(struct iguana_info *coin,bits256 *hash2p,uint8_t *ref } } if ( n > 0 ) - mergesort(sortbuf,n,sizeof(*sortbuf)*2,_cmp_hashes); + heapsort(sortbuf,n,sizeof(*sortbuf)*2,_cmp_hashes); vcalc_sha256cat(hash2p->bytes,refhash2.bytes,sizeof(refhash2),sortbuf[1].bytes,20); memcpy(refrmd160,sortbuf[1].bytes,20); { @@ -1730,7 +1730,7 @@ uint64_t iguana_utxoaddr_gen(struct supernet_info *myinfo,struct iguana_info *co { if ( counts[ind] > 0 ) { - mergesort(&table[offsets[ind] * UTXOADDR_ITEMSIZE],counts[ind],UTXOADDR_ITEMSIZE,_utxoaddr_cmp); + heapsort(&table[offsets[ind] * UTXOADDR_ITEMSIZE],counts[ind],UTXOADDR_ITEMSIZE,_utxoaddr_cmp); continue; /*for (j=0; j