cppchecker fixes

This commit is contained in:
iceman1001 2020-04-26 13:49:06 +02:00
commit dd5679a53a
6 changed files with 93 additions and 68 deletions

View file

@ -162,7 +162,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)) {
candidates[layer_0_found++] = state0;
}
}
@ -185,7 +185,7 @@ void *find_state(void *thread_d) {
for (size_t index = thread; index < layer_0_found; index += thread_count) {
if (((index / thread_count) & 0xFF) == 0)
printf("Thread %lu slice %lu/%lu\n", thread, index / thread_count / 256 + 1, layer_0_found / thread_count / 256);
printf("Thread %zu slice %zu/%zu\n", thread, index / thread_count / 256 + 1, layer_0_found / thread_count / 256);
uint64_t state0 = candidates[index];
bitslice(state0 >> 2, &state[0], 46, false);
for (size_t bit = 0; bit < 8; bit++) {

View file

@ -231,7 +231,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);