Skip to content

Commit

Permalink
lib,lib-index: Use #ifdef with WORDS_BIGENDIAN
Browse files Browse the repository at this point in the history
Some were missing from the last change.
  • Loading branch information
mrannanj authored and cmouse committed May 11, 2018
1 parent ad55c19 commit f42ce31
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/lib-index/mail-transaction-log-file.c
Expand Up @@ -231,7 +231,7 @@ mail_transaction_log_init_hdr(struct mail_transaction_log *log,
hdr->hdr_size = sizeof(struct mail_transaction_log_header);
hdr->indexid = log->index->indexid;
hdr->create_stamp = ioloop_time;
#if !WORDS_BIGENDIAN
#ifndef WORDS_BIGENDIAN
hdr->compat_flags |= MAIL_INDEX_COMPAT_LITTLE_ENDIAN;
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/lib/byteorder.h
Expand Up @@ -221,7 +221,7 @@ static inline uint##size##_t cpu##size##_to_cpu_unaligned(const void *in)\
return bswap; \
}

#if WORDS_BIGENDIAN
#ifdef WORDS_BIGENDIAN
#define GEN(size) __GEN(size, x)
#else
#define GEN(size) __GEN(size, i_bswap_##size(x))
Expand Down
4 changes: 2 additions & 2 deletions src/lib/sha1.c
Expand Up @@ -80,7 +80,7 @@ sha1_step(struct sha1_ctxt *ctxt)
size_t t, s;
uint32_t tmp;

#if !WORDS_BIGENDIAN
#ifndef WORDS_BIGENDIAN
struct sha1_ctxt tctxt;
memmove(&tctxt.m.b8[0], &ctxt->m.b8[0], 64);
ctxt->m.b8[0] = tctxt.m.b8[3]; ctxt->m.b8[1] = tctxt.m.b8[2];
Expand Down Expand Up @@ -189,7 +189,7 @@ sha1_pad(struct sha1_ctxt *ctxt)
memset(&ctxt->m.b8[padstart], 0, padlen - 8);
COUNT += (padlen - 8);
COUNT %= 64;
#if WORDS_BIGENDIAN
#ifdef WORDS_BIGENDIAN
PUTPAD(ctxt->c.b8[0]); PUTPAD(ctxt->c.b8[1]);
PUTPAD(ctxt->c.b8[2]); PUTPAD(ctxt->c.b8[3]);
PUTPAD(ctxt->c.b8[4]); PUTPAD(ctxt->c.b8[5]);
Expand Down

0 comments on commit f42ce31

Please sign in to comment.