]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
global: Use UOFF_T_MAX instead of (uoff_t)-1
authorAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 23 Sep 2020 11:51:53 +0000 (14:51 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Thu, 22 Oct 2020 12:16:16 +0000 (12:16 +0000)
117 files changed:
src/anvil/anvil-settings.c
src/auth/auth-settings.c
src/config/config-settings.c
src/dict/dict-settings.c
src/director/director-settings.c
src/dns/dns-client-settings.c
src/doveadm/doveadm-settings.c
src/doveadm/dsync/dsync-mail.h
src/doveadm/dsync/dsync-mailbox-export.c
src/doveadm/dsync/dsync-mailbox-import.c
src/doveadm/dsync/dsync-transaction-log-scan.c
src/imap-hibernate/imap-hibernate-settings.c
src/imap-login/imap-login-settings.c
src/imap-urlauth/imap-urlauth-login-settings.c
src/imap-urlauth/imap-urlauth-settings.c
src/imap-urlauth/imap-urlauth-worker-settings.c
src/imap/cmd-append.c
src/imap/imap-fetch-body.c
src/imap/imap-settings.c
src/indexer/indexer-settings.c
src/indexer/indexer-worker-settings.c
src/ipc/ipc-settings.c
src/lda/main.c
src/lib-compression/istream-bzlib.c
src/lib-compression/istream-lzma.c
src/lib-compression/istream-zlib.c
src/lib-fs/fs-api.c
src/lib-fs/fs-metawrap.c
src/lib-fs/fs-posix.c
src/lib-http/http-client-connection.c
src/lib-http/http-header-parser.c
src/lib-http/http-response-parser.c
src/lib-http/http-server-request.c
src/lib-http/test-http-payload.c
src/lib-imap-storage/imap-msgpart-url.c
src/lib-imap-storage/imap-msgpart.c
src/lib-imap-storage/imap-msgpart.h
src/lib-index/mail-index-map-hdr.c
src/lib-index/mail-index-map-read.c
src/lib-index/mail-index-sync-update.c
src/lib-index/mail-index-sync.c
src/lib-index/mail-index-view-sync.c
src/lib-index/mail-transaction-log-file.c
src/lib-index/mail-transaction-log-private.h
src/lib-index/mail-transaction-log-view.c
src/lib-index/mail-transaction-log.c
src/lib-index/test-mail-transaction-log-view.c
src/lib-mail/istream-attachment-connector.c
src/lib-mail/istream-attachment-connector.h
src/lib-mail/istream-header-filter.c
src/lib-mail/test-istream-attachment.c
src/lib-settings/settings-parser.c
src/lib-smtp/smtp-command-parser.c
src/lib-smtp/smtp-server-connection.c
src/lib-smtp/smtp-server-reply.c
src/lib-smtp/test-smtp-payload.c
src/lib-storage/index/dbox-common/dbox-file-fix.c
src/lib-storage/index/dbox-common/dbox-file.c
src/lib-storage/index/dbox-common/dbox-mail.c
src/lib-storage/index/dbox-multi/mdbox-file.c
src/lib-storage/index/imapc/imapc-mail-fetch.c
src/lib-storage/index/imapc/imapc-mail.c
src/lib-storage/index/index-mail-binary.c
src/lib-storage/index/index-mail.c
src/lib-storage/index/istream-mail.c
src/lib-storage/index/maildir/maildir-copy.c
src/lib-storage/index/maildir/maildir-mail.c
src/lib-storage/index/maildir/maildir-save.c
src/lib-storage/index/maildir/maildir-uidlist.c
src/lib-storage/index/mbox/istream-raw-mbox.c
src/lib-storage/index/mbox/istream-raw-mbox.h
src/lib-storage/index/mbox/mbox-mail.c
src/lib-storage/index/mbox/mbox-save.c
src/lib-storage/index/mbox/mbox-sync-parse.c
src/lib-storage/index/mbox/mbox-sync-rewrite.c
src/lib-storage/index/mbox/mbox-sync-update.c
src/lib-storage/index/mbox/mbox-sync.c
src/lib-storage/index/pop3c/pop3c-mail.c
src/lib-storage/index/raw/raw-mail.c
src/lib-storage/index/raw/raw-storage.c
src/lib/file-cache.c
src/lib/istream-concat.c
src/lib/istream-failure-at.c
src/lib/istream-limit.c
src/lib/istream-private.h
src/lib/istream-seekable.c
src/lib/istream-tee.c
src/lib/istream.c
src/lib/ostream-file.c
src/lib/ostream.h
src/lib/strnum.c
src/lib/test-iostream-temp.c
src/lib/test-istream-concat.c
src/lib/test-istream-sized.c
src/lib/test-istream.c
src/lmtp/lmtp-client.c
src/lmtp/lmtp-proxy.c
src/lmtp/lmtp-settings.c
src/log/log-settings.c
src/master/master-settings.c
src/master/service.c
src/old-stats/stats-settings.c
src/plugins/fts-squat/squat-uidlist.c
src/plugins/mail-crypt/mail-crypt-plugin.c
src/plugins/pop3-migration/pop3-migration-plugin.c
src/plugins/quota/quota-maildir.c
src/plugins/zlib/zlib-plugin.c
src/pop3-login/pop3-login-settings.c
src/pop3/pop3-commands.c
src/pop3/pop3-settings.c
src/replication/aggregator/aggregator-settings.c
src/replication/replicator/replicator-settings.c
src/stats/stats-settings.c
src/submission-login/submission-login-settings.c
src/submission/submission-settings.c
src/util/health-check-settings.c
src/util/tcpwrap-settings.c

index 81707afcdc107f01f30a614c1990698902893b78..a6cac93a5df8c863f993cf57b9122394c0ae378c 100644 (file)
@@ -39,7 +39,7 @@ struct service_settings anvil_service_settings = {
        .client_limit = 0,
        .service_count = 0,
        .idle_kill = UINT_MAX,
-       .vsz_limit = (uoff_t)-1,
+       .vsz_limit = UOFF_T_MAX,
 
        .unix_listeners = { { &anvil_unix_listeners_buf,
                              sizeof(anvil_unix_listeners[0]) } },
index 80f73d55c45be346a1db5968de5f4b7eff71eac7..1cb91e46c3692aa8f8beee8a6dbe1c1f7283dc60 100644 (file)
@@ -55,7 +55,7 @@ struct service_settings auth_service_settings = {
        .client_limit = 0,
        .service_count = 0,
        .idle_kill = 0,
-       .vsz_limit = (uoff_t)-1,
+       .vsz_limit = UOFF_T_MAX,
 
        .unix_listeners = { { &auth_unix_listeners_buf,
                              sizeof(auth_unix_listeners[0]) } },
@@ -95,7 +95,7 @@ struct service_settings auth_worker_service_settings = {
        .client_limit = 1,
        .service_count = 1,
        .idle_kill = 0,
-       .vsz_limit = (uoff_t)-1,
+       .vsz_limit = UOFF_T_MAX,
 
        .unix_listeners = { { &auth_worker_unix_listeners_buf,
                              sizeof(auth_worker_unix_listeners[0]) } },
index fd92cf2e22f3b4c30e0b122df01d5f18cf9a26dc..2b1fe9e8b26ed55d2474e7dfea4a2ed28fa2c949 100644 (file)
@@ -37,7 +37,7 @@ struct service_settings config_service_settings = {
        .client_limit = 0,
        .service_count = 0,
        .idle_kill = UINT_MAX,
-       .vsz_limit = (uoff_t)-1,
+       .vsz_limit = UOFF_T_MAX,
 
        .unix_listeners = { { &config_unix_listeners_buf,
                              sizeof(config_unix_listeners[0]) } },
index bd4092ad963d9c39c029e3b9e0ed91663c295614..6b5da71c00657bb21e8f30e4b40147d1cd2df5d7 100644 (file)
@@ -46,7 +46,7 @@ struct service_settings dict_service_settings = {
        .client_limit = 1,
        .service_count = 0,
        .idle_kill = 0,
-       .vsz_limit = (uoff_t)-1,
+       .vsz_limit = UOFF_T_MAX,
 
        .unix_listeners = { { &dict_unix_listeners_buf,
                              sizeof(dict_unix_listeners[0]) } },
@@ -72,7 +72,7 @@ struct service_settings dict_async_service_settings = {
        .client_limit = 0,
        .service_count = 0,
        .idle_kill = 0,
-       .vsz_limit = (uoff_t)-1,
+       .vsz_limit = UOFF_T_MAX,
 
        .unix_listeners = { { &dict_async_unix_listeners_buf,
                              sizeof(dict_async_unix_listeners[0]) } },
index db35d0df15dae3f2f2ece344e016546305b3edd1..96d2d0f39a74a63a621c4380cb94c9ff03a943e0 100644 (file)
@@ -51,7 +51,7 @@ struct service_settings director_service_settings = {
        .client_limit = 0,
        .service_count = 0,
        .idle_kill = UINT_MAX,
-       .vsz_limit = (uoff_t)-1,
+       .vsz_limit = UOFF_T_MAX,
 
        .unix_listeners = { { &director_unix_listeners_buf,
                              sizeof(director_unix_listeners[0]) } },
index 2bbcc15d7f0772168cb2079642e1ec2be7736d9b..1fd36f0666ad6f1fa7170bb8a9e0a8853c8f9281 100644 (file)
@@ -39,7 +39,7 @@ struct service_settings dns_client_service_settings = {
        .client_limit = 1,
        .service_count = 0,
        .idle_kill = 0,
-       .vsz_limit = (uoff_t)-1,
+       .vsz_limit = UOFF_T_MAX,
 
        .unix_listeners = { { &dns_client_unix_listeners_buf,
                              sizeof(dns_client_unix_listeners[0]) } },
index 33afd02ebb2560f92e347f0865e5dd190a06a066..04789cd2b9fc4c28e6bd8624d9bdbb8d805d4bf6 100644 (file)
@@ -43,7 +43,7 @@ struct service_settings doveadm_service_settings = {
        .client_limit = 1,
        .service_count = 1,
        .idle_kill = 0,
-       .vsz_limit = (uoff_t)-1,
+       .vsz_limit = UOFF_T_MAX,
 
        .unix_listeners = { { &doveadm_unix_listeners_buf,
                              sizeof(doveadm_unix_listeners[0]) } },
index 9d577f2961fcb9de2e5b1b8d65a73ff35fd0062d..fc0005915b48b98ea9f6d587681fefa2a76d491a 100644 (file)
@@ -82,7 +82,7 @@ struct dsync_mail_change {
        /* Received timestamp for saves, if brain.sync_since/until_timestamp is set */
        time_t received_timestamp;
        /* Mail's size for saves if brain.sync_max_size is set,
-          (uoff_t)-1 otherwise. */
+          UOFF_T_MAX otherwise. */
        uoff_t virtual_size;
 };
 
index 0994fd0b06d149958ab36b451a30773a807120e0..a58fbec1b5f8edae5739b651ecfb3b29e8dc3d0e 100644 (file)
@@ -288,7 +288,7 @@ search_add_save(struct dsync_mailbox_exporter *exporter, struct mail *mail)
        const char *guid, *hdr_hash;
        enum mail_fetch_field wanted_fields = MAIL_FETCH_GUID;
        time_t received_timestamp = 0;
-       uoff_t virtual_size = (uoff_t)-1;
+       uoff_t virtual_size = UOFF_T_MAX;
        int ret;
 
        /* update wanted fields in case we didn't already set them for the
@@ -316,7 +316,7 @@ search_add_save(struct dsync_mailbox_exporter *exporter, struct mail *mail)
        if (exporter->export_virtual_sizes) {
                if (mail_get_virtual_size(mail, &virtual_size) < 0)
                        return dsync_mail_error(exporter, mail, "virtual-size");
-               i_assert(virtual_size != (uoff_t)-1);
+               i_assert(virtual_size != UOFF_T_MAX);
        }
 
        change = export_save_change_get(exporter, mail->uid);
index 98f54edb350fdc6e0e433fb5b9183d9a8a22f911..fdc699ce53d22a87efa4ea90d8043a6564b509ea 100644 (file)
@@ -1377,7 +1377,7 @@ dsync_mailbox_import_want_change(struct dsync_mailbox_importer *importer,
                }
        }
        if (importer->sync_max_size > 0) {
-               i_assert(change->virtual_size != (uoff_t)-1);
+               i_assert(change->virtual_size != UOFF_T_MAX);
                if (change->virtual_size < importer->sync_max_size) {
                        /* mail is too large - skip it */
                        *result_r = "Ignoring missing local mail with too large size";
@@ -1674,7 +1674,7 @@ dsync_mailbox_find_common_uid(struct dsync_mailbox_importer *importer,
                 ((change->received_timestamp > 0 ||
                   (importer->sync_since_timestamp == 0 &&
                    importer->sync_until_timestamp == 0)) &&
-                 (change->virtual_size != (uoff_t)-1 || importer->sync_max_size == 0)));
+                 (change->virtual_size != UOFF_T_MAX || importer->sync_max_size == 0)));
 
        /* try to find the matching local mail */
        if (!importer_next_mail(importer, change->uid)) {
index 88a23a436ce280e742d8efd3cb0ffc185c3e7c81..fb6b5ec562a4b7d8d3ead7ca61840096229dc543 100644 (file)
@@ -574,7 +574,7 @@ dsync_transaction_log_scan_find_new_expunge(struct dsync_transaction_log_scan *s
        if (mail_transaction_log_view_set(log_view,
                                          scan->last_log_seq,
                                          scan->last_log_offset,
-                                         (uint32_t)-1, (uoff_t)-1,
+                                         (uint32_t)-1, UOFF_T_MAX,
                                          &reset, &reason) > 0) {
                while (!found &&
                       mail_transaction_log_view_next(log_view, &hdr, &data) > 0) {
index 29847de28af3adf2b1e1246f7571b16e7b688b10..368364871b8cb0a6b1b03fecbff787799f4e23b5 100644 (file)
@@ -38,7 +38,7 @@ struct service_settings imap_hibernate_service_settings = {
        .client_limit = 0,
        .service_count = 0,
        .idle_kill = 0,
-       .vsz_limit = (uoff_t)-1,
+       .vsz_limit = UOFF_T_MAX,
 
        .unix_listeners = { { &imap_hibernate_unix_listeners_buf,
                              sizeof(imap_hibernate_unix_listeners[0]) } },
index b88230b6c572e90e1cd0256e132182bb46a23b87..73d7320e950633a4aec634aa9f7964b70b08ca45 100644 (file)
@@ -41,7 +41,7 @@ struct service_settings imap_login_service_settings = {
        .client_limit = 0,
        .service_count = 1,
        .idle_kill = 0,
-       .vsz_limit = (uoff_t)-1,
+       .vsz_limit = UOFF_T_MAX,
 
        .unix_listeners = ARRAY_INIT,
        .fifo_listeners = ARRAY_INIT,
index 829e2a4133655fda1523626cb2948658e56c9df2..e3e700cbc98a30c54ccd6b8731423e1df6f6a772 100644 (file)
@@ -41,7 +41,7 @@ struct service_settings imap_urlauth_login_service_settings = {
        .client_limit = 0,
        .service_count = 1,
        .idle_kill = 0,
-       .vsz_limit = (uoff_t)-1,
+       .vsz_limit = UOFF_T_MAX,
 
        .unix_listeners = { { &imap_urlauth_login_unix_listeners_buf,
                              sizeof(imap_urlauth_login_unix_listeners[0]) } },
index 10fd84cffcf050ac95f5bce1c3cfa5da1334dbdf..7d19da03729f8f35e6d8515406aaebbf30773197 100644 (file)
@@ -39,7 +39,7 @@ struct service_settings imap_urlauth_service_settings = {
        .client_limit = 1,
        .service_count = 1,
        .idle_kill = 0,
-       .vsz_limit = (uoff_t)-1,
+       .vsz_limit = UOFF_T_MAX,
 
        .unix_listeners = { { &imap_urlauth_unix_listeners_buf,
                              sizeof(imap_urlauth_unix_listeners[0]) } },
index b666395e97a7e2bfb4163ff333994df2706e364c..fd5efc264a9acb646de7129cbac3cc5b70abd1d0 100644 (file)
@@ -40,7 +40,7 @@ struct service_settings imap_urlauth_worker_service_settings = {
        .client_limit = 1,
        .service_count = 1,
        .idle_kill = 0,
-       .vsz_limit = (uoff_t)-1,
+       .vsz_limit = UOFF_T_MAX,
 
        .unix_listeners = { { &imap_urlauth_worker_unix_listeners_buf,
                              sizeof(imap_urlauth_worker_unix_listeners[0]) } },
index 9b9afd4ddfafe4f526a8795960cfa980c5f4e3f1..c7b5435b0b80bb7c4a4f19eec77917439740897f 100644 (file)
@@ -261,7 +261,7 @@ static void cmd_append_catenate_text(struct client_command_context *cmd)
 {
        struct cmd_append_context *ctx = cmd->context;
 
-       if (ctx->literal_size > (uoff_t)-1 - ctx->cat_msg_size &&
+       if (ctx->literal_size > UOFF_T_MAX - ctx->cat_msg_size &&
            !ctx->failed) {
                client_send_tagline(cmd,
                        "NO [TOOBIG] Composed message grows too big.");
index 912c8a3cbdea82f0f26501e0d68818fc62f697e7..cd13f15781a8a75ae5ec8e69aa2bd688334b6bb7 100644 (file)
@@ -78,7 +78,7 @@ static string_t *get_prefix(struct imap_fetch_state *state,
 
        str_append(str, get_body_name(body));
 
-       if (size == (uoff_t)-1)
+       if (size == UOFF_T_MAX)
                str_append(str, " NIL");
        else if (has_nuls && body->binary)
                str_printfa(str, " ~{%"PRIuUOFF_T"}\r\n", size);
@@ -149,9 +149,9 @@ get_body_human_name(pool_t pool, struct imap_fetch_body_data *body)
 
        partial_offset = imap_msgpart_get_partial_offset(body->msgpart);
        partial_size = imap_msgpart_get_partial_size(body->msgpart);
-       if (partial_offset != 0 || partial_size != (uoff_t)-1) {
+       if (partial_offset != 0 || partial_size != UOFF_T_MAX) {
                str_printfa(str, "<%"PRIuUOFF_T, partial_offset);
-               if (partial_size != (uoff_t)-1)
+               if (partial_size != UOFF_T_MAX)
                        str_printfa(str, ".%"PRIuUOFF_T, partial_size);
                str_append_c(str, '>');
        }
@@ -268,7 +268,7 @@ body_header_fields_parse(struct imap_fetch_init_context *ctx,
 static int body_parse_partial(struct imap_fetch_body_data *body,
                              const char *p, const char **error_r)
 {
-       uoff_t offset, size = (uoff_t)-1;
+       uoff_t offset, size = UOFF_T_MAX;
 
        if (*p == '\0')
                return 0;
index 248a12989d7e7da2688fec2da3ae750eee425d0d..12d12422387816cbb85f23aa457cfc0237fa5102 100644 (file)
@@ -47,7 +47,7 @@ struct service_settings imap_service_settings = {
        .client_limit = 1,
        .service_count = 1,
        .idle_kill = 0,
-       .vsz_limit = (uoff_t)-1,
+       .vsz_limit = UOFF_T_MAX,
 
        .unix_listeners = { { &imap_unix_listeners_buf,
                              sizeof(imap_unix_listeners[0]) } },
index 2a81c0b093cec2f756a78c91326db5539c1ef2dc..3363f72f01b9a176e92192eb1a7a8ff7441fe490 100644 (file)
@@ -39,7 +39,7 @@ struct service_settings indexer_service_settings = {
        .client_limit = 0,
        .service_count = 0,
        .idle_kill = 0,
-       .vsz_limit = (uoff_t)-1,
+       .vsz_limit = UOFF_T_MAX,
 
        .unix_listeners = { { &indexer_unix_listeners_buf,
                              sizeof(indexer_unix_listeners[0]) } },
index 38cfeed8c8366ecef55d2d1db2fe039cf08b15a7..880cbf698b9fea8892be2157db77f3168451709a 100644 (file)
@@ -37,7 +37,7 @@ struct service_settings indexer_worker_service_settings = {
        .client_limit = 1,
        .service_count = 0,
        .idle_kill = 0,
-       .vsz_limit = (uoff_t)-1,
+       .vsz_limit = UOFF_T_MAX,
 
        .unix_listeners = { { &indexer_worker_unix_listeners_buf,
                              sizeof(indexer_worker_unix_listeners[0]) } },
index d1610d62527c3f541dbed5aecbb3ee1288b678c2..ec191ac1898284879f198eb28c098ba413e90011 100644 (file)
@@ -39,7 +39,7 @@ struct service_settings ipc_service_settings = {
        .client_limit = 0,
        .service_count = 0,
        .idle_kill = 0,
-       .vsz_limit = (uoff_t)-1,
+       .vsz_limit = UOFF_T_MAX,
 
        .unix_listeners = { { &ipc_unix_listeners_buf,
                              sizeof(ipc_unix_listeners[0]) } },
index f0839fc19326ac124115f59ff28beadceceeb915..4244bec1edbde7a7ee2efe59c00cdbf8c9063945 100644 (file)
@@ -128,7 +128,7 @@ create_raw_stream(struct mail_deliver_input *dinput,
                input2 = input;
                i_stream_ref(input2);
        } else {
-               input2 = i_stream_create_limit(input, (uoff_t)-1);
+               input2 = i_stream_create_limit(input, UOFF_T_MAX);
        }
        i_stream_unref(&input);
 
index ba11ff31a030ad231f301395e292edde334c172b..2efada40d8f4e9bf53700e4dc70c316db9359b0b 100644 (file)
@@ -162,7 +162,7 @@ static void i_stream_bzlib_reset(struct bzlib_istream *zstream)
        struct istream_private *stream = &zstream->istream;
 
        i_stream_seek(stream->parent, stream->parent_start_offset);
-       zstream->eof_offset = (uoff_t)-1;
+       zstream->eof_offset = UOFF_T_MAX;
        zstream->zs.next_in = NULL;
        zstream->zs.avail_in = 0;
 
@@ -214,7 +214,7 @@ struct istream *i_stream_create_bz2(struct istream *input, bool log_errors)
        struct bzlib_istream *zstream;
 
        zstream = i_new(struct bzlib_istream, 1);
-       zstream->eof_offset = (uoff_t)-1;
+       zstream->eof_offset = UOFF_T_MAX;
        zstream->log_errors = log_errors;
 
        i_stream_bzlib_init(zstream);
index 6a6bb32b9082601239ad08e3b183fe515a15fa1b..eede110ab22d3198c21b882071dfd887c789712b 100644 (file)
@@ -189,7 +189,7 @@ static void i_stream_lzma_reset(struct lzma_istream *zstream)
        struct istream_private *stream = &zstream->istream;
 
        i_stream_seek(stream->parent, stream->parent_start_offset);
-       zstream->eof_offset = (uoff_t)-1;
+       zstream->eof_offset = UOFF_T_MAX;
        zstream->strm.next_in = NULL;
        zstream->strm.avail_in = 0;
 
@@ -240,7 +240,7 @@ struct istream *i_stream_create_lzma(struct istream *input, bool log_errors)
        struct lzma_istream *zstream;
 
        zstream = i_new(struct lzma_istream, 1);
-       zstream->eof_offset = (uoff_t)-1;
+       zstream->eof_offset = UOFF_T_MAX;
        zstream->log_errors = log_errors;
 
        i_stream_lzma_init(zstream);
index c04df039d8f68bbd7b95ac43b7afbe1ad55d47fb..99994f9e43b0c1cecc7bceeab65d6aebde8fc6fc 100644 (file)
@@ -204,8 +204,8 @@ static ssize_t i_stream_zlib_read(struct istream_private *stream)
                }
 
                /* gzip file with concatenated content */
-               stream->cached_stream_size = (uoff_t)-1;
-               zstream->eof_offset = (uoff_t)-1;
+               stream->cached_stream_size = UOFF_T_MAX;
+               zstream->eof_offset = UOFF_T_MAX;
                zstream->header_read = FALSE;
                zstream->trailer_read = FALSE;
                zstream->crc32 = 0;
@@ -328,7 +328,7 @@ static void i_stream_zlib_reset(struct zlib_istream *zstream)
        struct istream_private *stream = &zstream->istream;
 
        i_stream_seek(stream->parent, stream->parent_start_offset);
-       zstream->eof_offset = (uoff_t)-1;
+       zstream->eof_offset = UOFF_T_MAX;
        zstream->crc32 = 0;
 
        zstream->zs.next_in = NULL;
@@ -384,7 +384,7 @@ i_stream_create_zlib(struct istream *input, bool gz, bool log_errors)
        struct zlib_istream *zstream;
 
        zstream = i_new(struct zlib_istream, 1);
-       zstream->eof_offset = (uoff_t)-1;
+       zstream->eof_offset = UOFF_T_MAX;
        zstream->gz = gz;
        zstream->log_errors = log_errors;
 
index ddf3d86017b16f761d3525dadeff637fb7e2560c..42d2bc68804fe2f6a84244d32c8e5891c241297b 100644 (file)
@@ -741,7 +741,7 @@ struct istream *fs_read_stream(struct fs_file *file, size_t max_buffer_size)
 
        if (file->seekable_input != NULL) {
                /* allow multiple open streams, each in a different position */
-               input = i_stream_create_limit(file->seekable_input, (uoff_t)-1);
+               input = i_stream_create_limit(file->seekable_input, UOFF_T_MAX);
                i_stream_seek(input, 0);
                return input;
        }
index 5047dbdb1398f64f0ff3dc4ab6f6db73f40ec08b..85009f1479b8237dac32ccd0eee4aa5ba4283d07 100644 (file)
@@ -349,7 +349,7 @@ fs_metawrap_create_updated_istream(struct metawrap_fs_file *file,
                                               str_len(file->metadata_header));
 
        i_stream_seek(input, file->metadata_write_size);
-       inputs[1] = i_stream_create_limit(input, (uoff_t)-1);
+       inputs[1] = i_stream_create_limit(input, UOFF_T_MAX);
        inputs[2] = NULL;
        input2 = i_stream_create_concat(inputs);
        i_stream_unref(&inputs[0]);
index dfa19178af5ad78d76a1721b6a3844ec4dcfd2e9..6ce6a88d04d015e45aa46cd35677b98d1401ea32 100644 (file)
@@ -647,7 +647,7 @@ static void fs_posix_write_stream(struct fs_file *_file)
        } else {
                i_assert(file->fd != -1);
                _file->output = o_stream_create_fd_file(file->fd,
-                                                       (uoff_t)-1, FALSE);
+                                                       UOFF_T_MAX, FALSE);
        }
        o_stream_set_name(_file->output, file->full_path);
 }
index b329bb25c87ef57039cd8430cccf933375ff04f8..eabdd7927d57a196dcebe3f3aa361de30d31088c 100644 (file)
@@ -1087,7 +1087,7 @@ static void http_client_connection_input(struct connection *_conn)
                req->response_time = ioloop_timeval;
                req->response_offset =
                        http_response_parser_get_last_offset(conn->http_parser);
-               i_assert(req->response_offset != (uoff_t)-1);
+               i_assert(req->response_offset != UOFF_T_MAX);
                i_assert(req->response_offset < conn->conn.input->v_offset);
                req->bytes_in = conn->conn.input->v_offset - req->response_offset;
 
index 430a5309377f50cb6500c70a66abcd7e51997b31..29de688e8df4a1a50602fffc8be2033798ff19f5 100644 (file)
@@ -54,9 +54,9 @@ http_header_parser_init(struct istream *input,
                parser->limits = *limits;
 
        if (parser->limits.max_size == 0)
-               parser->limits.max_size = (uoff_t)-1;
+               parser->limits.max_size = UOFF_T_MAX;
        if (parser->limits.max_field_size == 0)
-               parser->limits.max_field_size = (uoff_t)-1;
+               parser->limits.max_field_size = UOFF_T_MAX;
        if (parser->limits.max_fields == 0)
                parser->limits.max_fields = (unsigned int)-1;
 
index a53cf3749d9d9cee10f0591f0a63e639e8e45bb3..e7162ee45e82f7fa2cc0f9bee59a23c7c039887a 100644 (file)
@@ -65,7 +65,7 @@ http_response_parser_restart(struct http_response_parser *parser)
        http_message_parser_restart(&parser->parser, NULL);
        parser->response_status = 0;
        parser->response_reason = NULL;
-       parser->response_offset = (uoff_t)-1;
+       parser->response_offset = UOFF_T_MAX;
 }
 
 static int http_response_parse_status(struct http_response_parser *parser)
index 98251d815774c356574b7dcca2bc0d8e4a7123de..e964555162447857b7b8f510ce48a584db01c98a 100644 (file)
@@ -837,7 +837,7 @@ void http_server_request_forward_payload(struct http_server_request *req,
 
        i_assert(req->req.payload != NULL);
 
-       if (max_size == (uoff_t)-1) {
+       if (max_size == UOFF_T_MAX) {
                i_stream_ref(input);
        } else {
                if ((ret = i_stream_get_size(input, TRUE,
index 20a60920ba4cef1c1765d5bf552ed3cd47ef7d80..06c91bea004dddf020e4815c7a0594ee0f022c38 100644 (file)
@@ -1680,7 +1680,7 @@ static void
 test_init_server_settings(struct http_server_settings *server_set_r)
 {
        i_zero(server_set_r);
-       server_set_r->request_limits.max_payload_size = (uoff_t)-1;
+       server_set_r->request_limits.max_payload_size = UOFF_T_MAX;
        server_set_r->debug = debug;
 
        if (small_socket_buffers) {
index d6c14721fcd2f25e8c95661e79566fcfc09ffb06..8f821aa1888699d58d575c40e7acf114652f07f1 100644 (file)
@@ -61,7 +61,7 @@ int imap_msgpart_url_create(struct mail_user *user, const struct imap_url *url,
 
        imap_msgpart_set_partial(msgpart, url->partial_offset,
                                 url->partial_size == 0 ?
-                                (uoff_t)-1 : url->partial_size);
+                                UOFF_T_MAX : url->partial_size);
 
        *mpurl_r = mpurl;
        return 0;
index 9eed0b34cc40cc18d39360438ba54f2b227f4a5c..024fa6edd575041309320c6c3d8bfff7a4ecbe9a 100644 (file)
@@ -41,7 +41,7 @@ struct imap_msgpart {
         struct mailbox_header_lookup_ctx *header_ctx;
        const char *const *headers;
 
-       /* which part of the message part to fetch (default: 0..(uoff_t)-1) */
+       /* which part of the message part to fetch (default: 0..UOFF_T_MAX) */
        uoff_t partial_offset, partial_size;
 
        bool decode_cte_to_binary:1;
@@ -62,7 +62,7 @@ static struct imap_msgpart *imap_msgpart_type(enum fetch_type fetch_type)
        pool = pool_alloconly_create("imap msgpart", sizeof(*msgpart)+32);
        msgpart = p_new(pool, struct imap_msgpart, 1);
        msgpart->pool = pool;
-       msgpart->partial_size = (uoff_t)-1;
+       msgpart->partial_size = UOFF_T_MAX;
        msgpart->fetch_type = fetch_type;
        msgpart->section_number = "";
        if (fetch_type == FETCH_HEADER || fetch_type == FETCH_FULL)
@@ -207,7 +207,7 @@ int imap_msgpart_parse(const char *section, struct imap_msgpart **msgpart_r)
        pool = pool_alloconly_create("imap msgpart", 1024);
        msgpart = *msgpart_r = p_new(pool, struct imap_msgpart, 1);
        msgpart->pool = pool;
-       msgpart->partial_size = (uoff_t)-1;
+       msgpart->partial_size = UOFF_T_MAX;
 
        /* get the section number */
        next_digit = TRUE;
@@ -442,7 +442,7 @@ imap_msgpart_crlf_seek(struct mail *mail, struct istream *input,
 
        if (mail->uid > 0 &&
            (msgpart->partial_offset != 0 ||
-            msgpart->partial_size != (uoff_t)-1) && !input->eof) {
+            msgpart->partial_size != UOFF_T_MAX) && !input->eof) {
                /* update cache */
                cache->uid = mail->uid;
                cache->physical_start = physical_start;
index 4a016ba4815dfef67ecc932d9238af5ef7513696..92b56c67157b81d760ad7a465ee5e87f7a5316d2 100644 (file)
@@ -34,7 +34,7 @@ bool imap_msgpart_contains_body(const struct imap_msgpart *msgpart);
    with storage error set to MAIL_ERROR_CONVERSION. */
 void imap_msgpart_set_decode_to_binary(struct imap_msgpart *msgpart);
 
-/* Set the fetch to be partial. For unlimited size use (uoff_t)-1. */
+/* Set the fetch to be partial. For unlimited size use UOFF_T_MAX. */
 void imap_msgpart_set_partial(struct imap_msgpart *msgpart,
                              uoff_t offset, uoff_t size);
 uoff_t imap_msgpart_get_partial_offset(struct imap_msgpart *msgpart);
index 845ff5dc78316fbf9ce226161ae8eae607a53723..7cbd5e31bca2fb7a0095d3fc497f6035088a3f0a 100644 (file)
@@ -237,7 +237,7 @@ int mail_index_map_check_header(struct mail_index_map *map,
        struct mail_index *index = map->index;
        const struct mail_index_header *hdr = &map->hdr;
 
-       if (!mail_index_check_header_compat(index, hdr, (uoff_t)-1, error_r))
+       if (!mail_index_check_header_compat(index, hdr, UOFF_T_MAX, error_r))
                return 0;
 
        /* following some extra checks that only take a bit of CPU */
index 73f0efc11cef5dc26e667b7ae65c5170e6a2ece6..1053f6ad03cd85a3d0e2e88eb2bf9ec8cd831d47 100644 (file)
@@ -262,7 +262,7 @@ static int mail_index_read_map(struct mail_index_map *map, uoff_t file_size)
 
        for (i = 0;; i++) {
                try_retry = i < MAIL_INDEX_ESTALE_RETRY_COUNT;
-               if (file_size == (uoff_t)-1) {
+               if (file_size == UOFF_T_MAX) {
                        /* fstat() below failed */
                        ret = 0;
                        retry = try_retry;
@@ -293,7 +293,7 @@ static int mail_index_read_map(struct mail_index_map *map, uoff_t file_size)
                                mail_index_set_syscall_error(index, "fstat()");
                                return -1;
                        }
-                       file_size = (uoff_t)-1;
+                       file_size = UOFF_T_MAX;
                }
        }
        return ret;
@@ -335,13 +335,13 @@ mail_index_map_latest_file(struct mail_index *index, const char **reason_r)
                        mail_index_set_syscall_error(index, "fstat()");
                        return -1;
                }
-               file_size = (uoff_t)-1;
+               file_size = UOFF_T_MAX;
        }
 
        /* mmaping seems to be slower than just reading the file, so even if
           mmap isn't disabled don't use it unless the file is large enough */
        use_mmap = (index->flags & MAIL_INDEX_OPEN_FLAG_MMAP_DISABLE) == 0 &&
-               file_size != (uoff_t)-1 && file_size > MAIL_INDEX_MMAP_MIN_SIZE;
+               file_size != UOFF_T_MAX && file_size > MAIL_INDEX_MMAP_MIN_SIZE;
 
        new_map = mail_index_map_alloc(index);
        if (use_mmap) {
index 3779308f143dda46f018b6bf18fc44a147874896..39b21c642f9485ea8cf70c7bbfcd4b594d5b5604 100644 (file)
@@ -947,7 +947,7 @@ int mail_index_sync_map(struct mail_index_map **_map,
        view = mail_index_view_open_with_map(index, map);
        ret = mail_transaction_log_view_set(view->log_view,
                                            map->hdr.log_file_seq, start_offset,
-                                           (uint32_t)-1, (uoff_t)-1,
+                                           (uint32_t)-1, UOFF_T_MAX,
                                            &reset, &reason);
        if (ret <= 0) {
                mail_index_view_close(&view);
index dc840170d83daf92b116a026c9dc07f8dacb2b80..f74e11cc4b180f46f8213644e9d4cadd3c4cc761 100644 (file)
@@ -318,7 +318,7 @@ int mail_index_sync_begin(struct mail_index *index,
        int ret;
 
        ret = mail_index_sync_begin_to(index, ctx_r, view_r, trans_r,
-                                      (uint32_t)-1, (uoff_t)-1, flags);
+                                      (uint32_t)-1, UOFF_T_MAX, flags);
        i_assert(ret != 0 ||
                 (flags & MAIL_INDEX_SYNC_FLAG_REQUIRE_CHANGES) != 0);
        return ret;
index 92ebede45f1924b7c7244102cffb16d5be92d3bf..f355eefc812500549fef4c984c3050f6e3bf82b8 100644 (file)
@@ -88,7 +88,7 @@ view_sync_set_log_view_range(struct mail_index_view *view, bool sync_expunges,
                   we can't do this, so sync only up to the reset. */
                mail_transaction_log_view_get_prev_pos(view->log_view,
                                                       &end_seq, &end_offset);
-               end_seq--; end_offset = (uoff_t)-1;
+               end_seq--; end_offset = UOFF_T_MAX;
                if (end_seq < start_seq) {
                        /* we have only this reset log */
                        mail_transaction_log_view_clear(view->log_view,
index 75bfe14d30a59c899d46b8ec5ea816ae246d248e..34f55faf8345c1cea222bdef3143c9effed5cc57 100644 (file)
@@ -1268,7 +1268,7 @@ get_modseq_next_offset_at(struct mail_transaction_log_file *file,
        /* make sure we've read until end of file. this is especially important
           with non-head logs which might only have been opened without being
           synced. */
-       ret = mail_transaction_log_file_map(file, *cur_offset, (uoff_t)-1, &reason);
+       ret = mail_transaction_log_file_map(file, *cur_offset, UOFF_T_MAX, &reason);
        if (ret <= 0) {
                mail_index_set_error(file->log->index,
                        "Failed to map transaction log %s for getting offset "
@@ -1722,7 +1722,7 @@ log_file_map_check_offsets(struct mail_transaction_log_file *file,
                }
                return FALSE;
        }
-       if (end_offset != (uoff_t)-1 && end_offset > file->sync_offset) {
+       if (end_offset != UOFF_T_MAX && end_offset > file->sync_offset) {
                *reason_r = t_strdup_printf(
                        "%s: end_offset (%"PRIuUOFF_T") > "
                        "current sync_offset (%"PRIuUOFF_T")",
@@ -1858,7 +1858,7 @@ int mail_transaction_log_file_map(struct mail_transaction_log_file *file,
                 file->sync_offset >= file->buffer_offset + file->buffer->used);
 
        if (file->locked_sync_offset_updated && file == file->log->head &&
-           end_offset == (uoff_t)-1) {
+           end_offset == UOFF_T_MAX) {
                /* we're not interested of going further than sync_offset */
                if (!log_file_map_check_offsets(file, start_offset,
                                                end_offset, reason_r))
@@ -1876,7 +1876,7 @@ int mail_transaction_log_file_map(struct mail_transaction_log_file *file,
 
        if (file->locked) {
                /* set this only when we've synced to end of file while locked
-                  (either end_offset=(uoff_t)-1 or we had to read anyway) */
+                  (either end_offset=UOFF_T_MAX or we had to read anyway) */
                file->locked_sync_offset_updated = TRUE;
        }
 
index 27202bd033de4e02bb43b2fcfaafb078313a4591..23ea51d32023defb6d8326247eeb5e4ff2a0e440 100644 (file)
@@ -61,7 +61,7 @@ struct mail_transaction_log_file {
        uoff_t saved_tail_sync_offset;
 
        /* if we've seen _INDEX_[UN9DELETED transaction in this file,
-          this is the offset. otherwise (uoff_t)-1 */
+          this is the offset. otherwise UOFF_T_MAX */
        uoff_t index_deleted_offset, index_undeleted_offset;
 
        struct modseq_cache modseq_cache[LOG_FILE_MODSEQ_CACHE_SIZE];
index ddf42440db2a40d2bb50f07c0aee245b046d801f..a51c62dc4f25d1d5ffd5b86009661e73f0647f2e 100644 (file)
@@ -186,7 +186,7 @@ int mail_transaction_log_view_set(struct mail_transaction_log_view *view,
                        if (file == NULL && max_file_seq == (uint32_t)-1 &&
                            view->head == view->log->head) {
                                /* we just wanted to sync everything */
-                               i_assert(max_file_offset == (uoff_t)-1);
+                               i_assert(max_file_offset == UOFF_T_MAX);
                                max_file_seq = seq-1;
                                break;
                        }
@@ -281,7 +281,7 @@ int mail_transaction_log_view_set(struct mail_transaction_log_view *view,
                start_offset = file->hdr.file_seq == min_file_seq ?
                        min_file_offset : file->hdr.hdr_size;
                end_offset = file->hdr.file_seq == max_file_seq ?
-                       max_file_offset : (uoff_t)-1;
+                       max_file_offset : UOFF_T_MAX;
                ret = mail_transaction_log_file_map(file, start_offset,
                                                    end_offset, reason_r);
                if (ret <= 0) {
@@ -319,11 +319,11 @@ int mail_transaction_log_view_set(struct mail_transaction_log_view *view,
 
        i_assert(max_file_seq == (uint32_t)-1 ||
                 max_file_seq == view->head->hdr.file_seq);
-       i_assert(max_file_offset == (uoff_t)-1 ||
+       i_assert(max_file_offset == UOFF_T_MAX ||
                 max_file_offset <= view->head->sync_offset);
        i_assert(min_file_seq != max_file_seq ||
                 max_file_seq != view->head->hdr.file_seq ||
-                max_file_offset != (uoff_t)-1 ||
+                max_file_offset != UOFF_T_MAX ||
                 min_file_offset <= view->head->sync_offset);
 
        view->prev_file_seq = view->cur->hdr.file_seq;
@@ -357,7 +357,7 @@ int mail_transaction_log_view_set_all(struct mail_transaction_log_view *view)
 
        for (file = view->log->files; file != NULL; file = file->next) {
                ret = mail_transaction_log_file_map(file, file->hdr.hdr_size,
-                                                   (uoff_t)-1, &reason);
+                                                   UOFF_T_MAX, &reason);
                if (ret < 0) {
                        first = NULL;
                        break;
index 87c861f9f96581711684ba44a407af8f32789201..e0b0766b4e7035936329aadc86054bc45c89d0a4 100644 (file)
@@ -571,7 +571,7 @@ int mail_transaction_log_sync_lock(struct mail_transaction_log *log,
 
        /* update sync_offset */
        if (mail_transaction_log_file_map(log->head, log->head->sync_offset,
-                                         (uoff_t)-1, &reason) <= 0) {
+                                         UOFF_T_MAX, &reason) <= 0) {
                mail_index_set_error(log->index,
                        "Failed to map transaction log %s at "
                        "sync_offset=%"PRIuUOFF_T" after locking: %s",
index ad1ee208987523d2e8dc15b2ea7d301b16d2310c..202d7de82be27eb219319ec647edb56287257fdc 100644 (file)
@@ -162,7 +162,7 @@ static void test_mail_transaction_log_view(void)
 
        /* we have files 1-3 opened */
        test_begin("set all");
-       test_assert(mail_transaction_log_view_set(view, 0, 0, (uint32_t)-1, (uoff_t)-1, &reset, &reason) == 1 &&
+       test_assert(mail_transaction_log_view_set(view, 0, 0, (uint32_t)-1, UOFF_T_MAX, &reset, &reason) == 1 &&
                    reset && view_is_file_refed(1) && view_is_file_refed(2) &&
                    view_is_file_refed(3) &&
                    !mail_transaction_log_view_is_corrupted(view));
@@ -188,7 +188,7 @@ static void test_mail_transaction_log_view(void)
        test_end();
 
        test_begin("set end");
-       test_assert(mail_transaction_log_view_set(view, 3, last_log_size, (uint32_t)-1, (uoff_t)-1, &reset, &reason) == 1);
+       test_assert(mail_transaction_log_view_set(view, 3, last_log_size, (uint32_t)-1, UOFF_T_MAX, &reset, &reason) == 1);
        mail_transaction_log_view_get_prev_pos(view, &seq, &offset);
        test_assert(seq == 3 && offset == last_log_size);
        test_assert(mail_transaction_log_view_next(view, &hdr, &data) == 0);
@@ -210,16 +210,16 @@ static void test_mail_transaction_log_view(void)
        /* --- first file has been removed --- */
 
        test_begin("set 2-3");
-       test_assert(mail_transaction_log_view_set(view, 2, 0, (uint32_t)-1, (uoff_t)-1, &reset, &reason) == 1);
+       test_assert(mail_transaction_log_view_set(view, 2, 0, (uint32_t)-1, UOFF_T_MAX, &reset, &reason) == 1);
        test_end();
 
        test_begin("missing log handing");
-       test_assert(mail_transaction_log_view_set(view, 0, 0, (uint32_t)-1, (uoff_t)-1, &reset, &reason) == 0);
+       test_assert(mail_transaction_log_view_set(view, 0, 0, (uint32_t)-1, UOFF_T_MAX, &reset, &reason) == 0);
        test_end();
 
        test_begin("closed log handling");
        view->log = NULL;
-       test_assert(mail_transaction_log_view_set(view, 0, 0, (uint32_t)-1, (uoff_t)-1, &reset, &reason) == -1);
+       test_assert(mail_transaction_log_view_set(view, 0, 0, (uint32_t)-1, UOFF_T_MAX, &reset, &reason) == -1);
        view->log = log;
        test_end();
 
index f6a3fec1f3495aef8f632eb84674a2de588b66ca..7095499c6bc27b14ecb13cb049ca7bc0f3b26376 100644 (file)
@@ -118,7 +118,7 @@ istream_attachment_connector_finish(struct istream_attachment_connector **_conn)
        if (conn->base_input_offset != conn->msg_size) {
                i_assert(conn->base_input_offset < conn->msg_size);
 
-               if (conn->msg_size != (uoff_t)-1) {
+               if (conn->msg_size != UOFF_T_MAX) {
                        trailer_size = conn->msg_size - conn->encoded_offset;
                        input = i_stream_create_sized_range(conn->base_input,
                                                            conn->base_input_offset,
@@ -128,7 +128,7 @@ istream_attachment_connector_finish(struct istream_attachment_connector **_conn)
                } else {
                        input = i_stream_create_range(conn->base_input,
                                                      conn->base_input_offset,
-                                                     (uoff_t)-1);
+                                                     UOFF_T_MAX);
                }
                array_push_back(&conn->streams, &input);
        }
index bf54aecea28b15a56dab72dca3639bc2ba73bd4b..df829cd50449a24f8d6fcee0ecfcecd6c86f71f4 100644 (file)
@@ -3,7 +3,7 @@
 
 /* Start building a message stream. The base_input contains the message
    without attachments. The final stream must be exactly msg_size bytes.
-   If the original msg_size isn't known, it can be set to (uoff_t)-1. */
+   If the original msg_size isn't known, it can be set to UOFF_T_MAX. */
 struct istream_attachment_connector *
 istream_attachment_connector_begin(struct istream *base_input, uoff_t msg_size);
 
index 87bc769963166b6b59431beb1f61735799d617c1..df4bff4974faa55531ff9e8102c09c5c57624c23 100644 (file)
@@ -399,7 +399,7 @@ handle_end_body_with_lf(struct header_filter_istream *mstream, ssize_t ret)
 
        data = i_stream_get_data(stream->parent, &size);
        if (stream->parent->v_offset + size == 0 && size == 0)
-               last_offset = (uoff_t)-1;
+               last_offset = UOFF_T_MAX;
        else
                last_offset = stream->parent->v_offset + size - 1;
 
@@ -428,7 +428,7 @@ handle_end_body_with_lf(struct header_filter_istream *mstream, ssize_t ret)
                stream->buffer = mstream->hdr_buf->data;
                return mstream->crlf ? 2 : 1;
        } else {
-               mstream->last_lf_offset = last_lf ? last_offset : (uoff_t)-1;
+               mstream->last_lf_offset = last_lf ? last_offset : UOFF_T_MAX;
        }
        return ret;
 }
@@ -594,7 +594,7 @@ i_stream_header_filter_stat(struct istream_private *stream, bool exact)
        } else if (mstream->last_lf_added) {
                /* yes, we have added LF */
                stream->statbuf.st_size += mstream->crlf ? 2 : 1;
-       } else if (mstream->last_lf_offset != (uoff_t)-1) {
+       } else if (mstream->last_lf_offset != UOFF_T_MAX) {
                /* no, we didn't need to add LF */
        } else {
                /* check if we need to add LF */
@@ -665,7 +665,7 @@ i_stream_create_header_filter(struct istream *input,
        mstream->add_missing_eoh = (flags & HEADER_FILTER_ADD_MISSING_EOH) != 0;
        mstream->end_body_with_lf =
                (flags & HEADER_FILTER_END_BODY_WITH_LF) != 0;
-       mstream->last_lf_offset = (uoff_t)-1;
+       mstream->last_lf_offset = UOFF_T_MAX;
        mstream->last_added_newline = TRUE;
 
        mstream->istream.iostream.destroy = i_stream_header_filter_destroy;
index 74887e84f6e88f59167d45c80d51471dae593240..ac3096e7173f6fb16d4e38dd6b959fdd03e898f5 100644 (file)
@@ -297,7 +297,7 @@ static int test_input_stream(struct istream *file_input)
                        ret = -1;
 
                /* try again without knowing the message's size */
-               msg_size = (uoff_t)-1;
+               msg_size = UOFF_T_MAX;
        }
 
        /* try with a wrong message size */
index 6c2b5ffb4b9be6c08a53a65b1e3db6c6716d924e..248330152437cd1eb87d8114959e164424339146 100644 (file)
@@ -482,7 +482,7 @@ int settings_get_size(const char *str, uoff_t *bytes_r,
                *error_r = t_strconcat("Invalid size: ", str, NULL);
                return -1;
        }
-       if (num > ((uoff_t)-1) / multiply) {
+       if (num > (UOFF_T_MAX) / multiply) {
                *error_r = t_strconcat("Size is too large: ", str, NULL);
                return -1;
        }
index 0583f2a378df87c3a28efa1ca1826968e64460c0..e774e0d4f93ce76c82b9e2f265220e983c3a7026 100644 (file)
@@ -519,7 +519,7 @@ smtp_command_parse_data_with_dot(struct smtp_command_parser *parser)
        i_assert(parser->data == NULL);
 
        data = i_stream_create_dot(parser->input, TRUE);
-       if (parser->limits.max_data_size != (uoff_t)-1) {
+       if (parser->limits.max_data_size != UOFF_T_MAX) {
                parser->data = i_stream_create_failure_at(
                        data, parser->limits.max_data_size, EMSGSIZE,
                        t_strdup_printf("Command data size exceeds maximum "
index 6390501bfebbc67948bb2332f3ec48f611d06bee..c5a18814878a36ff836b4860a9584efbf70b0bcc 100644 (file)
@@ -862,7 +862,7 @@ smtp_server_connection_alloc(struct smtp_server *server,
 
                conn->set.max_message_size = set->max_message_size;
                if (set->max_message_size == 0 ||
-                   set->max_message_size == (uoff_t)-1) {
+                   set->max_message_size == UOFF_T_MAX) {
                        conn->set.command_limits.max_data_size = UOFF_T_MAX;
                } else if (conn->set.command_limits.max_data_size != 0) {
                        /* Explicit limit given */
index 7076b3d9fed75100421d5e7ec90ab0b6b70e63df..ec9747825351acf18449f19558721259e3f5760b 100644 (file)
@@ -821,7 +821,7 @@ void smtp_server_reply_ehlo_add_size(struct smtp_server_reply *reply)
        if ((caps & SMTP_CAPABILITY_SIZE) == 0)
                return;
 
-       if (cap_size > 0 && cap_size != (uoff_t)-1) {
+       if (cap_size > 0 && cap_size != UOFF_T_MAX) {
                smtp_server_reply_ehlo_add_param(reply,
                        "SIZE", "%"PRIuUOFF_T, cap_size);
        } else {
index dc8f1a476ef8a9f2a358095d8af95134b4c29cc0..c9dfd795db2592fd81678418bc82fdef01413c14 100644 (file)
@@ -778,7 +778,7 @@ static void test_client_continue(void *dummy ATTR_UNUSED)
                }
 
                if (debug) {
-                       uoff_t raw_size = (uoff_t)-1, b64_size = (uoff_t)-1;
+                       uoff_t raw_size = UOFF_T_MAX, b64_size = UOFF_T_MAX;
 
                        (void)i_stream_get_size(fstream, TRUE, &raw_size);
                        (void)i_stream_get_size(payload, TRUE, &b64_size);
index af96dd165634c51e09a5770dac0cd1fecd8d1324..1c44ca4e98e09de4e6054887c61cc8223ed83487 100644 (file)
@@ -177,7 +177,7 @@ dbox_file_find_next_magic(struct dbox_file *file, uoff_t *offset_r, bool *pre_r)
                        continue;
                }
 
-               pre_offset = (uoff_t)-1;
+               pre_offset = UOFF_T_MAX;
                match = dbox_file_match_pre_magic(input, &pre_offset, &need_bytes);
                if (match < 0) {
                        /* more data needed */
@@ -201,14 +201,14 @@ dbox_file_find_next_magic(struct dbox_file *file, uoff_t *offset_r, bool *pre_r)
                }
                if (match > 0) {
                        post_offset = input->v_offset;
-                       if (pre_offset == (uoff_t)-1 ||
+                       if (pre_offset == UOFF_T_MAX ||
                            post_offset < pre_offset) {
                                pre_offset = post_offset;
                                *pre_r = FALSE;
                        }
                }
 
-               if (pre_offset != (uoff_t)-1) {
+               if (pre_offset != UOFF_T_MAX) {
                        *offset_r = pre_offset;
                        ret = 1;
                        break;
@@ -351,7 +351,7 @@ dbox_file_fix_write_stream(struct dbox_file *file, uoff_t start_offset,
                                        return -1;
                                dbox_file_skip_broken_header(file);
                                body_offset = file->input->v_offset;
-                               msg_size = (uoff_t)-1;
+                               msg_size = UOFF_T_MAX;
                        } else {
                                i_stream_skip(file->input,
                                              file->msg_header_size);
@@ -373,7 +373,7 @@ dbox_file_fix_write_stream(struct dbox_file *file, uoff_t start_offset,
                        } else {
                                /* msg header is broken. write our own. */
                                i_stream_seek(file->input, body_offset);
-                               if (msg_size != (uoff_t)-1) {
+                               if (msg_size != UOFF_T_MAX) {
                                        /* previous magic find might have
                                           skipped too much. seek back and
                                           make sure */
index 883c7e95d6cb194f65109c1a93ea6039bfe15a85..aeb8a0988d891ce1597e3e3df5994b2215913d96 100644 (file)
@@ -66,7 +66,7 @@ void dbox_file_init(struct dbox_file *file)
 {
        file->refcount = 1;
        file->fd = -1;
-       file->cur_offset = (uoff_t)-1;
+       file->cur_offset = UOFF_T_MAX;
        file->cur_path = file->primary_path;
 }
 
@@ -305,7 +305,7 @@ void dbox_file_close(struct dbox_file *file)
                        dbox_file_set_syscall_error(file, "close()");
                file->fd = -1;
        }
-       file->cur_offset = (uoff_t)-1;
+       file->cur_offset = UOFF_T_MAX;
 }
 
 int dbox_file_try_lock(struct dbox_file *file)
@@ -433,7 +433,7 @@ dbox_file_seek_next_at_metadata(struct dbox_file *file, uoff_t *offset)
 
 void dbox_file_seek_rewind(struct dbox_file *file)
 {
-       file->cur_offset = (uoff_t)-1;
+       file->cur_offset = UOFF_T_MAX;
 }
 
 int dbox_file_seek_next(struct dbox_file *file, uoff_t *offset_r, bool *last_r)
@@ -443,7 +443,7 @@ int dbox_file_seek_next(struct dbox_file *file, uoff_t *offset_r, bool *last_r)
 
        i_assert(file->input != NULL);
 
-       if (file->cur_offset == (uoff_t)-1) {
+       if (file->cur_offset == UOFF_T_MAX) {
                /* first mail. we may not have read the file at all yet,
                   so set the offset afterwards. */
                offset = 0;
@@ -710,7 +710,7 @@ int dbox_file_metadata_read(struct dbox_file *file)
        uoff_t metadata_offset;
        int ret;
 
-       i_assert(file->cur_offset != (uoff_t)-1);
+       i_assert(file->cur_offset != UOFF_T_MAX);
 
        if (file->metadata_read_offset == file->cur_offset)
                return 1;
@@ -750,7 +750,7 @@ uoff_t dbox_file_get_plaintext_size(struct dbox_file *file)
        value = dbox_file_metadata_get(file, DBOX_METADATA_PHYSICAL_SIZE);
        if (value == NULL ||
            str_to_uintmax_hex(value, &size) < 0 ||
-           size > (uoff_t)-1) {
+           size > UOFF_T_MAX) {
                /* no. that means we can use the size in the header */
                return file->cur_physical_size;
        }
index 25b6d3b43896fec4f1008add51995226db347e61..25955d8a342ebb433fada25e115f9bd8d30299ac 100644 (file)
@@ -107,7 +107,7 @@ int dbox_mail_get_virtual_size(struct mail *_mail, uoff_t *size_r)
        if (value == NULL)
                return index_mail_get_virtual_size(_mail, size_r);
 
-       if (str_to_uintmax_hex(value, &size) < 0 || size > (uoff_t)-1)
+       if (str_to_uintmax_hex(value, &size) < 0 || size > UOFF_T_MAX)
                return -1;
        data->virtual_size = (uoff_t)size;
        *size_r = data->virtual_size;
index ee98fafd37c4663a99baffe1cae9a3552fd9bcc7..65138bd42175d02509191a3176a3675c464d2cd2 100644 (file)
@@ -272,7 +272,7 @@ void mdbox_file_unrefed(struct dbox_file *file)
        unsigned int i, count;
 
        /* don't cache metadata seeks while file isn't being referenced */
-       file->metadata_read_offset = (uoff_t)-1;
+       file->metadata_read_offset = UOFF_T_MAX;
        mfile->close_time = ioloop_time;
 
        if (mfile->file_id != 0) {
index 1f93d4b5d1dbdb9b0482b8cdd7aad96d6655a8bf..133b8ff9670e6481eb4ff3ced2dc24cbfb7e5ecf 100644 (file)
@@ -351,7 +351,7 @@ imapc_mail_get_wanted_fetch_fields(struct imapc_mail *mail)
        }
        if ((data->wanted_fields & (MAIL_FETCH_PHYSICAL_SIZE |
                                    MAIL_FETCH_VIRTUAL_SIZE)) != 0 &&
-           data->physical_size == (uoff_t)-1 &&
+           data->physical_size == UOFF_T_MAX &&
            IMAPC_BOX_HAS_FEATURE(mbox, IMAPC_FEATURE_RFC822_SIZE))
                fields |= MAIL_FETCH_PHYSICAL_SIZE | MAIL_FETCH_VIRTUAL_SIZE;
        if ((data->wanted_fields & MAIL_FETCH_IMAP_BODY) != 0 &&
@@ -434,7 +434,7 @@ imapc_mail_have_fields(struct imapc_mail *imail, enum mail_fetch_field fields)
                fields &= ~MAIL_FETCH_SAVE_DATE;
        }
        if ((fields & (MAIL_FETCH_PHYSICAL_SIZE | MAIL_FETCH_VIRTUAL_SIZE)) != 0) {
-               if (imail->imail.data.physical_size == (uoff_t)-1)
+               if (imail->imail.data.physical_size == UOFF_T_MAX)
                        return FALSE;
                fields &= ~(MAIL_FETCH_PHYSICAL_SIZE | MAIL_FETCH_VIRTUAL_SIZE);
        }
@@ -613,7 +613,7 @@ void imapc_mail_init_stream(struct imapc_mail *mail)
                           set it to size, because there's no guarantees about
                           the content having proper CRLF newlines, especially
                           not if istream_opened() has changed the stream. */
-                       imail->data.virtual_size = (uoff_t)-1;
+                       imail->data.virtual_size = UOFF_T_MAX;
                }
                imail->data.physical_size = size;
        }
index 3ea21eb7b348dc582cccfe1fdef4887612ab6c68..af8bc17f7d8ed4eccecee0abbb500508cfa15d94 100644 (file)
@@ -174,9 +174,9 @@ static int imapc_mail_get_physical_size(struct mail *_mail, uoff_t *size_r)
        uoff_t old_offset;
        int ret;
 
-       if (data->physical_size == (uoff_t)-1)
+       if (data->physical_size == UOFF_T_MAX)
                (void)index_mail_get_physical_size(_mail, size_r);
-       if (data->physical_size != (uoff_t)-1) {
+       if (data->physical_size != UOFF_T_MAX) {
                *size_r = data->physical_size;
                return 0;
        }
@@ -188,7 +188,7 @@ static int imapc_mail_get_physical_size(struct mail *_mail, uoff_t *size_r)
                   so try not to trust it too much. */
                if (imapc_mail_fetch(_mail, MAIL_FETCH_PHYSICAL_SIZE, NULL) < 0)
                        return -1;
-               if (data->physical_size == (uoff_t)-1) {
+               if (data->physical_size == UOFF_T_MAX) {
                        if (imapc_mail_failed(_mail, "RFC822.SIZE") < 0)
                                return -1;
                        /* assume that the server never returns RFC822.SIZE
index 4c552677f4536d2c763ccef9be81beaee25194ac..2577f1afe54f6c28bb960a9ea8d6171ed1597439 100644 (file)
@@ -139,7 +139,7 @@ add_binary_part(struct binary_ctx *ctx, const struct message_part *part,
                block->converted = TRUE;
                block->converted_hdr = TRUE;
 
-               linput = i_stream_create_limit(ctx->input, (uoff_t)-1);
+               linput = i_stream_create_limit(ctx->input, UOFF_T_MAX);
                block->input = i_stream_create_header_filter(linput,
                                HEADER_FILTER_EXCLUDE | HEADER_FILTER_HIDE_BODY,
                                filter_headers, N_ELEMENTS(filter_headers),
index e7919ac6dc9f9f7483feeb8f0e970378f4722ebb..706b7eeb31e2f9e00e3c9eabaaf7db5553634909 100644 (file)
@@ -501,8 +501,8 @@ static void index_mail_try_set_body_size(struct index_mail *mail)
        struct index_mail_data *data = &mail->data;
 
        if (data->hdr_size_set && !data->inexact_total_sizes &&
-           data->physical_size != (uoff_t)-1 &&
-           data->virtual_size != (uoff_t)-1) {
+           data->physical_size != UOFF_T_MAX &&
+           data->virtual_size != UOFF_T_MAX) {
                /* We know the total size of this mail and we know the
                   header size, so we can calculate also the body size.
                   However, don't do this if there's a possibility that
@@ -527,9 +527,9 @@ bool index_mail_get_cached_virtual_size(struct index_mail *mail, uoff_t *size_r)
        const uint32_t *vsize = index_mail_get_vsize_extension(_mail);
 
        data->cache_fetch_fields |= MAIL_FETCH_VIRTUAL_SIZE;
-       if (data->virtual_size == (uoff_t)-1 && vsize != NULL && *vsize > 0)
+       if (data->virtual_size == UOFF_T_MAX && vsize != NULL && *vsize > 0)
                data->virtual_size = (*vsize)-1;
-       if (data->virtual_size == (uoff_t)-1) {
+       if (data->virtual_size == UOFF_T_MAX) {
                if (index_mail_get_cached_uoff_t(mail,
                                                 MAIL_CACHE_VIRTUAL_FULL_SIZE,
                                                 &size))
@@ -600,7 +600,7 @@ int index_mail_get_virtual_size(struct mail *_mail, uoff_t *size_r)
                return -1;
        i_stream_seek(data->stream, old_offset);
 
-       i_assert(data->virtual_size != (uoff_t)-1);
+       i_assert(data->virtual_size != UOFF_T_MAX);
        *size_r = data->virtual_size;
        return 0;
 }
@@ -620,7 +620,7 @@ int index_mail_get_physical_size(struct mail *_mail, uoff_t *size_r)
                   index_mail_get_cached_body_size(). */
                data->cache_fetch_fields |= MAIL_FETCH_PHYSICAL_SIZE;
        }
-       if (data->physical_size == (uoff_t)-1) {
+       if (data->physical_size == UOFF_T_MAX) {
                if (index_mail_get_cached_uoff_t(mail,
                                                 MAIL_CACHE_PHYSICAL_FULL_SIZE,
                                                 &size))
@@ -629,7 +629,7 @@ int index_mail_get_physical_size(struct mail *_mail, uoff_t *size_r)
                        (void)get_cached_msgpart_sizes(mail);
        }
        *size_r = data->physical_size;
-       return *size_r == (uoff_t)-1 ? -1 : 0;
+       return *size_r == UOFF_T_MAX ? -1 : 0;
 }
 
 void index_mail_cache_add(struct index_mail *mail, enum index_cache_field field,
@@ -970,7 +970,7 @@ static void index_mail_cache_sizes(struct index_mail *mail)
        */
        if ((mail_index_map_get_ext_idx(view->index->map, _mail->box->mail_vsize_ext_id, &idx) ||
             mail_index_map_get_ext_idx(view->index->map, _mail->box->vsize_hdr_ext_id, &idx)) &&
-           (sizes[0] != (uoff_t)-1 &&
+           (sizes[0] != UOFF_T_MAX &&
             sizes[0] < (uint32_t)-1)) {
                const uint32_t *vsize_ext =
                        index_mail_get_vsize_extension(_mail);
@@ -984,11 +984,11 @@ static void index_mail_cache_sizes(struct index_mail *mail)
                                              _mail->box->mail_vsize_ext_id, &vsize, NULL);
                }
                /* it's already in index, so don't update cache */
-               sizes[0] = (uoff_t)-1;
+               sizes[0] = UOFF_T_MAX;
        }
 
        for (i = 0; i < N_ELEMENTS(size_fields); i++) {
-               if (sizes[i] != (uoff_t)-1 &&
+               if (sizes[i] != UOFF_T_MAX &&
                    index_mail_want_cache(mail, size_fields[i])) {
                        index_mail_cache_add(mail, size_fields[i],
                                             &sizes[i], sizeof(sizes[i]));
@@ -1745,8 +1745,8 @@ static void index_mail_init_data(struct index_mail *mail)
 {
        struct index_mail_data *data = &mail->data;
 
-       data->virtual_size = (uoff_t)-1;
-       data->physical_size = (uoff_t)-1;
+       data->virtual_size = UOFF_T_MAX;
+       data->physical_size = UOFF_T_MAX;
        data->save_date = (time_t)-1;
        data->received_date = (time_t)-1;
        data->sent_date.time = (uint32_t)-1;
@@ -2419,15 +2419,15 @@ void index_mail_set_cache_corrupted(struct mail *mail,
                break;
        case MAIL_FETCH_PHYSICAL_SIZE:
                field_name = "physical size";
-               imail->data.physical_size = (uoff_t)-1;
-               imail->data.virtual_size = (uoff_t)-1;
+               imail->data.physical_size = UOFF_T_MAX;
+               imail->data.virtual_size = UOFF_T_MAX;
                imail->data.parts = NULL;
                index_mail_reset_vsize_ext(mail);
                break;
        case MAIL_FETCH_VIRTUAL_SIZE:
                field_name = "virtual size";
-               imail->data.physical_size = (uoff_t)-1;
-               imail->data.virtual_size = (uoff_t)-1;
+               imail->data.physical_size = UOFF_T_MAX;
+               imail->data.virtual_size = UOFF_T_MAX;
                imail->data.parts = NULL;
                index_mail_reset_vsize_ext(mail);
                break;
index 3cb3571479735bf3bbbe580517490f20ed7c7264..147782387cd968b57a55191acdbdb5a73335384a 100644 (file)
@@ -20,7 +20,7 @@ static bool i_stream_mail_try_get_cached_size(struct mail_istream *mstream)
        struct mail *mail = mstream->mail;
        enum mail_lookup_abort orig_lookup_abort;
 
-       if (mstream->expected_size != (uoff_t)-1)
+       if (mstream->expected_size != UOFF_T_MAX)
                return TRUE;
 
        /* make sure this call doesn't change any existing error message,
@@ -29,10 +29,10 @@ static bool i_stream_mail_try_get_cached_size(struct mail_istream *mstream)
        orig_lookup_abort = mail->lookup_abort;
        mail->lookup_abort = MAIL_LOOKUP_ABORT_NOT_IN_CACHE;
        if (mail_get_physical_size(mail, &mstream->expected_size) < 0)
-               mstream->expected_size = (uoff_t)-1;
+               mstream->expected_size = UOFF_T_MAX;
        mail->lookup_abort = orig_lookup_abort;
        mail_storage_last_error_pop(mail->box->storage);
-       return mstream->expected_size != (uoff_t)-1;
+       return mstream->expected_size != UOFF_T_MAX;
 }
 
 static const char *
@@ -158,7 +158,7 @@ struct istream *i_stream_create_mail(struct mail *mail, struct istream *input,
        mstream = i_new(struct mail_istream, 1);
        mstream->mail = mail;
        mstream->input_has_body = input_has_body;
-       mstream->expected_size = (uoff_t)-1;
+       mstream->expected_size = UOFF_T_MAX;
        (void)i_stream_mail_try_get_cached_size(mstream);
        mstream->istream.max_buffer_size = input->real_stream->max_buffer_size;
        mstream->istream.stream_size_passthrough = TRUE;
index cab68b565f6bea362ebdd81e77e6dd0840f869d9..1645ddb455266d68e977650e27cdddefd526fcad 100644 (file)
@@ -115,9 +115,9 @@ maildir_copy_hardlink(struct mail_save_context *ctx, struct mail *mail)
        old_abort = mail->lookup_abort;
        mail->lookup_abort = MAIL_LOOKUP_ABORT_READ_MAIL;
        if (mail_get_physical_size(mail, &size) < 0)
-               size = (uoff_t)-1;
+               size = UOFF_T_MAX;
        if (mail_get_virtual_size(mail, &vsize) < 0)
-               vsize = (uoff_t)-1;
+               vsize = UOFF_T_MAX;
        maildir_save_set_sizes(mf, size, vsize);
        mail->lookup_abort = old_abort;
        return 1;
index 24197706fe90f44c2abd4e4c10159a54b08e5297..7f4e55cd423ae03bf84b204e603224f66722a3ec 100644 (file)
@@ -392,9 +392,9 @@ static int maildir_mail_get_virtual_size(struct mail *_mail, uoff_t *size_r)
                        return -1;
        }
 
-       if (data->virtual_size == (uoff_t)-1) {
+       if (data->virtual_size == UOFF_T_MAX) {
                if (index_mail_get_cached_virtual_size(mail, size_r)) {
-                       i_assert(mail->data.virtual_size != (uoff_t)-1);
+                       i_assert(mail->data.virtual_size != UOFF_T_MAX);
                        maildir_handle_size_caching(mail, TRUE, TRUE);
                        return 0;
                }
@@ -402,7 +402,7 @@ static int maildir_mail_get_virtual_size(struct mail *_mail, uoff_t *size_r)
                                              &data->virtual_size) < 0)
                        return -1;
        }
-       if (data->virtual_size != (uoff_t)-1) {
+       if (data->virtual_size != UOFF_T_MAX) {
                data->dont_cache_fetch_fields |= MAIL_FETCH_VIRTUAL_SIZE;
                *size_r = data->virtual_size;
                return 0;
@@ -438,9 +438,9 @@ static int maildir_mail_get_physical_size(struct mail *_mail, uoff_t *size_r)
                        return -1;
        }
 
-       if (data->physical_size == (uoff_t)-1) {
+       if (data->physical_size == UOFF_T_MAX) {
                if (index_mail_get_physical_size(_mail, size_r) == 0) {
-                       i_assert(mail->data.physical_size != (uoff_t)-1);
+                       i_assert(mail->data.physical_size != UOFF_T_MAX);
                        maildir_handle_size_caching(mail, TRUE, FALSE);
                        return 0;
                }
@@ -448,7 +448,7 @@ static int maildir_mail_get_physical_size(struct mail *_mail, uoff_t *size_r)
                                              &data->physical_size) < 0)
                        return -1;
        }
-       if (data->physical_size != (uoff_t)-1) {
+       if (data->physical_size != UOFF_T_MAX) {
                data->dont_cache_fetch_fields |= MAIL_FETCH_PHYSICAL_SIZE;
                *size_r = data->physical_size;
                return 0;
@@ -676,7 +676,7 @@ do_fix_size(struct maildir_mailbox *mbox, const char *path,
        info = strchr(fname, MAILDIR_INFO_SEP);
        if (info == NULL) info = "";
 
-       if (ctx->physical_size == (uoff_t)-1) {
+       if (ctx->physical_size == UOFF_T_MAX) {
                if (stat(path, &st) < 0) {
                        if (errno == ENOENT)
                                return 0;
@@ -728,7 +728,7 @@ maildir_mail_remove_sizes_from_filename(struct mail *mail,
                return;
 
        i_zero(&ctx);
-       ctx.physical_size = (uoff_t)-1;
+       ctx.physical_size = UOFF_T_MAX;
        if (field == MAIL_FETCH_VIRTUAL_SIZE &&
            maildir_filename_get_size(fname, MAILDIR_EXTRA_VIRTUAL_SIZE,
                                      &size)) {
index 372d421a52bfe977729c1afcd08dc5c4c5426883..b8dbe569af941ca18863f8d4a8ff3b575dcb792b 100644 (file)
@@ -163,8 +163,8 @@ maildir_save_add(struct mail_save_context *_ctx, const char *tmp_fname,
        mf = p_new(ctx->pool, struct maildir_filename, 1);
        mf->tmp_name = mf->dest_basename = p_strdup(ctx->pool, tmp_fname);
        mf->flags = mdata->flags;
-       mf->size = (uoff_t)-1;
-       mf->vsize = (uoff_t)-1;
+       mf->size = UOFF_T_MAX;
+       mf->vsize = UOFF_T_MAX;
 
        ctx->file_last = mf;
        i_assert(*ctx->files_tail == NULL);
@@ -236,12 +236,12 @@ maildir_get_dest_filename(struct maildir_save_context *ctx,
 {
        const char *basename = mf->dest_basename;
 
-       if (mf->size != (uoff_t)-1 && !mf->preserve_filename) {
+       if (mf->size != UOFF_T_MAX && !mf->preserve_filename) {
                basename = t_strdup_printf("%s,%c=%"PRIuUOFF_T, basename,
                                           MAILDIR_EXTRA_FILE_SIZE, mf->size);
        }
 
-       if (mf->vsize != (uoff_t)-1 && !mf->preserve_filename) {
+       if (mf->vsize != UOFF_T_MAX && !mf->preserve_filename) {
                basename = t_strdup_printf("%s,%c=%"PRIuUOFF_T, basename,
                                           MAILDIR_EXTRA_VIRTUAL_SIZE,
                                           mf->vsize);
@@ -308,7 +308,7 @@ int maildir_save_file_get_size(struct mailbox_transaction_context *t,
        struct maildir_filename *mf = maildir_save_get_mf(t, seq);
 
        *size_r = vsize ? mf->vsize : mf->size;
-       return *size_r == (uoff_t)-1 ? -1 : 0;
+       return *size_r == UOFF_T_MAX ? -1 : 0;
 }
 
 const char *maildir_save_file_get_path(struct mailbox_transaction_context *t,
@@ -561,7 +561,7 @@ static int maildir_save_finish_real(struct mail_save_context *_ctx)
        if (ctx->cur_dest_mail == NULL ||
            mail_get_virtual_size(ctx->cur_dest_mail,
                                  &ctx->file_last->vsize) < 0)
-               ctx->file_last->vsize = (uoff_t)-1;
+               ctx->file_last->vsize = UOFF_T_MAX;
 
        output_errno = _ctx->data.output->stream_errno;
        output_errstr = t_strdup(o_stream_get_error(_ctx->data.output));
@@ -826,10 +826,10 @@ maildir_filename_check_conflicts(struct maildir_save_context *ctx,
 
        if (!maildir_filename_get_size(mf->dest_basename,
                                       MAILDIR_EXTRA_FILE_SIZE, &size))
-               size = (uoff_t)-1;
+               size = UOFF_T_MAX;
        if (!maildir_filename_get_size(mf->dest_basename,
                                       MAILDIR_EXTRA_VIRTUAL_SIZE, &vsize))
-               vsize = (uoff_t)-1;
+               vsize = UOFF_T_MAX;
 
        if (size != mf->size || vsize != mf->vsize ||
            !ctx->locked_uidlist_refresh ||
@@ -841,9 +841,9 @@ maildir_filename_check_conflicts(struct maildir_save_context *ctx,
 
                   b) file already exists. give it another name.
                   but preserve the size/vsize in the filename if possible */
-               if (mf->size == (uoff_t)-1)
+               if (mf->size == UOFF_T_MAX)
                        mf->size = size;
-               if (mf->vsize == (uoff_t)-1)
+               if (mf->vsize == UOFF_T_MAX)
                        mf->vsize = size;
 
                mf->guid = mf->dest_basename;
index d4fb2ba7249eb704e9c97b3d2d8d8183e85e06e7..5562fd9dbeee612a4dd6ff77ae8378991827d221 100644 (file)
@@ -1249,7 +1249,7 @@ static int maildir_uidlist_write_fd(struct maildir_uidlist *uidlist, int fd,
 
        i_assert(fd != -1);
 
-       output = o_stream_create_fd_file(fd, (uoff_t)-1, FALSE);
+       output = o_stream_create_fd_file(fd, UOFF_T_MAX, FALSE);
        o_stream_cork(output);
        str = t_str_new(512);
 
index eaf639141440d84321e6b2a4a38a2e27fe99fe77..1a1df3aaeeceb0430c628d150b179f992626e473 100644 (file)
@@ -140,7 +140,7 @@ static void handle_end_of_mail(struct raw_mbox_istream *rstream, size_t pos)
                uoff_t new_body_offset =
                        rstream->hdr_offset + rstream->mail_size;
 
-               if (rstream->body_offset != (uoff_t)-1) {
+               if (rstream->body_offset != UOFF_T_MAX) {
                        /* Header didn't have ending \n */
                        rstream->header_missing_eoh = TRUE;
                } else {
@@ -149,7 +149,7 @@ static void handle_end_of_mail(struct raw_mbox_istream *rstream, size_t pos)
                }
 
                /* The +2 check is for CR+LF linefeeds */
-               i_assert(rstream->body_offset == (uoff_t)-1 ||
+               i_assert(rstream->body_offset == UOFF_T_MAX ||
                         rstream->body_offset == new_body_offset + 1 ||
                         rstream->body_offset == new_body_offset + 2);
                rstream->body_offset = new_body_offset;
@@ -277,7 +277,7 @@ static ssize_t i_stream_raw_mbox_read(struct istream_private *stream)
        /* See if we have From-line here - note that it works right only
           because all characters are different in mbox_from. */
         fromp = mbox_from; from_start_pos = from_after_pos = SIZE_MAX;
-       eoh_char = rstream->body_offset == (uoff_t)-1 ? '\n' : -1;
+       eoh_char = rstream->body_offset == UOFF_T_MAX ? '\n' : -1;
        for (i = stream->pos; i < pos; i++) {
                if (buf[i] == eoh_char &&
                    ((i > 0 && buf[i-1] == '\n') ||
@@ -300,7 +300,7 @@ static ssize_t i_stream_raw_mbox_read(struct istream_private *stream)
                                        from_start_pos = i - 6;
                                }
 
-                               if (rstream->mail_size == (uoff_t)-1 ||
+                               if (rstream->mail_size == UOFF_T_MAX ||
                                    rstream->hdr_offset + rstream->mail_size ==
                                    stream->istream.v_offset + from_start_pos) {
                                        from_after_pos = i;
@@ -423,7 +423,7 @@ i_stream_raw_mbox_stat(struct istream_private *stream, bool exact)
 
        stream->statbuf = *st;
        stream->statbuf.st_size =
-               !exact && rstream->seeked && rstream->mail_size != (uoff_t)-1 ?
+               !exact && rstream->seeked && rstream->mail_size != UOFF_T_MAX ?
                (off_t)rstream->mail_size : -1;
        return 0;
 }
@@ -436,8 +436,8 @@ struct istream *i_stream_create_raw_mbox(struct istream *input)
 
        rstream = i_new(struct raw_mbox_istream, 1);
 
-       rstream->body_offset = (uoff_t)-1;
-       rstream->mail_size = (uoff_t)-1;
+       rstream->body_offset = UOFF_T_MAX;
+       rstream->mail_size = UOFF_T_MAX;
        rstream->received_time = (time_t)-1;
        rstream->next_received_time = (time_t)-1;
 
@@ -544,14 +544,14 @@ int istream_raw_mbox_get_body_offset(struct istream *stream,
 
        i_assert(rstream->seeked);
 
-       if (rstream->body_offset != (uoff_t)-1) {
+       if (rstream->body_offset != UOFF_T_MAX) {
                *body_offset_r = rstream->body_offset;
                return 0;
        }
 
        offset = stream->v_offset;
        i_stream_seek(stream, rstream->hdr_offset);
-       while (rstream->body_offset == (uoff_t)-1) {
+       while (rstream->body_offset == UOFF_T_MAX) {
                i_stream_skip(stream, i_stream_get_data_size(stream));
 
                if (i_stream_read(stream) < 0) {
@@ -561,7 +561,7 @@ int istream_raw_mbox_get_body_offset(struct istream *stream,
                                        i_stream_get_name(stream),
                                        rstream->from_offset);
                        } else {
-                               i_assert(rstream->body_offset != (uoff_t)-1);
+                               i_assert(rstream->body_offset != UOFF_T_MAX);
                        }
                        return -1;
                }
@@ -583,19 +583,19 @@ int istream_raw_mbox_get_body_size(struct istream *stream,
        uoff_t old_offset, body_offset, body_size, next_body_offset;
 
        i_assert(rstream->seeked);
-       i_assert(rstream->hdr_offset != (uoff_t)-1);
+       i_assert(rstream->hdr_offset != UOFF_T_MAX);
 
        if (istream_raw_mbox_get_body_offset(stream, &body_offset) < 0)
                return -1;
-       body_size = rstream->mail_size == (uoff_t)-1 ? (uoff_t)-1 :
+       body_size = rstream->mail_size == UOFF_T_MAX ? UOFF_T_MAX :
                rstream->mail_size - (rstream->body_offset -
                                      rstream->hdr_offset);
        old_offset = stream->v_offset;
-       if (expected_body_size != (uoff_t)-1) {
+       if (expected_body_size != UOFF_T_MAX) {
                /* if we already have the existing body size, use it as long as
                   it's >= expected body_size. otherwise the previous parsing
                   may have stopped at a From_-line that belongs to the body. */
-               if (body_size != (uoff_t)-1 && body_size >= expected_body_size) {
+               if (body_size != UOFF_T_MAX && body_size >= expected_body_size) {
                        *body_size_r = body_size;
                        return 0;
                }
@@ -622,7 +622,7 @@ int istream_raw_mbox_get_body_size(struct istream *stream,
                }
                /* invalid expected_body_size */
        }
-       if (body_size != (uoff_t)-1) {
+       if (body_size != UOFF_T_MAX) {
                *body_size_r = body_size;
                return 0;
        }
@@ -634,7 +634,7 @@ int istream_raw_mbox_get_body_size(struct istream *stream,
        if (stream->stream_errno != 0)
                return -1;
 
-       i_assert(rstream->mail_size != (uoff_t)-1);
+       i_assert(rstream->mail_size != UOFF_T_MAX);
        *body_size_r = rstream->mail_size -
                (rstream->body_offset - rstream->hdr_offset);
        return 0;
@@ -683,7 +683,7 @@ int istream_raw_mbox_next(struct istream *stream, uoff_t expected_body_size)
        if (istream_raw_mbox_get_body_size(stream, expected_body_size,
                                           &body_size) < 0)
                return -1;
-       rstream->mail_size = (uoff_t)-1;
+       rstream->mail_size = UOFF_T_MAX;
 
        rstream->received_time = rstream->next_received_time;
        rstream->next_received_time = (time_t)-1;
@@ -694,7 +694,7 @@ int istream_raw_mbox_next(struct istream *stream, uoff_t expected_body_size)
 
        rstream->from_offset = rstream->body_offset + body_size;
        rstream->hdr_offset = rstream->from_offset;
-       rstream->body_offset = (uoff_t)-1;
+       rstream->body_offset = UOFF_T_MAX;
        rstream->header_missing_eoh = FALSE;
 
        if (stream->v_offset != rstream->from_offset)
@@ -723,17 +723,17 @@ int istream_raw_mbox_seek(struct istream *stream, uoff_t offset)
 
        /* if seeked is FALSE, we unlocked in the middle. don't try to use
           any cached state then. */
-       if (rstream->mail_size != (uoff_t)-1 && rstream->seeked &&
+       if (rstream->mail_size != UOFF_T_MAX && rstream->seeked &&
            rstream->hdr_offset + rstream->mail_size == offset)
-               return istream_raw_mbox_next(stream, (uoff_t)-1);
+               return istream_raw_mbox_next(stream, UOFF_T_MAX);
 
        if (offset == rstream->from_offset && rstream->seeked) {
                /* back to beginning of current message */
                offset = rstream->hdr_offset;
                check = offset == 0;
        } else {
-               rstream->body_offset = (uoff_t)-1;
-               rstream->mail_size = (uoff_t)-1;
+               rstream->body_offset = UOFF_T_MAX;
+               rstream->mail_size = UOFF_T_MAX;
                rstream->received_time = (time_t)-1;
                rstream->next_received_time = (time_t)-1;
                rstream->header_missing_eoh = FALSE;
@@ -762,7 +762,7 @@ void istream_raw_mbox_set_next_offset(struct istream *stream, uoff_t offset)
        struct raw_mbox_istream *rstream =
                (struct raw_mbox_istream *)stream->real_stream;
 
-       i_assert(rstream->hdr_offset != (uoff_t)-1);
+       i_assert(rstream->hdr_offset != UOFF_T_MAX);
 
        rstream->mail_size_forced = TRUE;
        rstream->mail_size = offset - rstream->hdr_offset;
index 3d81b55aa33f3662dd1ec4141d1847846cfeeabf..4543841834687b526aac06b6eef84c19af22c529 100644 (file)
@@ -16,7 +16,7 @@ int istream_raw_mbox_get_body_offset(struct istream *stream,
                                     uoff_t *body_offset_r);
 
 /* Return the number of bytes in the body of this message. If
-   expected_body_size isn't (uoff_t)-1, we'll use it as potentially valid body
+   expected_body_size isn't UOFF_T_MAX, we'll use it as potentially valid body
    size to avoid actually reading through the whole message. */
 int istream_raw_mbox_get_body_size(struct istream *stream,
                                   uoff_t expected_body_size,
@@ -31,7 +31,7 @@ const char *istream_raw_mbox_get_sender(struct istream *stream);
 /* Return TRUE if the empty line between this and the next mail contains CR. */
 bool istream_raw_mbox_has_crlf_ending(struct istream *stream);
 
-/* Jump to next message. If expected_body_size isn't (uoff_t)-1, we'll use it
+/* Jump to next message. If expected_body_size isn't UOFF_T_MAX, we'll use it
    as potentially valid body size. */
 int istream_raw_mbox_next(struct istream *stream, uoff_t expected_body_size);
 
index 0614970a9019112694eca482f33f3963a36ec4d3..557d409cf296268b9afddc4b730759c79da8cf7b 100644 (file)
@@ -244,7 +244,7 @@ mbox_mail_get_next_offset(struct index_mail *mail, uoff_t *next_offset_r)
        int trailer_size;
        int ret = 1;
 
-       *next_offset_r = (uoff_t)-1;
+       *next_offset_r = UOFF_T_MAX;
 
        hdr = mail_index_get_header(mail->mail.mail.transaction->view);
        if (mail->mail.mail.seq > hdr->messages_count) {
@@ -311,7 +311,7 @@ static int mbox_mail_get_physical_size(struct mail *_mail, uoff_t *size_r)
        if (mbox_mail_get_next_offset(mail, &next_offset) > 0)
                body_size = next_offset - body_offset;
        else
-               body_size = (uoff_t)-1;
+               body_size = UOFF_T_MAX;
 
        /* verify that the calculated body size is correct */
        if (istream_raw_mbox_get_body_size(mbox->mbox_stream,
@@ -357,10 +357,10 @@ static int mbox_mail_init_stream(struct index_mail *mail)
        }
        i_stream_seek(raw_stream, hdr_offset);
 
-       if (next_offset != (uoff_t)-1)
+       if (next_offset != UOFF_T_MAX)
                istream_raw_mbox_set_next_offset(raw_stream, next_offset);
 
-       raw_stream = i_stream_create_limit(raw_stream, (uoff_t)-1);
+       raw_stream = i_stream_create_limit(raw_stream, UOFF_T_MAX);
        mail->data.stream =
                i_stream_create_header_filter(raw_stream,
                                HEADER_FILTER_EXCLUDE | HEADER_FILTER_NO_CR,
index f5f45f88d91d3a8dc8360296464d30682d35861a..c7772668d110afca2ee3544851bfb8c978d90e17 100644 (file)
@@ -155,7 +155,7 @@ static int mbox_write_content_length(struct mbox_save_context *ctx)
        const char *str;
        size_t len;
 
-       i_assert(ctx->eoh_offset != (uoff_t)-1);
+       i_assert(ctx->eoh_offset != UOFF_T_MAX);
 
        if (ctx->mbox->mbox_writeonly) {
                /* we can't seek, don't set Content-Length */
@@ -283,7 +283,7 @@ mbox_save_init_file(struct mbox_save_context *ctx,
                return -1;
        }
 
-       if (ctx->append_offset == (uoff_t)-1) {
+       if (ctx->append_offset == UOFF_T_MAX) {
                /* first appended mail in this transaction */
                if (t->write_lock_id == 0) {
                        if (mbox_lock(mbox, F_WRLCK, &t->write_lock_id) <= 0)
@@ -309,7 +309,7 @@ mbox_save_init_file(struct mbox_save_context *ctx,
        }
 
        /* the syncing above could have changed the append offset */
-       if (ctx->append_offset == (uoff_t)-1) {
+       if (ctx->append_offset == UOFF_T_MAX) {
                if (mbox_seek_to_end(ctx, &ctx->append_offset) < 0)
                        return -1;
 
@@ -426,9 +426,9 @@ mbox_save_alloc(struct mailbox_transaction_context *t)
                ctx->ctx.transaction = t;
                ctx->mbox = mbox;
                ctx->trans = t->itrans;
-               ctx->append_offset = (uoff_t)-1;
+               ctx->append_offset = UOFF_T_MAX;
                ctx->headers = str_new(default_pool, 512);
-               ctx->mail_offset = (uoff_t)-1;
+               ctx->mail_offset = UOFF_T_MAX;
                t->save_ctx = &ctx->ctx;
        }
        return t->save_ctx;
@@ -501,7 +501,7 @@ int mbox_save_begin(struct mail_save_context *_ctx, struct istream *input)
        i_assert(ctx->mbox->mbox_lock_type == F_WRLCK);
 
        ctx->mail_offset = ctx->output->offset;
-       ctx->eoh_offset = (uoff_t)-1;
+       ctx->eoh_offset = UOFF_T_MAX;
        ctx->last_char = '\n';
 
        if (write_from_line(ctx, mdata->received_date, mdata->from_envelope) < 0)
@@ -548,7 +548,7 @@ static int mbox_save_body(struct mbox_save_context *ctx)
 
 static int mbox_save_finish_headers(struct mbox_save_context *ctx)
 {
-       i_assert(ctx->eoh_offset == (uoff_t)-1);
+       i_assert(ctx->eoh_offset == UOFF_T_MAX);
 
        /* append our own headers and ending empty line */
        ctx->extra_hdr_offset = ctx->output->offset;
@@ -571,7 +571,7 @@ int mbox_save_continue(struct mail_save_context *_ctx)
        if (ctx->failed)
                return -1;
 
-       if (ctx->eoh_offset != (uoff_t)-1) {
+       if (ctx->eoh_offset != UOFF_T_MAX) {
                /* writing body */
                return mbox_save_body(ctx);
        }
@@ -654,7 +654,7 @@ int mbox_save_finish(struct mail_save_context *_ctx)
 {
        struct mbox_save_context *ctx = MBOX_SAVECTX(_ctx);
 
-       if (!ctx->failed && ctx->eoh_offset == (uoff_t)-1)
+       if (!ctx->failed && ctx->eoh_offset == UOFF_T_MAX)
                (void)mbox_save_finish_headers(ctx);
 
        if (ctx->output != NULL) {
@@ -679,14 +679,14 @@ int mbox_save_finish(struct mail_save_context *_ctx)
        if (ctx->input != NULL)
                i_stream_destroy(&ctx->input);
 
-       if (ctx->failed && ctx->mail_offset != (uoff_t)-1) {
+       if (ctx->failed && ctx->mail_offset != UOFF_T_MAX) {
                /* saving this mail failed - truncate back to beginning of it */
                i_assert(ctx->output != NULL);
                (void)o_stream_flush(ctx->output);
                if (ftruncate(ctx->mbox->mbox_fd, (off_t)ctx->mail_offset) < 0)
                        mbox_set_syscall_error(ctx->mbox, "ftruncate()");
                (void)o_stream_seek(ctx->output, ctx->mail_offset);
-               ctx->mail_offset = (uoff_t)-1;
+               ctx->mail_offset = UOFF_T_MAX;
        }
 
        if (ctx->seq != 0 && ctx->failed) {
@@ -712,7 +712,7 @@ static void mbox_transaction_save_deinit(struct mbox_save_context *ctx)
 
 static void mbox_save_truncate(struct mbox_save_context *ctx)
 {
-       if (ctx->append_offset == (uoff_t)-1 || ctx->mbox->mbox_fd == -1)
+       if (ctx->append_offset == UOFF_T_MAX || ctx->mbox->mbox_fd == -1)
                return;
 
        i_assert(ctx->mbox->mbox_lock_type == F_WRLCK);
index 51bbb6da6fab67052b6da950a1200aad59c88444..bbc2da2dcfabb9c5b478a150b240f3883aa2d874 100644 (file)
@@ -412,7 +412,7 @@ static bool parse_content_length(struct mbox_sync_mail_context *ctx,
        uoff_t value = 0;
        size_t i;
 
-       if (ctx->content_length != (uoff_t)-1) {
+       if (ctx->content_length != UOFF_T_MAX) {
                /* duplicate */
                return FALSE;
        }
@@ -472,7 +472,7 @@ int mbox_sync_parse_next_mail(struct istream *input,
        for (i = 0; i < MBOX_HDR_COUNT; i++)
                ctx->hdr_pos[i] = SIZE_MAX;
 
-       ctx->content_length = (uoff_t)-1;
+       ctx->content_length = UOFF_T_MAX;
        str_truncate(ctx->header, 0);
 
         mbox_md5_ctx = ctx->sync_ctx->mbox->md5_v.init();
index c7f19c5a1eb0735cbab914d780e97bfed6efe11f..78180eb1b98cf112dabcd6f3a5e77f47882bea3c 100644 (file)
@@ -28,7 +28,7 @@ int mbox_move(struct mbox_sync_context *sync_ctx,
 
        i_stream_sync(sync_ctx->input);
 
-       output = o_stream_create_fd_file(sync_ctx->write_fd, (uoff_t)-1, FALSE);
+       output = o_stream_create_fd_file(sync_ctx->write_fd, UOFF_T_MAX, FALSE);
        i_stream_seek(sync_ctx->file_input, source);
        if (o_stream_seek(output, dest) < 0) {
                mbox_set_syscall_error(sync_ctx->mbox,
index 36e7e1e5b102067d92e8ef7ea9d33c6c3d9f0e0b..ee73052d9b50896a4d29530498943ba95cb916c1 100644 (file)
@@ -254,7 +254,7 @@ static void mbox_sync_add_missing_headers(struct mbox_sync_mail_context *ctx)
                str_append_c(ctx->header, '\n');
        }
 
-       if (ctx->content_length == (uoff_t)-1 &&
+       if (ctx->content_length == UOFF_T_MAX &&
            ctx->mail.body_size >= MBOX_MIN_CONTENT_LENGTH_SIZE) {
                str_printfa(ctx->header, "Content-Length: %"PRIuUOFF_T"\n",
                            ctx->mail.body_size);
index 1198610b30be1f02c5ab0c102bd305b650d92884..a0939ac8f206fd51c1e1b9b4c663f59a2fd8a4c8 100644 (file)
@@ -639,7 +639,7 @@ static void mbox_sync_handle_expunge(struct mbox_sync_mail_context *mail_ctx)
 static int mbox_sync_handle_header(struct mbox_sync_mail_context *mail_ctx)
 {
        struct mbox_sync_context *sync_ctx = mail_ctx->sync_ctx;
-       uoff_t orig_from_offset, postlf_from_offset = (uoff_t)-1;
+       uoff_t orig_from_offset, postlf_from_offset = UOFF_T_MAX;
        off_t move_diff;
        int ret;
 
@@ -715,7 +715,7 @@ static int mbox_sync_handle_header(struct mbox_sync_mail_context *mail_ctx)
                           from_offset to point to the beginning of the
                           From-line, because the previous [CR]LF is already
                           covered by expunged_space. */
-                       i_assert(postlf_from_offset != (uoff_t)-1);
+                       i_assert(postlf_from_offset != UOFF_T_MAX);
                        mail_ctx->mail.from_offset = postlf_from_offset;
 
                        i_zero(&mail);
index eb39a8cda8ebdd5c93097992e32c03f39498bcd0..860becb1e3f958749d61ce6a7fd7d8c2bb5b0dd2 100644 (file)
@@ -75,7 +75,7 @@ static int pop3c_mail_get_physical_size(struct mail *_mail, uoff_t *size_r)
        struct message_size hdr_size, body_size;
        struct istream *input;
 
-       if (mail->data.virtual_size != (uoff_t)-1) {
+       if (mail->data.virtual_size != UOFF_T_MAX) {
                /* virtual size is already known. it's the same as our
                   (correct) physical size */
                *size_r = mail->data.virtual_size;
@@ -104,7 +104,7 @@ static int pop3c_mail_get_physical_size(struct mail *_mail, uoff_t *size_r)
        if (mail_get_stream(_mail, &hdr_size, &body_size, &input) < 0)
                return -1;
 
-       i_assert(mail->data.physical_size != (uoff_t)-1);
+       i_assert(mail->data.physical_size != UOFF_T_MAX);
        *size_r = mail->data.physical_size;
        return 0;
 }
index 2c473fef1b7cd7876f73199080f21cc70aaa7ee7..23143c33d920d90b51e9330ffb69d1fe13ad21ba 100644 (file)
@@ -68,7 +68,7 @@ static int raw_mail_get_physical_size(struct mail *_mail, uoff_t *size_r)
        struct index_mail *mail = INDEX_MAIL(_mail);
        struct raw_mailbox *mbox = RAW_MAILBOX(_mail->box);
 
-       if (mbox->size == (uoff_t)-1) {
+       if (mbox->size == UOFF_T_MAX) {
                if (raw_mail_stat(_mail) < 0)
                        return -1;
        }
@@ -88,7 +88,7 @@ raw_mail_get_stream(struct mail *_mail, bool get_body ATTR_UNUSED,
                /* we can't just reference mbox->input, because
                   index_mail_close() expects to be able to free the stream */
                mail->data.stream =
-                       i_stream_create_limit(_mail->box->input, (uoff_t)-1);
+                       i_stream_create_limit(_mail->box->input, UOFF_T_MAX);
        }
 
        return index_mail_init_stream(mail, hdr_size, body_size, stream_r);
index 928d037d056bc4660b6df172feb252e20a28ab55..b54d27b31f711b9e675f566067cbe823a8fea280 100644 (file)
@@ -141,7 +141,7 @@ raw_mailbox_alloc(struct mail_storage *storage, struct mailbox_list *list,
 
        mbox->mtime = mbox->ctime = (time_t)-1;
        mbox->storage = RAW_STORAGE(storage);
-       mbox->size = (uoff_t)-1;
+       mbox->size = UOFF_T_MAX;
        return &mbox->box;
 }
 
index 936bc816d5d14236e7d9e337b0235f7c94d90ca6..008021e33af1e81d7df0e89a018068e9a9f44049 100644 (file)
@@ -116,8 +116,8 @@ ssize_t file_cache_read(struct file_cache *cache, uoff_t offset, size_t size)
                   doesn't have to deal with any extra checks. */
                size = SSIZE_T_MAX;
        }
-       if (offset >= (uoff_t)-1 - size)
-               size = (uoff_t)-1 - offset;
+       if (offset >= UOFF_T_MAX - size)
+               size = UOFF_T_MAX - offset;
 
        if (offset + size > cache->mmap_length &&
            offset + size - cache->mmap_length > 1024*1024) {
@@ -241,7 +241,7 @@ void file_cache_write(struct file_cache *cache, const void *data, size_t size,
        unsigned int first_page, last_page;
 
        i_assert(page_size > 0);
-       i_assert((uoff_t)-1 - offset > size);
+       i_assert(UOFF_T_MAX - offset > size);
 
        if (file_cache_set_size(cache, offset + size) < 0) {
                /* couldn't grow mapping. just make sure the written memory
index 6bea2647ac6bf8e719bb5d49a2c316c2ad5b2e67..95e417324453e37bc582465246e05203f25050b1 100644 (file)
@@ -309,7 +309,7 @@ i_stream_concat_stat(struct istream_private *stream, bool exact ATTR_UNUSED)
 {
        struct concat_istream *cstream = (struct concat_istream *)stream;
        i_assert(cstream->cur_input == cstream->input[cstream->cur_idx]);
-       uoff_t v_offset = (uoff_t)-1;
+       uoff_t v_offset = UOFF_T_MAX;
        unsigned int i, cur_idx;
 
        /* make sure we have all sizes */
index c3cf5b92667c188a7a37514e39ce5ca1be9a659c..222d46f7fb2fe180b03cfa55df9fd696823c4316 100644 (file)
@@ -52,7 +52,7 @@ i_stream_failure_at_read(struct istream_private *stream)
                        stream->pos = new_pos;
                }
        } else if (ret < 0 && stream->istream.stream_errno == 0 &&
-                  fstream->failure_offset == (uoff_t)-1) {
+                  fstream->failure_offset == UOFF_T_MAX) {
                /* failure at EOF */
                stream->istream.stream_errno = errno =
                        fstream->error_code;
@@ -90,6 +90,6 @@ struct istream *
 i_stream_create_failure_at_eof(struct istream *input, int stream_errno,
                               const char *error_string)
 {
-       return i_stream_create_failure_at(input, (uoff_t)-1, stream_errno,
+       return i_stream_create_failure_at(input, UOFF_T_MAX, stream_errno,
                                          error_string);
 }
index 53c035218b2167b19ad6ce11ca347843c74149fa..7379b23815ffb34e7727e72752ca32654b4fbfac 100644 (file)
@@ -54,7 +54,7 @@ static ssize_t i_stream_limit_read(struct istream_private *stream)
        if (ret == -2)
                return -2;
 
-       if (lstream->v_size != (uoff_t)-1) {
+       if (lstream->v_size != UOFF_T_MAX) {
                left = lstream->v_size - stream->istream.v_offset;
                if (pos >= left) {
                        pos = left;
@@ -82,7 +82,7 @@ i_stream_limit_stat(struct istream_private *stream, bool exact)
        }
 
        stream->statbuf = *st;
-       if (lstream->v_size != (uoff_t)-1)
+       if (lstream->v_size != UOFF_T_MAX)
                stream->statbuf.st_size = lstream->v_size;
        return 0;
 }
@@ -93,7 +93,7 @@ static int i_stream_limit_get_size(struct istream_private *stream,
        struct limit_istream *lstream = (struct limit_istream *) stream;
        const struct stat *st;
 
-       if (lstream->v_size != (uoff_t)-1) {
+       if (lstream->v_size != UOFF_T_MAX) {
                *size_r = lstream->v_size;
                return 1;
        }
index 92439cd33af0dc17a4b8e72fc6a406f3ad6a65fa..ac31294859d30ff862466f5779d5bb63f7dd3959 100644 (file)
@@ -45,7 +45,7 @@ struct istream_private {
 
        struct istream *parent; /* for filter streams */
        uoff_t parent_start_offset;
-       /* Initially (uoff_t)-1. Otherwise it's the exact known stream size,
+       /* Initially UOFF_T_MAX. Otherwise it's the exact known stream size,
           which can be used by stat() / get_size(). */
        uoff_t cached_stream_size;
 
index b4bd3d858a39f51be867f470d7d24a4835b2146b..9750cbd67eb7b58c34ca85a6d86c30bb34be4ed4 100644 (file)
@@ -334,7 +334,7 @@ i_stream_seekable_stat(struct istream_private *stream, bool exact)
        uoff_t old_offset, len;
        ssize_t ret;
 
-       if (sstream->size != (uoff_t)-1) {
+       if (sstream->size != UOFF_T_MAX) {
                /* we've already reached EOF and know the size */
                stream->statbuf.st_size = sstream->size;
                return 0;
@@ -434,7 +434,7 @@ i_streams_merge(struct istream *input[], size_t max_buffer_size,
        sstream->context = context;
         sstream->istream.max_buffer_size = max_buffer_size;
        sstream->fd = -1;
-       sstream->size = (uoff_t)-1;
+       sstream->size = UOFF_T_MAX;
 
        sstream->input = i_new(struct istream *, count + 1);
        memcpy(sstream->input, input, sizeof(*input) * count);
index 1858716b64c466f88c4005c86a198b25bb673bbe..268b720be47d240df197229880144d9a9d7440ae 100644 (file)
@@ -205,7 +205,7 @@ struct tee_istream *tee_i_stream_create(struct istream *input)
                i_stream_ref(input);
                tee->input = input;
        } else {
-               tee->input = i_stream_create_limit(input, (uoff_t)-1);
+               tee->input = i_stream_create_limit(input, UOFF_T_MAX);
        }
        return tee;
 }
index 95cf54d25113204908d6a8c8ed208071bb1db9bc..4b5e810df03c541ce8cee860e9e79acdee74ba6a 100644 (file)
@@ -1080,7 +1080,7 @@ bool i_stream_nonseekable_try_seek(struct istream_private *stream,
 static int
 seekable_i_stream_get_size(struct istream_private *stream)
 {
-       if (stream->cached_stream_size == (uoff_t)-1) {
+       if (stream->cached_stream_size == UOFF_T_MAX) {
                uoff_t old_offset = stream->istream.v_offset;
                ssize_t ret;
 
@@ -1201,7 +1201,7 @@ i_stream_create(struct istream_private *_stream, struct istream *parent, int fd,
        _stream->statbuf.st_atime =
                _stream->statbuf.st_mtime =
                _stream->statbuf.st_ctime = ioloop_time;
-       _stream->cached_stream_size = (uoff_t)-1;
+       _stream->cached_stream_size = UOFF_T_MAX;
 
        io_stream_init(&_stream->iostream);
 
index b1f3f9f592a0d3fa31057793d4561f9420f25053..f49c657ea07e2d22c460a66f9a282d098ae85115 100644 (file)
@@ -1102,7 +1102,7 @@ o_stream_create_fd_file(int fd, uoff_t offset, bool autoclose_fd)
        struct file_ostream *fstream;
        struct ostream *ostream;
 
-       if (offset == (uoff_t)-1)
+       if (offset == UOFF_T_MAX)
                offset = lseek(fd, 0, SEEK_CUR);
 
        fstream = i_new(struct file_ostream, 1);
index 7bebfb49fc42dcdedbbad46dcf69a2f949bfe546..a43e8043ada56c6a8d824a186b0a5e4529add667 100644 (file)
@@ -60,7 +60,7 @@ struct ostream *o_stream_create_fd(int fd, size_t max_buffer_size);
 /* The fd is set to -1 immediately to avoid accidentally closing it twice. */
 struct ostream *o_stream_create_fd_autoclose(int *fd, size_t max_buffer_size);
 /* Create an output stream from a regular file which begins at given offset.
-   If offset==(uoff_t)-1, the current offset isn't known. */
+   If offset==UOFF_T_MAX, the current offset isn't known. */
 struct ostream *
 o_stream_create_fd_file(int fd, uoff_t offset, bool autoclose_fd);
 struct ostream *o_stream_create_fd_file_autoclose(int *fd, uoff_t offset);
index 217dfbd8403deb77ce53aff202a193a34d08e10e..2d0cdea3179f4f05991f7a97f70fb2be5d9ebb3a 100644 (file)
@@ -427,7 +427,7 @@ int str_to_uoff(const char *str, uoff_t *num_r)
        if (str_to_uintmax(str, &l) < 0)
                return -1;
 
-       if (l > (uoff_t)-1)
+       if (l > UOFF_T_MAX)
                return -1;
        *num_r = (uoff_t)l;
        return 0;
index ca251d1ed2bcd852ab3011239ba2a3ae5090cc78..cfb8658604bfd67b83f9f6bf76c9ba9cb239c477 100644 (file)
@@ -123,7 +123,7 @@ static void test_iostream_temp_istream(void)
 
        /* non-working fd-dup: send two istreams */
        i_stream_seek(input, 0);
-       input2 = i_stream_create_limit(input, (uoff_t)-1);
+       input2 = i_stream_create_limit(input, UOFF_T_MAX);
        output = iostream_temp_create_sized(".intentional-nonexistent-error/",
                IOSTREAM_TEMP_FLAG_TRY_FD_DUP, "test", 4);
        test_assert(o_stream_send_istream(output, input) == OSTREAM_SEND_ISTREAM_RESULT_FINISHED);
index f36377bbc3b16ece375b8c43a7056d9c630fc6f1..7f0006af22e3f81f186ad8e3e8ed26c9c4f84030 100644 (file)
@@ -83,7 +83,7 @@ static bool test_istream_concat_random(void)
        if (simult > 0) {
                limits = t_new(struct istream *, simult);
                for (i = 0; i < simult; i++)
-                       limits[i] = i_stream_create_limit(concat, (uoff_t)-1);
+                       limits[i] = i_stream_create_limit(concat, UOFF_T_MAX);
        }
 
        for (i = 0; i < 1000; i++) {
index 5e404e82d04cece6258e2afd3b312b5ceba3e095..82fa6631f3380a4267c898af5e2c081dfebedfc8 100644 (file)
@@ -14,7 +14,7 @@ static const struct {
        { "a", 1, 0 },
        { "ab", 1, EINVAL },
        { "ab", 0, EINVAL },
-       { "ab", (uoff_t)-1, EPIPE },
+       { "ab", UOFF_T_MAX, EPIPE },
 };
 
 static void
index e97d3499e3171d0fc3f4fff4c4f7f72222fd223a..58a2e1aa9dca435c0dc78d604e5f40d229de74f3 100644 (file)
@@ -15,8 +15,8 @@ static void test_istream_children(void)
        parent = test_istream_create_data("123456789", 9);
        test_istream_set_max_buffer_size(parent, 3);
 
-       child1 = i_stream_create_limit(parent, (uoff_t)-1);
-       child2 = i_stream_create_limit(parent, (uoff_t)-1);
+       child1 = i_stream_create_limit(parent, UOFF_T_MAX);
+       child2 = i_stream_create_limit(parent, UOFF_T_MAX);
 
        /* child1 read beginning */
        test_assert(i_stream_read(child1) == 3);
index 47c0c88a2400c1fbc3c6289096dd5ed5829eed1e..7cb912687312d34e0212f37b0d81ad706a684683 100644 (file)
@@ -195,7 +195,7 @@ struct client *client_create(int fd_in, int fd_out,
                lmtp_set.capabilities |= SMTP_CAPABILITY_STARTTLS;
        lmtp_set.hostname = client->unexpanded_lda_set->hostname;
        lmtp_set.login_greeting = client->lmtp_set->login_greeting;
-       lmtp_set.max_message_size = (uoff_t)-1;
+       lmtp_set.max_message_size = UOFF_T_MAX;
        lmtp_set.rcpt_param_extensions = rcpt_param_extensions;
        lmtp_set.rcpt_domain_optional = TRUE;
        lmtp_set.max_client_idle_time_msecs = CLIENT_IDLE_TIMEOUT_MSECS;
index d7eeabdf2249d0a573a435a6fb111c7d528f6c0b..28434c7a815fcded8b9ebfdc071405c3ab1efa51 100644 (file)
@@ -795,7 +795,7 @@ void lmtp_proxy_data(struct client *client,
                e_error(client->event,
                        "i_stream_get_size(data_input) failed: %s",
                        i_stream_get_error(proxy->data_input));
-               size = (uoff_t)-1;
+               size = UOFF_T_MAX;
        }
 
        /* Create the data_input streams first */
@@ -807,9 +807,9 @@ void lmtp_proxy_data(struct client *client,
                        continue;
                }
 
-               if (size == (uoff_t)-1) {
+               if (size == UOFF_T_MAX) {
                        conn->data_input =
-                               i_stream_create_limit(data_input, (uoff_t)-1);
+                               i_stream_create_limit(data_input, UOFF_T_MAX);
                } else {
                        conn->data_input =
                                i_stream_create_sized(data_input, size);
index 1d19d8ea74cf3d18a89259a1e940fb957c237a31..3b4a3071dc95d966d5e8426ff72c61f7f12c04b0 100644 (file)
@@ -46,7 +46,7 @@ struct service_settings lmtp_service_settings = {
        .client_limit = 1,
        .service_count = 0,
        .idle_kill = 0,
-       .vsz_limit = (uoff_t)-1,
+       .vsz_limit = UOFF_T_MAX,
 
        .unix_listeners = { { &lmtp_unix_listeners_buf,
                              sizeof(lmtp_unix_listeners[0]) } },
index 16458f0c09608d316ccb83e85f0efeaa6fe7c253..c4fc978c04d64d5ede6c49cec509dce8ebac53fe 100644 (file)
@@ -38,7 +38,7 @@ struct service_settings log_service_settings = {
        .client_limit = 0,
        .service_count = 0,
        .idle_kill = UINT_MAX,
-       .vsz_limit = (uoff_t)-1,
+       .vsz_limit = UOFF_T_MAX,
 
        .unix_listeners = { { &log_unix_listeners_buf,
                              sizeof(log_unix_listeners[0]) } },
index 79a811e97f897a7ad26d2fc93fff8c9510afd4b2..ce07ebd6549b4412e2d59215acdcb1405108fc89 100644 (file)
@@ -148,7 +148,7 @@ static const struct service_settings service_default_settings = {
        .client_limit = 0,
        .service_count = 0,
        .idle_kill = 0,
-       .vsz_limit = (uoff_t)-1,
+       .vsz_limit = UOFF_T_MAX,
 
        .unix_listeners = ARRAY_INIT,
        .fifo_listeners = ARRAY_INIT,
index 5caaf824be2e47dcb7d5ab6943e0a5f7c5236aee..0a7779416a54930d3fcac06e0d08298a12b2c94a 100644 (file)
@@ -218,7 +218,7 @@ service_create(pool_t pool, const struct service_settings *set,
            service->client_limit > set->service_count)
                service->client_limit = set->service_count;
 
-       service->vsz_limit = set->vsz_limit != (uoff_t)-1 ? set->vsz_limit :
+       service->vsz_limit = set->vsz_limit != UOFF_T_MAX ? set->vsz_limit :
                set->master_set->default_vsz_limit;
        service->idle_kill = set->idle_kill != 0 ? set->idle_kill :
                set->master_set->default_idle_kill;
index a67fca346665c50c3f83e98e227ee5b07206b145..679c30ab06b7920047cfd4fbafa252d7be628a7f 100644 (file)
@@ -48,7 +48,7 @@ struct service_settings old_stats_service_settings = {
        .client_limit = 0,
        .service_count = 0,
        .idle_kill = UINT_MAX,
-       .vsz_limit = (uoff_t)-1,
+       .vsz_limit = UOFF_T_MAX,
 
        .unix_listeners = { { &old_stats_unix_listeners_buf,
                              sizeof(old_stats_unix_listeners[0]) } },
index 00a1eb02c5afd832757a5b898223f469143ce829..e380d8fa816972d7368d251d576031d278748eb5 100644 (file)
@@ -503,7 +503,7 @@ static void squat_uidlist_free_from_memory(struct squat_uidlist *uidlist)
 
        if (uidlist->file_cache != NULL) {
                file_cache_invalidate(uidlist->file_cache,
-                                     page_size, (uoff_t)-1);
+                                     page_size, UOFF_T_MAX);
        } else {
                (void)madvise(uidlist->mmap_base, uidlist->mmap_size,
                              MADV_DONTNEED);
index 43ece3d3b5e3ea17e072a852ff3d7ddaee7b21b7..9ece7eae5b3b58891085c58fca62de61c698e895 100644 (file)
@@ -107,7 +107,7 @@ mail_crypt_cache_open(struct mail_crypt_user *muser, struct mail *mail,
                cache->input = input;
                /* index-mail wants the stream to be destroyed at close, so create
                   a new stream instead of just increasing reference. */
-               return i_stream_create_limit(cache->input, (uoff_t)-1);
+               return i_stream_create_limit(cache->input, UOFF_T_MAX);
        }
 
        return input;
@@ -168,7 +168,7 @@ mail_crypt_istream_opened(struct mail *_mail, struct istream **stream)
                   already be seeked into the wanted offset. */
                i_stream_unref(stream);
                i_stream_seek(cache->input, 0);
-               *stream = i_stream_create_limit(cache->input, (uoff_t)-1);
+               *stream = i_stream_create_limit(cache->input, UOFF_T_MAX);
                return mmail->super.istream_opened(_mail, stream);
        }
 
index 92c32c84f3d17d5693ed36bdb69d2166189c34b7..d04e107cb92ac2a70de831190824dc2451064975 100644 (file)
@@ -362,7 +362,7 @@ static int pop3_map_read(struct mail_storage *storage, struct mailbox *pop3_box)
        struct mail *mail;
        struct pop3_uidl_map *map;
        const char *uidl;
-       uoff_t size = (uoff_t)-1;
+       uoff_t size = UOFF_T_MAX;
        int ret = 0;
 
        if (array_is_created(&mstorage->pop3_uidl_map)) {
@@ -553,7 +553,7 @@ static int imap_map_read(struct mailbox *box)
        struct mail_search_context *ctx;
        struct mail *mail;
        struct imap_msg_map *map;
-       uoff_t psize = (uoff_t)-1;
+       uoff_t psize = UOFF_T_MAX;
        string_t *uidl;
        int ret = 0;
 
index fbc23856874c10eace07461376154885633d2364..ab12beebd75aee045c220956ef7a311ffbc299ac 100644 (file)
@@ -83,7 +83,7 @@ static int maildir_sum_dir(const char *dir, uint64_t *total_bytes,
                        continue;
 
                p = strstr(dp->d_name, ",S=");
-               num = (uoff_t)-1;
+               num = UOFF_T_MAX;
                if (p != NULL) {
                        /* ,S=nnnn[:,] */
                        p += 3;
@@ -92,13 +92,13 @@ static int maildir_sum_dir(const char *dir, uint64_t *total_bytes,
 
                        if (*p != ':' && *p != '\0' && *p != ',') {
                                /* not in expected format, fallback to stat() */
-                               num = (uoff_t)-1;
+                               num = UOFF_T_MAX;
                        } else {
                                *total_bytes += num;
                                *total_count += 1;
                        }
                }
-               if (num == (uoff_t)-1) {
+               if (num == UOFF_T_MAX) {
                        struct stat st;
 
                        str_truncate(path, len);
index 15360255225952c144758dea3b945a4985355c5f..2a3d66dc78a87c09883b5996e994926382437d24 100644 (file)
@@ -110,7 +110,7 @@ zlib_mail_cache_open(struct zlib_user *zuser, struct mail *mail,
                cache->input = input;
                /* index-mail wants the stream to be destroyed at close, so create
                   a new stream instead of just increasing reference. */
-               return i_stream_create_limit(cache->input, (uoff_t)-1);
+               return i_stream_create_limit(cache->input, UOFF_T_MAX);
        } else {
                return input;
        }
@@ -136,7 +136,7 @@ static int zlib_istream_opened(struct mail *_mail, struct istream **stream)
                   already be seeked into the wanted offset. */
                i_stream_unref(stream);
                i_stream_seek(cache->input, 0);
-               *stream = i_stream_create_limit(cache->input, (uoff_t)-1);
+               *stream = i_stream_create_limit(cache->input, UOFF_T_MAX);
                return zmail->module_ctx.super.istream_opened(_mail, stream);
        }
 
index 2dd482eaf2061880d59e6abfbd96b5745f5ed629..7852ec605d1df85b076e980e9de9d0c9123cf3fe 100644 (file)
@@ -41,7 +41,7 @@ struct service_settings pop3_login_service_settings = {
        .client_limit = 0,
        .service_count = 1,
        .idle_kill = 0,
-       .vsz_limit = (uoff_t)-1,
+       .vsz_limit = UOFF_T_MAX,
 
        .unix_listeners = ARRAY_INIT,
        .fifo_listeners = ARRAY_INIT,
index 56192a95be6c75666e2828b72e719259d7048736..2619dab44bd3533b01d8f437a3083eb3b5176f3f 100644 (file)
@@ -481,7 +481,7 @@ static int fetch(struct client *client, unsigned int msgnum, uoff_t body_lines,
                return ret;
        }
 
-       if (body_lines == (uoff_t)-1 && client->seen_bitmask != NULL) {
+       if (body_lines == UOFF_T_MAX && client->seen_bitmask != NULL) {
                if ((mail_get_flags(ctx->mail) & MAIL_SEEN) == 0) {
                        /* mark the message seen with RETR command */
                        client->seen_bitmask[msgnum / CHAR_BIT] |=
@@ -491,7 +491,7 @@ static int fetch(struct client *client, unsigned int msgnum, uoff_t body_lines,
        }
 
        ctx->body_lines = body_lines;
-       if (body_lines == (uoff_t)-1) {
+       if (body_lines == UOFF_T_MAX) {
                client_send_line(client, "+OK %"PRIuUOFF_T" octets",
                                 client->message_sizes[msgnum]);
        } else {
@@ -519,7 +519,7 @@ static int cmd_retr(struct client *client, const char *args)
                client->last_seen_pop3_msn = msgnum+1;
 
        client->retr_count++;
-       return fetch(client, msgnum, (uoff_t)-1, "RETR", &client->retr_bytes);
+       return fetch(client, msgnum, UOFF_T_MAX, "RETR", &client->retr_bytes);
 }
 
 static int cmd_rset(struct client *client, const char *args ATTR_UNUSED)
index c4f196498c542f17cdb4211a9202f7045b1de8d5..8e018de39412f0b84dc8e99b3285c37a21758274 100644 (file)
@@ -43,7 +43,7 @@ struct service_settings pop3_service_settings = {
        .client_limit = 1,
        .service_count = 1,
        .idle_kill = 0,
-       .vsz_limit = (uoff_t)-1,
+       .vsz_limit = UOFF_T_MAX,
 
        .unix_listeners = { { &pop3_unix_listeners_buf,
                              sizeof(pop3_unix_listeners[0]) } },
index f6e66ad1c9580337c9e45bfaaa1f7fadc91ff4f6..f458ebf60db65dd7cb3f263aa79c43efc025f394 100644 (file)
@@ -46,7 +46,7 @@ struct service_settings aggregator_service_settings = {
        .client_limit = 0,
        .service_count = 0,
        .idle_kill = 0,
-       .vsz_limit = (uoff_t)-1,
+       .vsz_limit = UOFF_T_MAX,
 
        .unix_listeners = { { &aggregator_unix_listeners_buf,
                              sizeof(aggregator_unix_listeners[0]) } },
index 7030e0c68db39bdad80ab65cbb8592bedc79c5ae..634e9b0b0e6700e12b898a8203ac0d0fea9519f1 100644 (file)
@@ -38,7 +38,7 @@ struct service_settings replicator_service_settings = {
        .client_limit = 0,
        .service_count = 0,
        .idle_kill = UINT_MAX,
-       .vsz_limit = (uoff_t)-1,
+       .vsz_limit = UOFF_T_MAX,
 
        .unix_listeners = { { &replicator_unix_listeners_buf,
                              sizeof(replicator_unix_listeners[0]) } },
index 7f1ab61739f1b1944dd07c2160b88e946790d428..eb329e7de9c1f9818c844d4af33b8cc05d71427f 100644 (file)
@@ -48,7 +48,7 @@ struct service_settings stats_service_settings = {
        .client_limit = 0,
        .service_count = 0,
        .idle_kill = UINT_MAX,
-       .vsz_limit = (uoff_t)-1,
+       .vsz_limit = UOFF_T_MAX,
 
        .unix_listeners = { { &stats_unix_listeners_buf,
                              sizeof(stats_unix_listeners[0]) } },
index 4ff5d5b73505b11bc615c6c97bf13c4849b9510b..1a01d7e27a94293ea1c2ae5ef95c89e9c5f8977a 100644 (file)
@@ -44,7 +44,7 @@ struct service_settings submission_login_service_settings = {
        .client_limit = 0,
        .service_count = 1,
        .idle_kill = 0,
-       .vsz_limit = (uoff_t)-1,
+       .vsz_limit = UOFF_T_MAX,
 
        .unix_listeners = ARRAY_INIT,
        .fifo_listeners = ARRAY_INIT,
index 1b07bf286838df200ac77b3cf7ada7efcfecd1ae..29ecbfec18483c6f3d2552e6824a71f1c32229e4 100644 (file)
@@ -44,7 +44,7 @@ struct service_settings submission_service_settings = {
        .client_limit = 1,
        .service_count = 1,
        .idle_kill = 0,
-       .vsz_limit = (uoff_t)-1,
+       .vsz_limit = UOFF_T_MAX,
 
        .unix_listeners = { { &submission_unix_listeners_buf,
                              sizeof(submission_unix_listeners[0]) } },
index f6732719bb6a9c243e66965f906e40686cd53899..82a70acfcc1130ca3c4c15fd6076b78c09f8c0ed 100644 (file)
@@ -23,7 +23,7 @@ struct service_settings health_check_service_settings = {
        .client_limit = 1,
        .service_count = 0,
        .idle_kill = 0,
-       .vsz_limit = (uoff_t)-1,
+       .vsz_limit = UOFF_T_MAX,
 
        .unix_listeners = ARRAY_INIT,
        .fifo_listeners = ARRAY_INIT,
index a3e1882b5ef7aaad71eb8f98b8c0aa1f5c10a25f..ec7ceaf7db644bbaf8cdeb2c6d369b1f22accb03 100644 (file)
@@ -26,7 +26,7 @@ struct service_settings tcpwrap_service_settings = {
        .client_limit = 1,
        .service_count = 0,
        .idle_kill = 0,
-       .vsz_limit = (uoff_t)-1,
+       .vsz_limit = UOFF_T_MAX,
 
        .unix_listeners = ARRAY_INIT,
        .fifo_listeners = ARRAY_INIT,