cppchecker fix

This commit is contained in:
iceman1001 2020-04-28 13:29:19 +02:00
commit 4a282b32c2

View file

@ -129,6 +129,11 @@ void runKernel(struct context *ctx, uint32_t cand_base, uint64_t *matches, uint3
// Write our data set into the input array in device memory
err = clEnqueueWriteBuffer(ctx->commands, ctx->matches_found, CL_TRUE, 0, sizeof(uint32_t), matches_found, 0, NULL, NULL);
if (err != CL_SUCCESS) {
printf("Error: Failed to enque kernel writebuffer in runKernel! %d\n", err);
exit(1);
}
// Set the arguments to our compute kernel
err = clSetKernelArg(ctx->kernel, 0, sizeof(uint32_t), &cand_base);
err |= clSetKernelArg(ctx->kernel, 4, sizeof(cl_mem), &ctx->matches_found);
@ -231,7 +236,7 @@ int main(int argc, char *argv[]) {
for (size_t i0 = 0; i0 < 1 << 20; i0++) {
uint64_t state0 = expand(0x5806b4a2d16c, i0);
if (f(state0) == (target >> 31)) {
if (f(state0) == target >> 31 ) {
// cf kernel, state is now split in 3 shorts >> 2
candidates[(layer_0_found * 3) + 0] = (uint16_t)((state0 >> (32 + 2)) & 0xffff);
candidates[(layer_0_found * 3) + 1] = (uint16_t)((state0 >> (16 + 2)) & 0xffff);