code cleanups (shadowed vars, (un)signed type mismatches, format types, etc.)

This commit is contained in:
hexcoder-
2021-01-04 20:40:53 +01:00
parent 5c22472616
commit c6e038fe25
18 changed files with 144 additions and 122 deletions

View File

@ -696,16 +696,16 @@ u8 *stringify_mem_size(u8 *buf, size_t len, u64 val) {
u8 *stringify_time_diff(u8 *buf, size_t len, u64 cur_ms, u64 event_ms) {
u64 delta;
s32 t_d, t_h, t_m, t_s;
u8 val_buf[STRINGIFY_VAL_SIZE_MAX];
if (!event_ms) {
snprintf(buf, len, "none seen yet");
} else {
u64 delta;
s32 t_d, t_h, t_m, t_s;
u8 val_buf[STRINGIFY_VAL_SIZE_MAX];
delta = cur_ms - event_ms;
t_d = delta / 1000 / 60 / 60 / 24;
@ -858,16 +858,16 @@ u8 *u_stringify_mem_size(u8 *buf, u64 val) {
u8 *u_stringify_time_diff(u8 *buf, u64 cur_ms, u64 event_ms) {
u64 delta;
s32 t_d, t_h, t_m, t_s;
u8 val_buf[STRINGIFY_VAL_SIZE_MAX];
if (!event_ms) {
sprintf(buf, "none seen yet");
} else {
u64 delta;
s32 t_d, t_h, t_m, t_s;
u8 val_buf[STRINGIFY_VAL_SIZE_MAX];
delta = cur_ms - event_ms;
t_d = delta / 1000 / 60 / 60 / 24;
@ -895,8 +895,8 @@ u32 get_map_size(void) {
map_size = atoi(ptr);
if (map_size < 8 || map_size > (1 << 29)) {
FATAL("illegal AFL_MAP_SIZE %u, must be between %u and %u", map_size, 8,
1 << 29);
FATAL("illegal AFL_MAP_SIZE %u, must be between %u and %u", map_size, 8U,
1U << 29);
}