From 4aac587d506adf4d2969bc40a2857edceef6fa07 Mon Sep 17 00:00:00 2001 From: Jean-Luc Pons Date: Sun, 3 Mar 2019 10:04:06 +0100 Subject: [PATCH] Fixed some compilation warning --- Int.cpp | 3 +-- IntMod.cpp | 23 ++++++----------------- Vanity.cpp | 2 +- main.cpp | 4 ++-- 4 files changed, 10 insertions(+), 22 deletions(-) diff --git a/Int.cpp b/Int.cpp index f385053..e025840 100644 --- a/Int.cpp +++ b/Int.cpp @@ -789,7 +789,7 @@ void Int::Div(Int *a,Int *mod) { int sb = tSize-1; // D2 Initialize j - for(int j=0; j> 32; - uint64_t a32l = a << 32; - uint64_t a977h; - uint64_t a977l; + uint64_t ah; + uint64_t al; - a977l = _umul128(a,977,&a977h); + al = _umul128(a, 0x1000003D1ULL,&ah); - // Compute a.2^256 - a.2^32 - c = _subborrow_u64(c,0,a32l,dst + 0); - c = _subborrow_u64(c,0,a32h,dst + 1); + // Compute a.2^256 - a.(2^32 + 977) + c = _subborrow_u64(c,0,al,dst + 0); + c = _subborrow_u64(c,0,ah,dst + 1); c = _subborrow_u64(c,0,0,dst + 2); c = _subborrow_u64(c,0,0,dst + 3); _subborrow_u64(c,a,0,dst + 4); - c = 0; - - // Compute (a.2^256 - a.2^32) - a.977 - c = _subborrow_u64(c,dst[0],a977l,dst + 0); - c = _subborrow_u64(c,dst[1],a977h,dst + 1); - c = _subborrow_u64(c,dst[2],0,dst + 2); - c = _subborrow_u64(c,dst[3],0,dst + 3); - _subborrow_u64(c,dst[4],0,dst + 4); - } // ------------------------------------------------ diff --git a/Vanity.cpp b/Vanity.cpp index a092039..880af5c 100644 --- a/Vanity.cpp +++ b/Vanity.cpp @@ -542,7 +542,7 @@ void VanitySearch::Search(int nbThread,std::vector gpuId,std::vector g double t1; endOfSearch = false; nbCPUThread = nbThread; - nbGPUThread = (useGpu?gpuId.size():0); + nbGPUThread = (useGpu?(int)gpuId.size():0); nbFoundKey = 0; memset(counters,0,sizeof(counters)); diff --git a/main.cpp b/main.cpp index 91916f2..a186fbd 100644 --- a/main.cpp +++ b/main.cpp @@ -54,7 +54,7 @@ int getInt(string name,char *v) { r = std::stoi(string(v)); - } catch(std::invalid_argument &ex) { + } catch(std::invalid_argument&) { printf("Invalid %s argument, number expected\n",name.c_str()); exit(-1); @@ -82,7 +82,7 @@ void getInts(string name,vector &tokens, const string &text, char sep) { item = std::stoi(text.substr(start)); tokens.push_back(item); - } catch(std::invalid_argument &ex) { + } catch(std::invalid_argument &) { printf("Invalid %s argument, number expected\n",name.c_str()); exit(-1);