Skip to content

Commit

Permalink
Fixed some compilation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanLucPons committed Mar 3, 2019
1 parent 04df0ac commit 4aac587
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 22 deletions.
3 changes: 1 addition & 2 deletions Int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ void Int::Div(Int *a,Int *mod) {
int sb = tSize-1;

// D2 Initialize j
for(int j=0; j<qSize; j++) {
for(int j=0; j<(int)qSize; j++) {

// D3 Estimate qhat
uint32_t qhat = 0;
Expand Down Expand Up @@ -1099,7 +1099,6 @@ void Int::Check() {
double t0;
double t1;
double tTotal;
double tTotal2;
int i;
bool ok;

Expand Down
23 changes: 6 additions & 17 deletions IntMod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -776,29 +776,18 @@ static inline void mulP(uint64_t a,uint64_t *dst) {
// Multiply a by (2^256 - 2^32 - 977) (Secpk1 prime field)
unsigned char c = 0;

uint64_t a32h = a >> 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);

}

// ------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion Vanity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ void VanitySearch::Search(int nbThread,std::vector<int> gpuId,std::vector<int> 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));
Expand Down
4 changes: 2 additions & 2 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -82,7 +82,7 @@ void getInts(string name,vector<int> &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);
Expand Down

0 comments on commit 4aac587

Please sign in to comment.