From: Stephan Bosch Date: Wed, 19 Feb 2025 02:31:48 +0000 (+0100) Subject: trash: Substitute (uint64_t)-1 with UINT64_MAX X-Git-Tag: 2.4.1~143 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e3cedf3a2f7a5471fd6b75b32b2615932b304873;p=thirdparty%2Fdovecot%2Fcore.git trash: Substitute (uint64_t)-1 with UINT64_MAX --- diff --git a/src/plugins/trash/trash-plugin.c b/src/plugins/trash/trash-plugin.c index 49033abc94..aad8667e1f 100644 --- a/src/plugins/trash/trash-plugin.c +++ b/src/plugins/trash/trash-plugin.c @@ -307,13 +307,13 @@ trash_clean_execute(struct trash_clean *tclean, ctx->count_over = 0; } - if (ctx->bytes_ceil > ((uint64_t)-1 - size_expunged)) { - ctx->bytes_ceil = (uint64_t)-1; + if (ctx->bytes_ceil > (UINT64_MAX - size_expunged)) { + ctx->bytes_ceil = UINT64_MAX; } else { ctx->bytes_ceil += size_expunged; } - if (ctx->count_ceil < ((uint64_t)-1 - expunged_count)) { - ctx->count_ceil = (uint64_t)-1; + if (ctx->count_ceil < (UINT64_MAX - expunged_count)) { + ctx->count_ceil = UINT64_MAX; } else { ctx->count_ceil += expunged_count; } @@ -375,10 +375,10 @@ trash_quota_test_alloc(struct quota_transaction_context *ctx, break; } - if (ctx->bytes_ceil != (uint64_t)-1 && + if (ctx->bytes_ceil != UINT64_MAX && ctx->bytes_ceil < size + ctx->bytes_over) size_needed = size + ctx->bytes_over - ctx->bytes_ceil; - if (ctx->count_ceil != (uint64_t)-1 && + if (ctx->count_ceil != UINT64_MAX && ctx->count_ceil < 1 + ctx->count_over) count_needed = 1 + ctx->count_over - ctx->count_ceil;