mirror of
https://github.com/hashcat/hashcat.git
synced 2025-01-23 06:01:06 +00:00
Fix a few float conversion errors
This commit is contained in:
parent
cb6e2107b6
commit
bd780a3729
@ -457,7 +457,7 @@ int base32_encode (u8 (*f) (const u8), const u8 *in_buf, int in_len, u8 *out_buf
|
||||
out_ptr += 8;
|
||||
}
|
||||
|
||||
int out_len = (int) (((0.5f + (double) in_len) * 8) / 5); // ceil (in_len * 8 / 5)
|
||||
int out_len = (int) (((0.5 + in_len) * 8) / 5); // ceil (in_len * 8 / 5)
|
||||
|
||||
while (out_len % 8)
|
||||
{
|
||||
@ -524,7 +524,7 @@ int base64_encode (u8 (*f) (const u8), const u8 *in_buf, int in_len, u8 *out_buf
|
||||
out_ptr += 4;
|
||||
}
|
||||
|
||||
int out_len = (int) (((0.5f + (double) in_len) * 8) / 6); // ceil (in_len * 8 / 6)
|
||||
int out_len = (int) (((0.5 + in_len) * 8) / 6); // ceil (in_len * 8 / 6)
|
||||
|
||||
while (out_len % 4)
|
||||
{
|
||||
|
@ -208,7 +208,7 @@ static int hm_SYSFS_set_fan_speed_target (hashcat_ctx_t *hashcat_ctx, const int
|
||||
return -1;
|
||||
}
|
||||
|
||||
val = (float) val * 2.55f; // should be pwm1_max
|
||||
val = (int) (val * 2.55f); // should be pwm1_max
|
||||
|
||||
fprintf (fd, "%d", val);
|
||||
|
||||
|
@ -720,11 +720,11 @@ static void main_hashlist_parse_hash (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, M
|
||||
|
||||
if (hashes_cnt < hashes_avail)
|
||||
{
|
||||
event_log_info_nn (hashcat_ctx, "Parsing Hashes: %u/%u (%0.2f%%)...", hashes_cnt, hashes_avail, ((double) hashes_cnt / hashes_avail) * 100.0f);
|
||||
event_log_info_nn (hashcat_ctx, "Parsing Hashes: %u/%u (%0.2f%%)...", hashes_cnt, hashes_avail, ((double) hashes_cnt / hashes_avail) * 100.0);
|
||||
}
|
||||
else
|
||||
{
|
||||
event_log_info_nn (hashcat_ctx, "Parsed Hashes: %u/%u (%0.2f%%)", hashes_cnt, hashes_avail, 100.0f);
|
||||
event_log_info_nn (hashcat_ctx, "Parsed Hashes: %u/%u (%0.2f%%)", hashes_cnt, hashes_avail, 100.0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -193,9 +193,9 @@ static int monitor (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
last_temp_check_time = temp_check_time;
|
||||
|
||||
float Kp = 1.8;
|
||||
float Ki = 0.005;
|
||||
float Kd = 6;
|
||||
float Kp = 1.8f;
|
||||
float Ki = 0.005f;
|
||||
float Kd = 6.0f;
|
||||
|
||||
// PID controller (3-term controller: proportional - Kp, integral - Ki, derivative - Kd)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user