Browse Source

x64: fix some size_t warnings

master
Tanguy Pruvot 10 years ago
parent
commit
d9b0312897
  1. 41
      JHA/cuda_jha_compactionTest.cu
  2. 6
      JHA/jackpotcoin.cu
  3. 7
      api.cpp
  4. 4
      ccminer.vcxproj
  5. 6
      hashlog.cpp
  6. 8
      quark/animecoin.cu
  7. 12
      quark/cuda_quark_compactionTest.cu
  8. 8
      quark/quarkcoin.cu
  9. 4
      stats.cpp
  10. 4
      util.cpp

41
JHA/cuda_jha_compactionTest.cu

@ -4,6 +4,10 @@
#include "cuda_helper.h" #include "cuda_helper.h"
#include <sm_30_intrinsics.h> #include <sm_30_intrinsics.h>
#ifdef __INTELLISENSE__
#define __shfl_up(a,b)
#endif
static uint32_t *d_tempBranch1Nonces[MAX_GPUS]; static uint32_t *d_tempBranch1Nonces[MAX_GPUS];
static uint32_t *d_numValid[MAX_GPUS]; static uint32_t *d_numValid[MAX_GPUS];
static uint32_t *h_numValid[MAX_GPUS]; static uint32_t *h_numValid[MAX_GPUS];
@ -56,7 +60,9 @@ __host__ void jackpot_compactTest_cpu_init(int thr_id, uint32_t threads)
#endif #endif
// Die Summenfunktion (vom NVIDIA SDK) // Die Summenfunktion (vom NVIDIA SDK)
__global__ void jackpot_compactTest_gpu_SCAN(uint32_t *data, int width, uint32_t *partial_sums=NULL, cuda_compactTestFunction_t testFunc=NULL, uint32_t threads=0, uint32_t startNounce=0, uint32_t *inpHashes=NULL, uint32_t *d_validNonceTable=NULL) __global__
void jackpot_compactTest_gpu_SCAN(uint32_t *data, int width, uint32_t *partial_sums=NULL, cuda_compactTestFunction_t testFunc=NULL,
uint32_t threads=0, uint32_t startNounce=0, uint32_t *inpHashes=NULL, uint32_t *d_validNonceTable=NULL)
{ {
extern __shared__ uint32_t sums[]; extern __shared__ uint32_t sums[];
int id = ((blockIdx.x * blockDim.x) + threadIdx.x); int id = ((blockIdx.x * blockDim.x) + threadIdx.x);
@ -168,7 +174,8 @@ __global__ void jackpot_compactTest_gpu_SCAN(uint32_t *data, int width, uint32_t
} }
// Uniform add: add partial sums array // Uniform add: add partial sums array
__global__ void jackpot_compactTest_gpu_ADD(uint32_t *data, uint32_t *partial_sums, int len) __global__
void jackpot_compactTest_gpu_ADD(uint32_t *data, uint32_t *partial_sums, int len)
{ {
__shared__ uint32_t buf; __shared__ uint32_t buf;
int id = ((blockIdx.x * blockDim.x) + threadIdx.x); int id = ((blockIdx.x * blockDim.x) + threadIdx.x);
@ -185,7 +192,9 @@ __global__ void jackpot_compactTest_gpu_ADD(uint32_t *data, uint32_t *partial_su
} }
// Der Scatter // Der Scatter
__global__ void jackpot_compactTest_gpu_SCATTER(uint32_t *sum, uint32_t *outp, cuda_compactTestFunction_t testFunc, uint32_t threads=0, uint32_t startNounce=0, uint32_t *inpHashes=NULL, uint32_t *d_validNonceTable=NULL) __global__
void jackpot_compactTest_gpu_SCATTER(uint32_t *sum, uint32_t *outp, cuda_compactTestFunction_t testFunc,
uint32_t threads=0, uint32_t startNounce=0, uint32_t *inpHashes=NULL, uint32_t *d_validNonceTable=NULL)
{ {
int id = ((blockIdx.x * blockDim.x) + threadIdx.x); int id = ((blockIdx.x * blockDim.x) + threadIdx.x);
uint32_t actNounce = id; uint32_t actNounce = id;
@ -220,7 +229,8 @@ __global__ void jackpot_compactTest_gpu_SCATTER(uint32_t *sum, uint32_t *outp, c
} }
} }
__host__ static uint32_t jackpot_compactTest_roundUpExp(uint32_t val) __host__
static uint32_t jackpot_compactTest_roundUpExp(uint32_t val)
{ {
if(val == 0) if(val == 0)
return 0; return 0;
@ -234,9 +244,9 @@ __host__ static uint32_t jackpot_compactTest_roundUpExp(uint32_t val)
return mask; return mask;
} }
__host__ void jackpot_compactTest_cpu_singleCompaction(int thr_id, uint32_t threads, uint32_t *nrm, __host__
uint32_t *d_nonces1, cuda_compactTestFunction_t function, void jackpot_compactTest_cpu_singleCompaction(int thr_id, uint32_t threads, uint32_t *nrm, uint32_t *d_nonces1,
uint32_t startNounce, uint32_t *inpHashes, uint32_t *d_validNonceTable) cuda_compactTestFunction_t function, uint32_t startNounce, uint32_t *inpHashes, uint32_t *d_validNonceTable)
{ {
int orgThreads = threads; int orgThreads = threads;
threads = (int)jackpot_compactTest_roundUpExp((uint32_t)threads); threads = (int)jackpot_compactTest_roundUpExp((uint32_t)threads);
@ -290,9 +300,9 @@ __host__ void jackpot_compactTest_cpu_singleCompaction(int thr_id, uint32_t thre
} }
////// ACHTUNG: Diese funktion geht aktuell nur mit threads > 65536 (Am besten 256 * 1024 oder 256*2048) ////// ACHTUNG: Diese funktion geht aktuell nur mit threads > 65536 (Am besten 256 * 1024 oder 256*2048)
__host__ void jackpot_compactTest_cpu_dualCompaction(int thr_id, uint32_t threads, uint32_t *nrm, __host__
uint32_t *d_nonces1, uint32_t *d_nonces2, void jackpot_compactTest_cpu_dualCompaction(int thr_id, uint32_t threads, uint32_t *nrm, uint32_t *d_nonces1,
uint32_t startNounce, uint32_t *inpHashes, uint32_t *d_validNonceTable) uint32_t *d_nonces2, uint32_t startNounce, uint32_t *inpHashes, uint32_t *d_validNonceTable)
{ {
jackpot_compactTest_cpu_singleCompaction(thr_id, threads, &nrm[0], d_nonces1, h_JackpotTrueFunction[thr_id], startNounce, inpHashes, d_validNonceTable); jackpot_compactTest_cpu_singleCompaction(thr_id, threads, &nrm[0], d_nonces1, h_JackpotTrueFunction[thr_id], startNounce, inpHashes, d_validNonceTable);
jackpot_compactTest_cpu_singleCompaction(thr_id, threads, &nrm[1], d_nonces2, h_JackpotFalseFunction[thr_id], startNounce, inpHashes, d_validNonceTable); jackpot_compactTest_cpu_singleCompaction(thr_id, threads, &nrm[1], d_nonces2, h_JackpotFalseFunction[thr_id], startNounce, inpHashes, d_validNonceTable);
@ -329,10 +339,9 @@ __host__ void jackpot_compactTest_cpu_dualCompaction(int thr_id, uint32_t thread
*/ */
} }
__host__ void jackpot_compactTest_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *inpHashes, uint32_t *d_validNonceTable, __host__
uint32_t *d_nonces1, size_t *nrm1, void jackpot_compactTest_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *inpHashes, uint32_t *d_validNonceTable,
uint32_t *d_nonces2, size_t *nrm2, uint32_t *d_nonces1, uint32_t *nrm1, uint32_t *d_nonces2, uint32_t *nrm2, int order)
int order)
{ {
// Wenn validNonceTable genutzt wird, dann werden auch nur die Nonces betrachtet, die dort enthalten sind // Wenn validNonceTable genutzt wird, dann werden auch nur die Nonces betrachtet, die dort enthalten sind
// "threads" ist in diesem Fall auf die Länge dieses Array's zu setzen! // "threads" ist in diesem Fall auf die Länge dieses Array's zu setzen!
@ -342,6 +351,6 @@ __host__ void jackpot_compactTest_cpu_hash_64(int thr_id, uint32_t threads, uint
startNounce, inpHashes, d_validNonceTable); startNounce, inpHashes, d_validNonceTable);
cudaStreamSynchronize(NULL); // Das original braucht zwar etwas CPU-Last, ist an dieser Stelle aber evtl besser cudaStreamSynchronize(NULL); // Das original braucht zwar etwas CPU-Last, ist an dieser Stelle aber evtl besser
*nrm1 = (size_t)h_numValid[thr_id][0]; *nrm1 = h_numValid[thr_id][0];
*nrm2 = (size_t)h_numValid[thr_id][1]; *nrm2 = h_numValid[thr_id][1];
} }

