X-Git-Url: https://www.flypig.org.uk/git/?p=hashcat.git;a=blobdiff_plain;f=src%2Fhashcat.c;fp=src%2Fhashcat.c;h=d11921f6bc0dedacc070a10a02fa15e10ef30aab;hp=e0d77ce14b15896e1aded978d29206d436925936;hb=37eaafdabf326313a47ae5ecc2c6d53ed0d79c51;hpb=8acf5b38797560de0613d77f7eb6d6daee578bcb diff --git a/src/hashcat.c b/src/hashcat.c index e0d77ce..d11921f 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -3592,7 +3592,7 @@ static int autotune (hc_device_param_t *device_param) { for (int i = 0; i < STEPS_CNT; i++) { - const u32 kernel_accel_try = 1 << i; + const u32 kernel_accel_try = 1u << i; if (kernel_accel_try < kernel_accel_min) continue; if (kernel_accel_try > kernel_accel_max) break; @@ -13845,14 +13845,14 @@ int main (int argc, char **argv) if (bitmap_max < bitmap_min) bitmap_max = bitmap_min; - uint *bitmap_s1_a = (uint *) mymalloc ((1 << bitmap_max) * sizeof (uint)); - uint *bitmap_s1_b = (uint *) mymalloc ((1 << bitmap_max) * sizeof (uint)); - uint *bitmap_s1_c = (uint *) mymalloc ((1 << bitmap_max) * sizeof (uint)); - uint *bitmap_s1_d = (uint *) mymalloc ((1 << bitmap_max) * sizeof (uint)); - uint *bitmap_s2_a = (uint *) mymalloc ((1 << bitmap_max) * sizeof (uint)); - uint *bitmap_s2_b = (uint *) mymalloc ((1 << bitmap_max) * sizeof (uint)); - uint *bitmap_s2_c = (uint *) mymalloc ((1 << bitmap_max) * sizeof (uint)); - uint *bitmap_s2_d = (uint *) mymalloc ((1 << bitmap_max) * sizeof (uint)); + uint *bitmap_s1_a = (uint *) mymalloc ((1u << bitmap_max) * sizeof (uint)); + uint *bitmap_s1_b = (uint *) mymalloc ((1u << bitmap_max) * sizeof (uint)); + uint *bitmap_s1_c = (uint *) mymalloc ((1u << bitmap_max) * sizeof (uint)); + uint *bitmap_s1_d = (uint *) mymalloc ((1u << bitmap_max) * sizeof (uint)); + uint *bitmap_s2_a = (uint *) mymalloc ((1u << bitmap_max) * sizeof (uint)); + uint *bitmap_s2_b = (uint *) mymalloc ((1u << bitmap_max) * sizeof (uint)); + uint *bitmap_s2_c = (uint *) mymalloc ((1u << bitmap_max) * sizeof (uint)); + uint *bitmap_s2_d = (uint *) mymalloc ((1u << bitmap_max) * sizeof (uint)); uint bitmap_bits; uint bitmap_nums; @@ -13863,7 +13863,7 @@ int main (int argc, char **argv) { if (data.quiet == 0) log_info_nn ("Generating bitmap tables with %u bits...", bitmap_bits); - bitmap_nums = 1 << bitmap_bits; + bitmap_nums = 1u << bitmap_bits; bitmap_mask = bitmap_nums - 1; @@ -13877,7 +13877,7 @@ int main (int argc, char **argv) break; } - bitmap_nums = 1 << bitmap_bits; + bitmap_nums = 1u << bitmap_bits; bitmap_mask = bitmap_nums - 1; @@ -14167,7 +14167,7 @@ int main (int argc, char **argv) for (uint platform_id = 0; platform_id < platforms_cnt; platform_id++) { - if ((opencl_platforms_filter & (1 << platform_id)) == 0) continue; + if ((opencl_platforms_filter & (1u << platform_id)) == 0) continue; cl_platform_id platform = platforms[platform_id]; @@ -14299,7 +14299,7 @@ int main (int argc, char **argv) platform_vendor_id = VENDOR_ID_GENERIC; } - uint platform_skipped = ((opencl_platforms_filter & (1 << platform_id)) == 0); + uint platform_skipped = ((opencl_platforms_filter & (1u << platform_id)) == 0); CL_err = hc_clGetDeviceIDs (data.ocl, platform, CL_DEVICE_TYPE_ALL, DEVICES_MAX, platform_devices, &platform_devices_cnt); @@ -14806,7 +14806,7 @@ int main (int argc, char **argv) // skipped - device_param->skipped |= ((devices_filter & (1 << device_id)) == 0); + device_param->skipped |= ((devices_filter & (1u << device_id)) == 0); device_param->skipped |= ((device_types_filter & (device_type)) == 0); // driver_version @@ -15849,7 +15849,7 @@ int main (int argc, char **argv) { size_scrypt = (128 * scrypt_r) * scrypt_N; - size_scrypt /= 1 << tmto; + size_scrypt /= 1u << tmto; size_scrypt *= device_param->device_processors * device_param->kernel_threads * device_param->kernel_accel_max;