From 755f815a77bf473977e7cdbcd5d56919de519268 Mon Sep 17 00:00:00 2001 From: Herman Semenov Date: Thu, 4 Jul 2024 12:25:25 -0500 Subject: [PATCH] Reduced structure sizes for optimize, more correct memsize types for vars --- include/types.h | 4 ++-- src/brain.c | 4 ++-- src/mpsp.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/types.h b/include/types.h index e6ea946f9..2151ca9f9 100644 --- a/include/types.h +++ b/include/types.h @@ -1113,7 +1113,7 @@ typedef struct link_speed { hc_timer_t timer[LINK_SPEED_COUNT]; ssize_t bytes[LINK_SPEED_COUNT]; - int pos; + u16 pos; } link_speed_t; @@ -2107,7 +2107,7 @@ typedef struct loopback_ctx typedef struct mf { char mf_buf[0x400]; - int mf_len; + u16 mf_len; } mf_t; diff --git a/src/brain.c b/src/brain.c index fbb1f206a..5fd7752f2 100644 --- a/src/brain.c +++ b/src/brain.c @@ -2929,9 +2929,9 @@ HC_API_CALL void *brain_server_handle_client (void *p) // opportunity to set counters for stats - int local_lookup_new = 0; + u64 local_lookup_new = 0; - for (i64 hashes_idx = 0; hashes_idx < hashes_cnt; hashes_idx++) + for (u64 hashes_idx = 0; hashes_idx < hashes_cnt; hashes_idx++) { if (send_buf[hashes_idx] == 0) { diff --git a/src/mpsp.c b/src/mpsp.c index 3efe345d7..c7705be0d 100644 --- a/src/mpsp.c +++ b/src/mpsp.c @@ -1151,7 +1151,7 @@ u32 mp_get_length (const char *mask, const u32 opts_type) { bool ignore_next = false; - u32 len = 0; + size_t len = 0; const size_t mask_len = strlen (mask);