]> 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>
Fri, 11 May 2018 11:02:50 +0000 (14:02 +0300)
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 eff8a604b8ca1c1e38c433d5457ecba2ff38043d..5f272c5a8c2dc033aa867aefe3108fb2e18a8700 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 ed6d23713c7208a1858ea87d781a524be32c0b21..a12814b500f5182b4f49c082b95f7a5a9e43e84a 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 e33bb1a95ca2550407654317bdc4d62eaf12511d..9239a73ddcde3d465109890d5d36fea9c35db866 100644 (file)
@@ -536,7 +536,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 b5298580fa164a406f8499e4e3792a4a538bd33d..264d397d5d82b626ea3b28ee182d39f3c7d2e942 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 d3fd43820a43dc2c112167de8e5f1615a3ddf959..9e350ceadb6aaa2e50d6736d40a6d12fa0b9b7e0 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