]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
global: Use #ifdef instead of #if with WORDS_BIGENDIAN
authorMartti Rannanjärvi <martti.rannanjarvi@dovecot.fi>
Fri, 27 Oct 2017 08:03:07 +0000 (11:03 +0300)
committerAki Tuomi <aki.tuomi@dovecot.fi>
Mon, 30 Oct 2017 08:18:50 +0000 (10:18 +0200)
This is to not rely on undefined WORDS_BIGENDIAN being evaluated as 0.

src/lib-index/mail-index-map-hdr.c
src/lib-index/mail-index-map.c
src/lib-index/mail-transaction-log-file.c
src/lib/byteorder.h
src/lib/sha1.c
src/lib/test-byteorder.c

index 8ca40634e884006ca60d77bfc7df6dd215be1f90..f3b883e94069352b2af7072379f5c01d06c4bfa5 100644 (file)
@@ -171,7 +171,7 @@ bool mail_index_check_header_compat(struct mail_index *index,
 {
         enum mail_index_header_compat_flags compat_flags = 0;
 
-#if !WORDS_BIGENDIAN
+#ifndef WORDS_BIGENDIAN
        compat_flags |= MAIL_INDEX_COMPAT_LITTLE_ENDIAN;
 #endif
 
index 7ee80c8a9e36bc7cf78d669e88bbd9e104acba15..48a9cbd2fb4c7e0878375510f0f5739b28c4be74 100644 (file)
@@ -239,7 +239,7 @@ static void mail_index_header_init(struct mail_index *index,
        hdr->header_size = sizeof(*hdr);
        hdr->record_size = sizeof(struct mail_index_record);
 
-#if !WORDS_BIGENDIAN
+#ifndef WORDS_BIGENDIAN
        hdr->compat_flags |= MAIL_INDEX_COMPAT_LITTLE_ENDIAN;
 #endif
 
index 16f799ed874435c4ecf6e9fe0a67003328e0f8eb..47898921f6c0b6c2baee460f2d2916fbb4eda92d 100644 (file)
@@ -535,7 +535,7 @@ mail_transaction_log_file_read_hdr(struct mail_transaction_log_file *file,
                /* we have compatibility flags */
                enum mail_index_header_compat_flags compat_flags = 0;
 
-#if !WORDS_BIGENDIAN
+#ifndef WORDS_BIGENDIAN
                compat_flags |= MAIL_INDEX_COMPAT_LITTLE_ENDIAN;
 #endif
                if (file->hdr.compat_flags != compat_flags) {
index f6cdf322daa940a08f18c23783b8042fb4e973bf..6d41786e35ba41d524cd28743d4f4fe5ddd2973c 100644 (file)
@@ -244,7 +244,7 @@ static inline uint##size##_t from##size##_to_##to(uint##size##_t x) \
        return bswap;                                                   \
 }
 
-#if WORDS_BIGENDIAN
+#ifdef WORDS_BIGENDIAN
 #define __GEN(from, size, to, be, le) ___GEN(from, size, to, be)
 #else
 #define __GEN(from, size, to, be, le) ___GEN(from, size, to, le)
index ddbecf2867ddfa128309237833c9dd534733f33d..fb8247f60aa1da49d2c62d5a37418ff139f0ab09 100644 (file)
@@ -235,7 +235,7 @@ sha1_result(struct sha1_ctxt *ctxt, void *digest0)
 
        digest = (uint8_t *)digest0;
        sha1_pad(ctxt);
-#if WORDS_BIGENDIAN
+#ifdef WORDS_BIGENDIAN
        memmove(digest, &ctxt->h.b8[0], 20);
 #else
        digest[0] = ctxt->h.b8[3]; digest[1] = ctxt->h.b8[2];
index 157493ce097eb7b71e62990f5d3ff310dfe3ae90..eeb3d510cd1d10b0c53c914c5c7faaeebc6910f0 100644 (file)
@@ -103,7 +103,7 @@ struct unaligned_run {
        uint32_t le32;
        uint64_t le64;
 
-#if WORDS_BIGENDIAN
+#ifdef WORDS_BIGENDIAN
 #define cpu8 be8
 #define cpu16 be16
 #define cpu32 be32