1 Return-Path: <tomi.ollila@iki.fi>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 139AF431FD6
\r
6 for <notmuch@notmuchmail.org>; Mon, 25 Nov 2013 01:43:56 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id ualoOlGisgvV for <notmuch@notmuchmail.org>;
\r
16 Mon, 25 Nov 2013 01:43:45 -0800 (PST)
\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])
\r
18 by olra.theworths.org (Postfix) with ESMTP id 91367431FAE
\r
19 for <notmuch@notmuchmail.org>; Mon, 25 Nov 2013 01:43:45 -0800 (PST)
\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])
\r
21 by guru.guru-group.fi (Postfix) with ESMTP id AA6D010005E;
\r
22 Mon, 25 Nov 2013 11:43:37 +0200 (EET)
\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
24 To: david@tethera.net, notmuch@notmuchmail.org
\r
25 Subject: Re: [PATCH 1/2] lib: fix byte order test in libsha1.c
\r
26 In-Reply-To: <1385328583-24602-1-git-send-email-david@tethera.net>
\r
27 References: <m2ob593g55.fsf@guru.guru-group.fi>
\r
28 <1385328583-24602-1-git-send-email-david@tethera.net>
\r
29 User-Agent: Notmuch/0.16+175~g19e97d6 (http://notmuchmail.org) Emacs/24.3.1
\r
30 (x86_64-unknown-linux-gnu)
\r
31 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL
\r
32 $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F
\r
33 !)g;OY^,BjTbr)Np:%c_o'jj,Z
\r
34 Date: Mon, 25 Nov 2013 11:43:37 +0200
\r
35 Message-ID: <m2mwkserzq.fsf@guru.guru-group.fi>
\r
37 Content-Type: text/plain
\r
38 X-BeenThere: notmuch@notmuchmail.org
\r
39 X-Mailman-Version: 2.1.13
\r
41 List-Id: "Use and development of the notmuch mail system."
\r
42 <notmuch.notmuchmail.org>
\r
43 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
44 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
45 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
46 List-Post: <mailto:notmuch@notmuchmail.org>
\r
47 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
48 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
49 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
50 X-List-Received-Date: Mon, 25 Nov 2013 09:43:56 -0000
\r
52 On Sun, Nov 24 2013, david@tethera.net wrote:
\r
54 > From: David Bremner <david@tethera.net>
\r
56 > Previously PLATFORM_BYTE_ORDER and IS_LITTLE_ENDIAN were not defined,
\r
57 > so the little endian code was always compiled in.
\r
59 > This will have the effect that the "SHA1s" on big endian architectures
\r
60 > will change (i.e. become actual sha1s). So someone re-indexing their
\r
61 > database could conceivable lose tags on messages without a message-id
\r
64 > lib/libsha1.c | 14 ++++++++++----
\r
65 > 1 file changed, 10 insertions(+), 4 deletions(-)
\r
67 > diff --git a/lib/libsha1.c b/lib/libsha1.c
\r
68 > index 5d16f6a..794854b 100644
\r
69 > --- a/lib/libsha1.c
\r
70 > +++ b/lib/libsha1.c
\r
71 > @@ -49,11 +49,17 @@ extern "C"
\r
73 > #define bswap_32(x) ((rotr32((x), 24) & 0x00ff00ff) | (rotr32((x), 8) & 0xff00ff00))
\r
75 > -#if (PLATFORM_BYTE_ORDER == IS_LITTLE_ENDIAN)
\r
76 > -#define bsw_32(p,n) \
\r
77 > - { int _i = (n); while(_i--) ((uint32_t*)p)[_i] = bswap_32(((uint32_t*)p)[_i]); }
\r
78 > +#ifdef __BYTE_ORDER__
\r
79 > +# if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
\r
80 > +# define bsw_32(p,n) \
\r
81 > + { int _i = (n); while(_i--) ((uint32_t*)p)[_i] = bswap_32(((uint32_t*)p)[_i]); }
\r
82 > +# elif (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
\r
83 > +# define bsw_32(p,n)
\r
85 > +# error "unknown byte order"
\r
88 > -#define bsw_32(p,n)
\r
89 > +# error "macro __BYTE_ORDER__ is not defined"
\r
94 When you modify te NEWS entry by adding instructions how to find
\r
95 out those sha1's of message-id:s that are affected (Austin's code)
\r
96 You could perhaps add note of the origin of these macros
\r
97 (i.e. something like
\r
98 /* These "Common Predefined Macros" below are GNU C extensions */ )
\r
100 See http://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
\r
106 > #define SHA1_MASK (SHA1_BLOCK_SIZE - 1)
\r