Index: mailbox.c =================================================================== RCS file: /afs/andrew/system/cvs/src/cyrus/imap/mailbox.c,v retrieving revision 1.170 diff -u -r1.170 mailbox.c --- mailbox.c 13 Sep 2007 20:49:53 -0000 1.170 +++ mailbox.c 14 Sep 2007 13:46:58 -0000 @@ -1291,7 +1291,13 @@ */ int mailbox_write_index_header(struct mailbox *mailbox) { - char buf[INDEX_HEADER_SIZE]; + struct { +#ifdef HAVE_LONG_LONG_INT + bit64 align8; +#endif + char buf[INDEX_HEADER_SIZE]; + } align8buf; + char *buf = align8buf.buf; unsigned long header_size = sizeof(buf); int n; @@ -1396,7 +1402,13 @@ int sync) { int n; - char buf[INDEX_RECORD_SIZE]; + struct { +#ifdef HAVE_LONG_LONG_INT + bit64 align8; +#endif + char buf[INDEX_RECORD_SIZE]; + } align8buf; + char *buf = align8buf.buf; mailbox_index_record_to_buf(record, buf); @@ -1431,7 +1443,14 @@ { unsigned i; int len, n; - char *buf, *p; + struct { +#ifdef HAVE_LONG_LONG_INT + bit64 align8; +#endif + char *buf; + } align8buf; + char *buf = align8buf.buf; + char *p; long last_offset; time_t now = time(NULL); @@ -1530,8 +1549,14 @@ unsigned long exists; unsigned msgno; bit32 oldstart_offset, oldrecord_size, recsize_diff; - char buf[INDEX_HEADER_SIZE > INDEX_RECORD_SIZE ? - INDEX_HEADER_SIZE : INDEX_RECORD_SIZE]; + struct { +#ifdef HAVE_LONG_LONG_INT + bit64 align8; +#endif + char buf[INDEX_HEADER_SIZE > INDEX_RECORD_SIZE ? + INDEX_HEADER_SIZE : INDEX_RECORD_SIZE]; + } align8buf; + char *buf = align8buf.buf; char *bufp; int quota_offset = 0; int calculate_flagcounts = 0; @@ -1859,8 +1884,14 @@ mailbox_decideproc_t *decideproc, void *deciderock, int expunge_flags) { - char buf[INDEX_HEADER_SIZE > INDEX_RECORD_SIZE ? - INDEX_HEADER_SIZE : INDEX_RECORD_SIZE]; + struct { +#ifdef HAVE_LONG_LONG_INT + bit64 align8; +#endif + char buf[INDEX_HEADER_SIZE > INDEX_RECORD_SIZE ? + INDEX_HEADER_SIZE : INDEX_RECORD_SIZE]; + } align8buf; + char *buf = align8buf.buf; unsigned msgno; unsigned newexpunged; unsigned newexists; Index: mailbox.h =================================================================== RCS file: /afs/andrew/system/cvs/src/cyrus/imap/mailbox.h,v retrieving revision 1.84 diff -u -r1.84 mailbox.h --- mailbox.h 5 Sep 2007 17:26:27 -0000 1.84 +++ mailbox.h 14 Sep 2007 13:46:58 -0000 @@ -104,7 +104,12 @@ const char *header_base; unsigned long header_len; - const char *index_base; + union { +#ifdef HAVE_LONG_LONG_INT + bit64 align8; +#endif + const char *index_base; + }; unsigned long index_len; /* mapped size */ const char *cache_base; unsigned long cache_len; /* mapped size */ Index: reconstruct.c =================================================================== RCS file: /afs/andrew/system/cvs/src/cyrus/imap/reconstruct.c,v retrieving revision 1.96 diff -u -r1.96 reconstruct.c --- reconstruct.c 13 Sep 2007 20:21:38 -0000 1.96 +++ reconstruct.c 14 Sep 2007 13:46:58 -0000 @@ -704,8 +704,14 @@ */ int reconstruct(char *name, struct discovered *found) { - char buf[((INDEX_HEADER_SIZE > INDEX_RECORD_SIZE) ? - INDEX_HEADER_SIZE : INDEX_RECORD_SIZE)]; + struct { +#ifdef HAVE_LONG_LONG_INT + bit64 align8; +#endif + char buf[INDEX_HEADER_SIZE > INDEX_RECORD_SIZE ? + INDEX_HEADER_SIZE : INDEX_RECORD_SIZE]; + } align8buf; + char *buf = align8buf.buf; char quota_root[MAX_MAILBOX_PATH+1]; bit32 valid_user_flags[MAX_USER_FLAGS/32]; Index: sync_commit.c =================================================================== RCS file: /afs/andrew/system/cvs/src/cyrus/imap/sync_commit.c,v retrieving revision 1.7 diff -u -r1.7 sync_commit.c --- sync_commit.c 12 Sep 2007 15:51:04 -0000 1.7 +++ sync_commit.c 14 Sep 2007 13:46:58 -0000 @@ -92,7 +92,13 @@ char *path; FILE *newindex = NULL; FILE *newcache = NULL; - unsigned char *buf = NULL; + struct { +#ifdef HAVE_LONG_LONG_INT + bit64 align8; +#endif + unsigned char *buf; + } align8buf; + unsigned char *buf = align8buf.buf = NULL; struct sync_upload_item *item; struct sync_message *message; quota_t quota_add = 0; /* Following may be negative on UUID conflict */