]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
trash: Substitute (uint64_t)-1 with UINT64_MAX
authorStephan Bosch <stephan.bosch@open-xchange.com>
Wed, 19 Feb 2025 02:31:48 +0000 (03:31 +0100)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Wed, 26 Feb 2025 10:45:00 +0000 (10:45 +0000)
src/plugins/trash/trash-plugin.c

index 49033abc94f7cf6938571cebe0ec82a76069fa70..aad8667e1f7e097b02a87c1287f26add54682b50 100644 (file)
@@ -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;