diff --git a/src/autotune.c b/src/autotune.c index 42f2b13de..24aa16979 100644 --- a/src/autotune.c +++ b/src/autotune.c @@ -244,7 +244,7 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param { for (int i = 0; i < STEPS_CNT; i++) { - const u32 kernel_accel_try = 1u << i; + const u32 kernel_accel_try = 1U << i; if (kernel_accel_try < kernel_accel_min) continue; if (kernel_accel_try > kernel_accel_max) break; @@ -269,8 +269,8 @@ static int autotune (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param for (int i = 1; i < STEPS_CNT; i++) { - const u32 kernel_accel_try = kernel_accel_orig * (1u << i); - const u32 kernel_loops_try = kernel_loops_orig / (1u << i); + const u32 kernel_accel_try = kernel_accel_orig * (1U << i); + const u32 kernel_loops_try = kernel_loops_orig / (1U << i); if (kernel_accel_try < kernel_accel_min) continue; if (kernel_accel_try > kernel_accel_max) break; diff --git a/src/backend.c b/src/backend.c index 2f3c2523c..d6b15d891 100644 --- a/src/backend.c +++ b/src/backend.c @@ -259,7 +259,7 @@ static bool setup_opencl_device_types_filter (hashcat_ctx_t *hashcat_ctx, const return false; } - opencl_device_types_filter |= 1u << device_type; + opencl_device_types_filter |= 1U << device_type; } while ((next = strtok_r (NULL, ",", &saveptr)) != NULL); @@ -7671,10 +7671,10 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx) if (user_options->benchmark == true) { - ((u32 *) hashes->digests_buf)[0] = -1u; - ((u32 *) hashes->digests_buf)[1] = -1u; - ((u32 *) hashes->digests_buf)[2] = -1u; - ((u32 *) hashes->digests_buf)[3] = -1u; + ((u32 *) hashes->digests_buf)[0] = -1U; + ((u32 *) hashes->digests_buf)[1] = -1U; + ((u32 *) hashes->digests_buf)[2] = -1U; + ((u32 *) hashes->digests_buf)[3] = -1U; } /** @@ -9271,12 +9271,12 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx) // this value should represent a reasonable amount of memory a host system has per GPU. // note we're allocating 3 blocks of that size. - const u64 PWS_SPACE = 1024ull * 1024ull * 1024ull; + const u64 PWS_SPACE = 1024ULL * 1024ULL * 1024ULL; // sometimes device_available_mem and device_maxmem_alloc reported back from the opencl runtime are a bit inaccurate. // let's add some extra space just to be sure. - const u64 EXTRA_SPACE = 64ull * 1024ull * 1024ull; + const u64 EXTRA_SPACE = 64ULL * 1024ULL * 1024ULL; while (kernel_accel_max >= kernel_accel_min) { diff --git a/src/bitmap.c b/src/bitmap.c index 6b1da1362..d2184acf0 100644 --- a/src/bitmap.c +++ b/src/bitmap.c @@ -13,10 +13,10 @@ static void selftest_to_bitmap (const u32 dgst_shifts, char *digests_buf_ptr, co { u32 *digest_ptr = (u32 *) digests_buf_ptr; - const u32 val0 = 1u << (digest_ptr[dgst_pos0] & 0x1f); - const u32 val1 = 1u << (digest_ptr[dgst_pos1] & 0x1f); - const u32 val2 = 1u << (digest_ptr[dgst_pos2] & 0x1f); - const u32 val3 = 1u << (digest_ptr[dgst_pos3] & 0x1f); + const u32 val0 = 1U << (digest_ptr[dgst_pos0] & 0x1f); + const u32 val1 = 1U << (digest_ptr[dgst_pos1] & 0x1f); + const u32 val2 = 1U << (digest_ptr[dgst_pos2] & 0x1f); + const u32 val3 = 1U << (digest_ptr[dgst_pos3] & 0x1f); const u32 idx0 = (digest_ptr[dgst_pos0] >> dgst_shifts) & bitmap_mask; const u32 idx1 = (digest_ptr[dgst_pos1] >> dgst_shifts) & bitmap_mask; @@ -44,10 +44,10 @@ static bool generate_bitmaps (const u32 digests_cnt, const u32 dgst_size, const digests_buf_ptr += dgst_size; - const u32 val0 = 1u << (digest_ptr[dgst_pos0] & 0x1f); - const u32 val1 = 1u << (digest_ptr[dgst_pos1] & 0x1f); - const u32 val2 = 1u << (digest_ptr[dgst_pos2] & 0x1f); - const u32 val3 = 1u << (digest_ptr[dgst_pos3] & 0x1f); + const u32 val0 = 1U << (digest_ptr[dgst_pos0] & 0x1f); + const u32 val1 = 1U << (digest_ptr[dgst_pos1] & 0x1f); + const u32 val2 = 1U << (digest_ptr[dgst_pos2] & 0x1f); + const u32 val3 = 1U << (digest_ptr[dgst_pos3] & 0x1f); const u32 idx0 = (digest_ptr[dgst_pos0] >> dgst_shifts) & bitmap_mask; const u32 idx1 = (digest_ptr[dgst_pos1] >> dgst_shifts) & bitmap_mask; @@ -99,14 +99,14 @@ int bitmap_ctx_init (hashcat_ctx_t *hashcat_ctx) const u32 bitmap_min = user_options->bitmap_min; const u32 bitmap_max = user_options->bitmap_max; - u32 *bitmap_s1_a = (u32 *) hcmalloc ((1u << bitmap_max) * sizeof (u32)); - u32 *bitmap_s1_b = (u32 *) hcmalloc ((1u << bitmap_max) * sizeof (u32)); - u32 *bitmap_s1_c = (u32 *) hcmalloc ((1u << bitmap_max) * sizeof (u32)); - u32 *bitmap_s1_d = (u32 *) hcmalloc ((1u << bitmap_max) * sizeof (u32)); - u32 *bitmap_s2_a = (u32 *) hcmalloc ((1u << bitmap_max) * sizeof (u32)); - u32 *bitmap_s2_b = (u32 *) hcmalloc ((1u << bitmap_max) * sizeof (u32)); - u32 *bitmap_s2_c = (u32 *) hcmalloc ((1u << bitmap_max) * sizeof (u32)); - u32 *bitmap_s2_d = (u32 *) hcmalloc ((1u << bitmap_max) * sizeof (u32)); + u32 *bitmap_s1_a = (u32 *) hcmalloc ((1U << bitmap_max) * sizeof (u32)); + u32 *bitmap_s1_b = (u32 *) hcmalloc ((1U << bitmap_max) * sizeof (u32)); + u32 *bitmap_s1_c = (u32 *) hcmalloc ((1U << bitmap_max) * sizeof (u32)); + u32 *bitmap_s1_d = (u32 *) hcmalloc ((1U << bitmap_max) * sizeof (u32)); + u32 *bitmap_s2_a = (u32 *) hcmalloc ((1U << bitmap_max) * sizeof (u32)); + u32 *bitmap_s2_b = (u32 *) hcmalloc ((1U << bitmap_max) * sizeof (u32)); + u32 *bitmap_s2_c = (u32 *) hcmalloc ((1U << bitmap_max) * sizeof (u32)); + u32 *bitmap_s2_d = (u32 *) hcmalloc ((1U << bitmap_max) * sizeof (u32)); u32 bitmap_bits; u32 bitmap_nums; @@ -115,7 +115,7 @@ int bitmap_ctx_init (hashcat_ctx_t *hashcat_ctx) for (bitmap_bits = bitmap_min; bitmap_bits < bitmap_max; bitmap_bits++) { - bitmap_nums = 1u << bitmap_bits; + bitmap_nums = 1U << bitmap_bits; bitmap_mask = bitmap_nums - 1; @@ -134,7 +134,7 @@ int bitmap_ctx_init (hashcat_ctx_t *hashcat_ctx) EVENT_DATA (EVENT_BITMAP_FINAL_OVERFLOW, NULL, 0); } - bitmap_nums = 1u << bitmap_bits; + bitmap_nums = 1U << bitmap_bits; bitmap_mask = bitmap_nums - 1; diff --git a/src/cpu_crc32.c b/src/cpu_crc32.c index e2d0d75d4..f7e9accff 100644 --- a/src/cpu_crc32.c +++ b/src/cpu_crc32.c @@ -78,7 +78,7 @@ static const u32 crc32tab[256] = u32 cpu_crc32_buffer (const u8 *buf, const size_t length) { - u32 crc = ~0u; + u32 crc = ~0U; for (size_t pos = 0; pos < length; pos++) { @@ -90,7 +90,7 @@ u32 cpu_crc32_buffer (const u8 *buf, const size_t length) int cpu_crc32 (const char *filename, u8 keytab[64]) { - u32 crc = ~0u; + u32 crc = ~0U; HCFILE fp; diff --git a/src/dispatch.c b/src/dispatch.c index d64dd07ae..9574361a7 100644 --- a/src/dispatch.c +++ b/src/dispatch.c @@ -1362,7 +1362,7 @@ static int calc (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param) { u64 words_off = 0; u64 words_fin = 0; - u64 words_extra = -1u; + u64 words_extra = -1U; u64 words_extra_total = 0; memset (device_param->pws_comp, 0, device_param->size_pws_comp); diff --git a/src/hwmon.c b/src/hwmon.c index 512f60b61..905ce6e61 100644 --- a/src/hwmon.c +++ b/src/hwmon.c @@ -176,7 +176,7 @@ static int hm_SYSFS_get_fan_speed_current (hashcat_ctx_t *hashcat_ctx, const int return -1; } - const float p1 = (float) pwm1_max / 100.0f; + const float p1 = (float) pwm1_max / 100.0F; const float pwm1_percent = (float) pwm1_cur / p1; @@ -821,14 +821,14 @@ static int nvapi_init (hashcat_ctx_t *hashcat_ctx) } HC_LOAD_FUNC(nvapi, nvapi_QueryInterface, NVAPI_QUERYINTERFACE, NVAPI, 0) - HC_LOAD_ADDR(nvapi, NvAPI_Initialize, NVAPI_INITIALIZE, nvapi_QueryInterface, 0x0150E828u, NVAPI, 0) - HC_LOAD_ADDR(nvapi, NvAPI_Unload, NVAPI_UNLOAD, nvapi_QueryInterface, 0xD22BDD7Eu, NVAPI, 0) - HC_LOAD_ADDR(nvapi, NvAPI_GetErrorMessage, NVAPI_GETERRORMESSAGE, nvapi_QueryInterface, 0x6C2D048Cu, NVAPI, 0) - HC_LOAD_ADDR(nvapi, NvAPI_EnumPhysicalGPUs, NVAPI_ENUMPHYSICALGPUS, nvapi_QueryInterface, 0xE5AC921Fu, NVAPI, 0) - HC_LOAD_ADDR(nvapi, NvAPI_GPU_GetPerfPoliciesInfo, NVAPI_GPU_GETPERFPOLICIESINFO, nvapi_QueryInterface, 0x409D9841u, NVAPI, 0) - HC_LOAD_ADDR(nvapi, NvAPI_GPU_GetPerfPoliciesStatus, NVAPI_GPU_GETPERFPOLICIESSTATUS, nvapi_QueryInterface, 0x3D358A0Cu, NVAPI, 0) - HC_LOAD_ADDR(nvapi, NvAPI_GPU_GetBusId, NVAPI_GPU_GETBUSID, nvapi_QueryInterface, 0x1BE0B8E5u, NVAPI, 0) - HC_LOAD_ADDR(nvapi, NvAPI_GPU_GetBusSlotId, NVAPI_GPU_GETBUSSLOTID, nvapi_QueryInterface, 0x2A0A350Fu, NVAPI, 0) + HC_LOAD_ADDR(nvapi, NvAPI_Initialize, NVAPI_INITIALIZE, nvapi_QueryInterface, 0x0150E828U, NVAPI, 0) + HC_LOAD_ADDR(nvapi, NvAPI_Unload, NVAPI_UNLOAD, nvapi_QueryInterface, 0xD22BDD7EU, NVAPI, 0) + HC_LOAD_ADDR(nvapi, NvAPI_GetErrorMessage, NVAPI_GETERRORMESSAGE, nvapi_QueryInterface, 0x6C2D048CU, NVAPI, 0) + HC_LOAD_ADDR(nvapi, NvAPI_EnumPhysicalGPUs, NVAPI_ENUMPHYSICALGPUS, nvapi_QueryInterface, 0xE5AC921FU, NVAPI, 0) + HC_LOAD_ADDR(nvapi, NvAPI_GPU_GetPerfPoliciesInfo, NVAPI_GPU_GETPERFPOLICIESINFO, nvapi_QueryInterface, 0x409D9841U, NVAPI, 0) + HC_LOAD_ADDR(nvapi, NvAPI_GPU_GetPerfPoliciesStatus, NVAPI_GPU_GETPERFPOLICIESSTATUS, nvapi_QueryInterface, 0x3D358A0CU, NVAPI, 0) + HC_LOAD_ADDR(nvapi, NvAPI_GPU_GetBusId, NVAPI_GPU_GETBUSID, nvapi_QueryInterface, 0x1BE0B8E5U, NVAPI, 0) + HC_LOAD_ADDR(nvapi, NvAPI_GPU_GetBusSlotId, NVAPI_GPU_GETBUSSLOTID, nvapi_QueryInterface, 0x2A0A350FU, NVAPI, 0) return 0; } diff --git a/src/main.c b/src/main.c index a5123d57b..d7d1f14bf 100644 --- a/src/main.c +++ b/src/main.c @@ -476,7 +476,7 @@ static void main_outerloop_mainscreen (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, for (u32 i = 0; i < 32; i++) { - const u32 opti_bit = 1u << i; + const u32 opti_bit = 1U << i; if (hashconfig->opti_type & opti_bit) event_log_info (hashcat_ctx, "* %s", stroptitype (opti_bit)); }