Browse Source

Printf casts

warmup
jl777 5 years ago
parent
commit
d40b7709bb
  1. 4
      src/komodo_bitcoind.h
  2. 6
      src/komodo_gateway.h
  3. 4
      src/komodo_utils.h
  4. 4
      src/main.cpp

4
src/komodo_bitcoind.h

@ -2051,7 +2051,7 @@ uint64_t komodo_checknotarypay(CBlock *pblock,int32_t height)
total += txout.nValue;
//fprintf(stderr, "MATCHED AmountPaid.%lu notaryid.%i\n",AmountToPay,NotarisationNotaries[n-1]);
}
else fprintf(stderr, "NOT MATCHED AmountPaid.%lu AmountToPay.%lu notaryid.%i\n", pblock->vtx[0].vout[n].nValue, AmountToPay, NotarisationNotaries[n-1]);
else fprintf(stderr, "NOT MATCHED AmountPaid.%llu AmountToPay.%llu notaryid.%i\n", (long long)pblock->vtx[0].vout[n].nValue, (long long)AmountToPay, NotarisationNotaries[n-1]);
}
n++;
}
@ -2347,7 +2347,7 @@ int32_t komodo_checkPOW(int32_t slowflag,CBlock *pblock,int32_t height)
numSN = komodo_notaries(notarypubkeys, height, pblock->nTime);
if ( pblock->vtx[1].vin.size() < numSN/5 )
{
fprintf(stderr, "ht.%i does not meet minsigs.%i sigs.%li\n",height,numSN/5,pblock->vtx[1].vin.size());
fprintf(stderr, "ht.%i does not meet minsigs.%i sigs.%lld\n",height,numSN/5,(long long)pblock->vtx[1].vin.size());
return(-1);
}
}

6
src/komodo_gateway.h

@ -669,7 +669,7 @@ int32_t komodo_bannedset(int32_t *indallvoutsp,uint256 *array,int32_t max)
int32_t i;
if ( sizeof(banned_txids)/sizeof(*banned_txids) > max )
{
fprintf(stderr,"komodo_bannedset: buffer too small %ld vs %d\n",sizeof(banned_txids)/sizeof(*banned_txids),max);
fprintf(stderr,"komodo_bannedset: buffer too small %d vs %d\n",(int32_t)(sizeof(banned_txids)/sizeof(*banned_txids)),max);
StartShutdown();
}
for (i=0; i<sizeof(banned_txids)/sizeof(*banned_txids); i++)
@ -1289,7 +1289,7 @@ long komodo_stateind_validate(struct komodo_state *sp,char *indfname,uint8_t *fi
if ( (inds= OS_fileptr(&fsize,indfname)) != 0 )
{
lastfpos = 0;
fprintf(stderr,"inds.%p validate %s fsize.%ld datalen.%ld n.%ld lastfpos.%ld\n",inds,indfname,fsize,datalen,fsize / sizeof(uint32_t),lastfpos);
fprintf(stderr,"inds.%p validate %s fsize.%ld datalen.%ld n.%d lastfpos.%ld\n",inds,indfname,fsize,datalen,(int32_t)(fsize / sizeof(uint32_t)),lastfpos);
if ( (fsize % sizeof(uint32_t)) == 0 )
{
n = (int32_t)(fsize / sizeof(uint32_t));
@ -1380,7 +1380,7 @@ int32_t komodo_faststateinit(struct komodo_state *sp,char *fname,char *symbol,ch
if ( (indfp= fopen(indfname,"rb+")) != 0 )
{
lastfpos = fpos = validated;
fprintf(stderr,"datalen.%ld validated %ld -> indcounter %u, prevpos100 %u offset.%ld\n",datalen,validated,indcounter,prevpos100,indcounter * sizeof(uint32_t));
fprintf(stderr,"datalen.%ld validated %ld -> indcounter %u, prevpos100 %u offset.%d\n",datalen,validated,indcounter,prevpos100,(int32_t)(indcounter * sizeof(uint32_t)));
if ( fpos < datalen )
{
fseek(indfp,indcounter * sizeof(uint32_t),SEEK_SET);

4
src/komodo_utils.h

@ -2125,7 +2125,7 @@ void komodo_args(char *argv0)
extralen += iguana_rwnum(1,&extraptr[extralen],sizeof(ASSETCHAINS_FOUNDERS),(void *)&ASSETCHAINS_FOUNDERS);
if ( ASSETCHAINS_FOUNDERS_REWARD != 0 )
{
fprintf(stderr, "set founders reward.%li\n",ASSETCHAINS_FOUNDERS_REWARD);
fprintf(stderr, "set founders reward.%lld\n",(long long)ASSETCHAINS_FOUNDERS_REWARD);
extralen += iguana_rwnum(1,&extraptr[extralen],sizeof(ASSETCHAINS_FOUNDERS_REWARD),(void *)&ASSETCHAINS_FOUNDERS_REWARD);
}
}
@ -2348,7 +2348,7 @@ void komodo_args(char *argv0)
if ( strcmp("PIRATE",ASSETCHAINS_SYMBOL) == 0 && ASSETCHAINS_HALVING[0] == 77777 )
{
ASSETCHAINS_HALVING[0] *= 5;
fprintf(stderr,"PIRATE halving changed to %d %.1f days ASSETCHAINS_LASTERA.%lu\n",(int32_t)ASSETCHAINS_HALVING[0],(double)ASSETCHAINS_HALVING[0]/1440,ASSETCHAINS_LASTERA);
fprintf(stderr,"PIRATE halving changed to %d %.1f days ASSETCHAINS_LASTERA.%llu\n",(int32_t)ASSETCHAINS_HALVING[0],(double)ASSETCHAINS_HALVING[0]/1440,(long long)ASSETCHAINS_LASTERA);
}
else if ( strcmp("VRSC",ASSETCHAINS_SYMBOL) == 0 )
dpowconfs = 0;

4
src/main.cpp

@ -762,7 +762,7 @@ bool komodo_dailysnapshot(int32_t height)
// include only top 3999 address.
if ( vAddressSnapshot.size() > 3999 ) vAddressSnapshot.resize(3999);
lastSnapShotHeight = undo_height;
fprintf(stderr, "vAddressSnapshot.size.%li\n", vAddressSnapshot.size());
fprintf(stderr, "vAddressSnapshot.size.%d\n", (int32_t)vAddressSnapshot.size());
return true;
}
@ -4322,7 +4322,7 @@ bool static ConnectTip(CValidationState &state, CBlockIndex *pindexNew, CBlock *
fprintf(stderr, "daily snapshot failed, please reindex your chain\n");
StartShutdown();
}
fprintf(stderr, "snapshot completed in: %lu seconds\n", time(NULL)-start);
fprintf(stderr, "snapshot completed in: %d seconds\n", (int32_t)(time(NULL)-start));
}
}
return true;

Loading…
Cancel
Save