6
JHA/jackpotcoin.cu

@ -30,8 +30,8 @@ extern void quark_skein512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t st
extern void jackpot_compactTest_cpu_init(int thr_id, uint32_t threads); extern void jackpot_compactTest_cpu_init(int thr_id, uint32_t threads);
extern void jackpot_compactTest_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *inpHashes, uint32_t *d_validNonceTable, extern void jackpot_compactTest_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *inpHashes, uint32_t *d_validNonceTable,
uint32_t *d_nonces1, size_t *nrm1, uint32_t *d_nonces1, uint32_t *nrm1,
uint32_t *d_nonces2, size_t *nrm2, uint32_t *d_nonces2, uint32_t *nrm2,
int order); int order);
extern uint32_t cuda_check_hash_branch(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_inputHash, int order); extern uint32_t cuda_check_hash_branch(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_inputHash, int order);
@ -136,7 +136,7 @@ extern "C" int scanhash_jackpot(int thr_id, uint32_t *pdata,
// erstes Keccak512 Hash mit CUDA // erstes Keccak512 Hash mit CUDA
jackpot_keccak512_cpu_hash(thr_id, throughput, pdata[19], d_hash[thr_id], order++); jackpot_keccak512_cpu_hash(thr_id, throughput, pdata[19], d_hash[thr_id], order++);
size_t nrm1, nrm2, nrm3; uint32_t nrm1, nrm2, nrm3;
// Runde 1 (ohne Gröstl) // Runde 1 (ohne Gröstl)

7
api.cpp

@ -452,7 +452,7 @@ static int send_result(SOCKETTYPE c, char *result)
n = send(c, "", 1, 0); n = send(c, "", 1, 0);
} else { } else {
// ignore failure - it's closed immediately anyway // ignore failure - it's closed immediately anyway
n = send(c, result, strlen(result) + 1, 0); n = send(c, result, (int) strlen(result) + 1, 0);
} }
return n; return n;
} }
@ -595,7 +595,7 @@ static int websocket_handshake(SOCKETTYPE c, char *result, char *clientkey)
// WebSocket Frame - Header + Data // WebSocket Frame - Header + Data
memcpy(p, hd, frames); memcpy(p, hd, frames);
memcpy(p + frames, result, (size_t)datalen); memcpy(p + frames, result, (size_t)datalen);
send(c, (const char*)data, strlen(answer) + frames + (size_t)datalen + 1, 0); send(c, (const char*)data, (int) (strlen(answer) + frames + datalen + 1), 0);
free(data); free(data);
} }
return 0; return 0;
@ -724,7 +724,7 @@ static void api()
const char *addr = opt_api_allow; const char *addr = opt_api_allow;
unsigned short port = (unsigned short) opt_api_listen; // 4068 unsigned short port = (unsigned short) opt_api_listen; // 4068
char buf[MYBUFSIZ]; char buf[MYBUFSIZ];
int c, n, bound; int n, bound;
char *connectaddr; char *connectaddr;
char *binderror; char *binderror;
char group; char group;
@ -738,6 +738,7 @@ static void api()
char *params; char *params;
int i; int i;
SOCKETTYPE c;
SOCKETTYPE *apisock; SOCKETTYPE *apisock;
if (!opt_api_listen && opt_debug) { if (!opt_api_listen && opt_debug) {
applog(LOG_DEBUG, "API disabled"); applog(LOG_DEBUG, "API disabled");

4
ccminer.vcxproj

@ -223,7 +223,7 @@
<MaxRegCount>80</MaxRegCount> <MaxRegCount>80</MaxRegCount>
<PtxAsOptionV>true</PtxAsOptionV> <PtxAsOptionV>true</PtxAsOptionV>
<Keep>false</Keep> <Keep>false</Keep>
<CodeGeneration>compute_50,sm_50;compute_52,sm_52</CodeGeneration> <CodeGeneration>compute_35,sm_35;compute_50,sm_50;compute_52,sm_52</CodeGeneration>
<Include> <Include>
</Include> </Include>
<TargetMachinePlatform>64</TargetMachinePlatform> <TargetMachinePlatform>64</TargetMachinePlatform>
@ -539,4 +539,4 @@
<Target Name="AfterClean"> <Target Name="AfterClean">
<Delete Files="@(FilesToCopy->'$(OutDir)%(Filename)%(Extension)')" TreatErrorsAsWarnings="true" /> <Delete Files="@(FilesToCopy->'$(OutDir)%(Filename)%(Extension)')" TreatErrorsAsWarnings="true" />
</Target> </Target>
</Project> </Project>

6
hashlog.cpp

@ -194,7 +194,7 @@ void hashlog_purge_job(char* jobid)
int deleted = 0; int deleted = 0;
uint64_t njobid = hextouint(jobid); uint64_t njobid = hextouint(jobid);
uint64_t keypfx = (njobid << 32); uint64_t keypfx = (njobid << 32);
uint32_t sz = tlastshares.size(); uint32_t sz = (uint32_t) tlastshares.size();
std::map<uint64_t, hashlog_data>::iterator i = tlastshares.begin(); std::map<uint64_t, hashlog_data>::iterator i = tlastshares.begin();
while (i != tlastshares.end()) { while (i != tlastshares.end()) {
if ((keypfx & i->first) == keypfx) { if ((keypfx & i->first) == keypfx) {
@ -215,7 +215,7 @@ void hashlog_purge_old(void)
{ {
int deleted = 0; int deleted = 0;
uint32_t now = (uint32_t) time(NULL); uint32_t now = (uint32_t) time(NULL);
uint32_t sz = tlastshares.size(); uint32_t sz = (uint32_t) tlastshares.size();
std::map<uint64_t, hashlog_data>::iterator i = tlastshares.begin(); std::map<uint64_t, hashlog_data>::iterator i = tlastshares.begin();
while (i != tlastshares.end()) { while (i != tlastshares.end()) {
if ((now - i->second.tm_sent) > LOG_PURGE_TIMEOUT) { if ((now - i->second.tm_sent) > LOG_PURGE_TIMEOUT) {
@ -242,7 +242,7 @@ void hashlog_purge_all(void)
*/ */
void hashlog_getmeminfo(uint64_t *mem, uint32_t *records) void hashlog_getmeminfo(uint64_t *mem, uint32_t *records)
{ {
(*records) = tlastshares.size(); (*records) = (uint32_t) tlastshares.size();
(*mem) = (*records) * sizeof(hashlog_data); (*mem) = (*records) * sizeof(hashlog_data);
} }

8
quark/animecoin.cu

@ -40,11 +40,11 @@ extern void quark_jh512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t start
extern void quark_compactTest_cpu_init(int thr_id, uint32_t threads); extern void quark_compactTest_cpu_init(int thr_id, uint32_t threads);
extern void quark_compactTest_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *inpHashes, uint32_t *d_validNonceTable, extern void quark_compactTest_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *inpHashes, uint32_t *d_validNonceTable,
uint32_t *d_nonces1, size_t *nrm1, uint32_t *d_nonces1, uint32_t *nrm1,
uint32_t *d_nonces2, size_t *nrm2, uint32_t *d_nonces2, uint32_t *nrm2,
int order); int order);
extern void quark_compactTest_single_false_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *inpHashes, uint32_t *d_validNonceTable, extern void quark_compactTest_single_false_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *inpHashes, uint32_t *d_validNonceTable,
uint32_t *d_nonces1, size_t *nrm1, uint32_t *d_nonces1, uint32_t *nrm1,
int order); int order);
extern uint32_t cuda_check_hash_branch(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_inputHash, int order); extern uint32_t cuda_check_hash_branch(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_inputHash, int order);
@ -203,7 +203,7 @@ extern "C" int scanhash_anime(int thr_id, uint32_t *pdata,
do { do {
int order = 0; int order = 0;
size_t nrm1=0, nrm2=0, nrm3=0; uint32_t nrm1=0, nrm2=0, nrm3=0;
// erstes BMW512 Hash mit CUDA // erstes BMW512 Hash mit CUDA
quark_bmw512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id], order++); quark_bmw512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id], order++);

12
quark/cuda_quark_compactionTest.cu

@ -328,8 +328,8 @@ __host__ void quark_compactTest_cpu_dualCompaction(int thr_id, uint32_t threads,
} }
__host__ void quark_compactTest_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *inpHashes, uint32_t *d_validNonceTable, __host__ void quark_compactTest_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *inpHashes, uint32_t *d_validNonceTable,
uint32_t *d_nonces1, size_t *nrm1, uint32_t *d_nonces1, uint32_t *nrm1,
uint32_t *d_nonces2, size_t *nrm2, uint32_t *d_nonces2, uint32_t *nrm2,
int order) int order)
{ {
// Wenn validNonceTable genutzt wird, dann werden auch nur die Nonces betrachtet, die dort enthalten sind // Wenn validNonceTable genutzt wird, dann werden auch nur die Nonces betrachtet, die dort enthalten sind
@ -340,12 +340,12 @@ __host__ void quark_compactTest_cpu_hash_64(int thr_id, uint32_t threads, uint32
startNounce, inpHashes, d_validNonceTable); startNounce, inpHashes, d_validNonceTable);
cudaStreamSynchronize(NULL); // Das original braucht zwar etwas CPU-Last, ist an dieser Stelle aber evtl besser cudaStreamSynchronize(NULL); // Das original braucht zwar etwas CPU-Last, ist an dieser Stelle aber evtl besser
*nrm1 = (size_t)h_numValid[thr_id][0]; *nrm1 = h_numValid[thr_id][0];
*nrm2 = (size_t)h_numValid[thr_id][1]; *nrm2 = h_numValid[thr_id][1];
} }
__host__ void quark_compactTest_single_false_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *inpHashes, uint32_t *d_validNonceTable, __host__ void quark_compactTest_single_false_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *inpHashes, uint32_t *d_validNonceTable,
uint32_t *d_nonces1, size_t *nrm1, uint32_t *d_nonces1, uint32_t *nrm1,
int order) int order)
{ {
// Wenn validNonceTable genutzt wird, dann werden auch nur die Nonces betrachtet, die dort enthalten sind // Wenn validNonceTable genutzt wird, dann werden auch nur die Nonces betrachtet, die dort enthalten sind
@ -354,5 +354,5 @@ __host__ void quark_compactTest_single_false_cpu_hash_64(int thr_id, uint32_t th
quark_compactTest_cpu_singleCompaction(thr_id, threads, h_numValid[thr_id], d_nonces1, h_QuarkFalseFunction[thr_id], startNounce, inpHashes, d_validNonceTable); quark_compactTest_cpu_singleCompaction(thr_id, threads, h_numValid[thr_id], d_nonces1, h_QuarkFalseFunction[thr_id], startNounce, inpHashes, d_validNonceTable);
cudaStreamSynchronize(NULL); // Das original braucht zwar etwas CPU-Last, ist an dieser Stelle aber evtl besser cudaStreamSynchronize(NULL); // Das original braucht zwar etwas CPU-Last, ist an dieser Stelle aber evtl besser
*nrm1 = (size_t)h_numValid[thr_id][0]; *nrm1 = h_numValid[thr_id][0];
} }

8
quark/quarkcoin.cu

@ -42,11 +42,11 @@ extern void quark_jh512_cpu_hash_64(int thr_id, uint32_t threads, uint32_t start
extern void quark_compactTest_cpu_init(int thr_id, uint32_t threads); extern void quark_compactTest_cpu_init(int thr_id, uint32_t threads);
extern void quark_compactTest_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *inpHashes, uint32_t *d_validNonceTable, extern void quark_compactTest_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *inpHashes, uint32_t *d_validNonceTable,
uint32_t *d_nonces1, size_t *nrm1, uint32_t *d_nonces1, uint32_t *nrm1,
uint32_t *d_nonces2, size_t *nrm2, uint32_t *d_nonces2, uint32_t *nrm2,
int order); int order);
extern void quark_compactTest_single_false_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *inpHashes, uint32_t *d_validNonceTable, extern void quark_compactTest_single_false_cpu_hash_64(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *inpHashes, uint32_t *d_validNonceTable,
uint32_t *d_nonces1, size_t *nrm1, uint32_t *d_nonces1, uint32_t *nrm1,
int order); int order);
extern uint32_t cuda_check_hash_branch(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_inputHash, int order); extern uint32_t cuda_check_hash_branch(int thr_id, uint32_t threads, uint32_t startNounce, uint32_t *d_nonceVector, uint32_t *d_inputHash, int order);
@ -175,7 +175,7 @@ extern "C" int scanhash_quark(int thr_id, uint32_t *pdata,
do { do {
int order = 0; int order = 0;
size_t nrm1=0, nrm2=0, nrm3=0; uint32_t nrm1=0, nrm2=0, nrm3=0;
// erstes Blake512 Hash mit CUDA // erstes Blake512 Hash mit CUDA
quark_blake512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++; quark_blake512_cpu_hash_80(thr_id, throughput, pdata[19], d_hash[thr_id]); order++;

4
stats.cpp

@ -133,7 +133,7 @@ void stats_purge_old(void)
{ {
int deleted = 0; int deleted = 0;
uint32_t now = (uint32_t) time(NULL); uint32_t now = (uint32_t) time(NULL);
uint32_t sz = tlastscans.size(); uint32_t sz = (uint32_t) tlastscans.size();
std::map<uint64_t, stats_data>::iterator i = tlastscans.begin(); std::map<uint64_t, stats_data>::iterator i = tlastscans.begin();
while (i != tlastscans.end()) { while (i != tlastscans.end()) {
if (i->second.ignored || (now - i->second.tm_stat) > STATS_PURGE_TIMEOUT) { if (i->second.ignored || (now - i->second.tm_stat) > STATS_PURGE_TIMEOUT) {
@ -160,6 +160,6 @@ void stats_purge_all(void)
*/ */
void stats_getmeminfo(uint64_t *mem, uint32_t *records) void stats_getmeminfo(uint64_t *mem, uint32_t *records)
{ {
(*records) = tlastscans.size(); (*records) = (uint32_t) tlastscans.size();
(*mem) = (*records) * sizeof(stats_data); (*mem) = (*records) * sizeof(stats_data);
} }

4
util.cpp

@ -977,7 +977,7 @@ static const char *get_stratum_session_id(json_t *val)
arr_val = json_array_get(val, 0); arr_val = json_array_get(val, 0);
if (!arr_val || !json_is_array(arr_val)) if (!arr_val || !json_is_array(arr_val))
return NULL; return NULL;
n = json_array_size(arr_val); n = (int) json_array_size(arr_val);
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
const char *notify; const char *notify;
json_t *arr = json_array_get(arr_val, i); json_t *arr = json_array_get(arr_val, i);
@ -1264,7 +1264,7 @@ static bool stratum_notify(struct stratum_ctx *sctx, json_t *params)
merkle_arr = json_array_get(params, 4); merkle_arr = json_array_get(params, 4);
if (!merkle_arr || !json_is_array(merkle_arr)) if (!merkle_arr || !json_is_array(merkle_arr))
goto out; goto out;
merkle_count = json_array_size(merkle_arr); merkle_count = (int) json_array_size(merkle_arr);
version = json_string_value(json_array_get(params, 5)); version = json_string_value(json_array_get(params, 5));
nbits = json_string_value(json_array_get(params, 6)); nbits = json_string_value(json_array_get(params, 6));
stime = json_string_value(json_array_get(params, 7)); stime = json_string_value(json_array_get(params, 7));

Loading…
Cancel
Save