Here's the last patch I got. Gmail tells me it was also sent to the list; maybe it somehow got filtered.
I /think/ I'm including the attachment here... ---------- Forwarded message ---------- From: Andrew Stubbs <andrew_stu...@mentor.com> Date: Tue, Oct 9, 2012 at 11:05 AM Subject: Re: [PATCH] Detect __DATE__ and __TIME__ correctly. To: Justin Lebar <justin.le...@gmail.com> Cc: Andrew Stubbs <a...@codesourcery.com>, "ccache@lists.samba.org" <ccache@lists.samba.org> On 09/10/12 15:46, Justin Lebar wrote: > > Can you update the Python script in the comment right above the code > and confirm that it matches your new table? It's hard for me to see > what you did here based on just the patch... In fact, I did do that. I just cocked up the git magic and didn't post it. I guess I need more sleep! I've also removed the unnecessary comma change. New version attached, again. Andrew
From 8ea4e57f434640ebfa09d75756b7f56a097638d2 Mon Sep 17 00:00:00 2001 From: Andrew Stubbs <a...@codesourcery.com> Date: Tue, 9 Oct 2012 15:17:19 +0100 Subject: [PATCH] Detect __DATE__ and __TIME__ correctly. To: ccache@lists.samba.org The code to detect __DATE__ and __TIME__ was off-by-one, and therefore totally failed to detect time macros unless by chance alignments (1 in eight macros might be correctly aligned). The problem is that the code expects that 'i' will point to the last underscore, and the skip table expects 'i' to point to the point after the end of the string. For example, if str[i] == 'E' then the skip table moves 'i' on 3 bytes, whereas the code only works with a 2-byte skip. I've corrected the problem by adjusting the table to match the code. I've confirmed the tests still pass. Signed-off-by: Andrew Stubbs <a...@codesourcery.com> --- macroskip.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/macroskip.h b/macroskip.h index 1452201..cb32ec4 100644 --- a/macroskip.h +++ b/macroskip.h @@ -7,23 +7,23 @@ * The other characters map as follows: * * _ -> 1 - * A -> 5 - * D -> 6 - * E -> 3 - * I -> 5 - * M -> 4 - * T -> 4 + * A -> 4 + * D -> 5 + * E -> 2 + * I -> 4 + * M -> 3 + * T -> 3 * * * This was generated with the following Python script: * * m = {'_': 1, - * 'A': 5, - * 'D': 6, - * 'E': 3, - * 'I': 5, - * 'M': 4, - * 'T': 4} + * 'A': 4, + * 'D': 5, + * 'E': 2, + * 'I': 4, + * 'M': 3, + * 'T': 3} * * for i in range(0, 256): * if chr(i) in m: @@ -41,8 +41,8 @@ static const uint32_t macro_skip[] = { 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 5, 8, 8, 6, 3, 8, 8, 8, 5, 8, 8, 8, 4, 8, 8, - 8, 8, 8, 8, 4, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 1, + 8, 4, 8, 8, 5, 2, 8, 8, 8, 4, 8, 8, 8, 3, 8, 8, + 8, 8, 8, 8, 3, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 1, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, -- 1.7.9.5
_______________________________________________ ccache mailing list ccache@lists.samba.org https://lists.samba.org/mailman/listinfo/ccache