{"thread":{"id":"15696","subject":"Re: [PATCH 01/14] Extend index to save more flags","startedAt":"2008-09-28T11:59:46Z","lastAt":"2008-09-28T12:21:22Z","messageCount":2,"participants":["Jakub Narebski","Nguyen Thai Ngoc Duy"],"isPatch":true,"patchVersion":1,"patchTotal":14},"messages":[{"id":"91787","messageId":"200809281359.46858.jnareb@gmail.com","threadId":"15696","inReplyTo":"48d723bf90941_5de93fcd2ee870984625e@app02.zenbe.com.tmail","subject":"Re: [PATCH 01/14] Extend index to save more flags","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-09-28T11:59:46Z","receivedAt":"2008-09-28T11:59:46Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Mon, 22 Sep 2008, Duy Nguyen wrote:\n> On 09/22/2008 \"Jakub Narebski\" <jnareb@gmail.com> wrote:\n>>On Sun, 21 Sep 2008, Nguyen Thai Ngoc Duy wrote:\n>>> On 9/21/08, Jakub Narebski <jnareb@gmail.com> wrote:\n>>>>> +\n>>>>> +#define CE_EXTENDED_FLAGS (0)\n>>>>> +\n>>>>> +/*\n>>>>> + * Safeguard to avoid saving wrong flags:\n>>>>> + *  - CE_EXTENDED2 won't get saved until its semantic is known\n>>>>> + *  - Bits in 0x0000FFFF have been saved in ce_flags already\n>>>>> + *  - Bits in 0x003F0000 are currently in-memory flags\n>>>>> + */\n>>>>> +#if CE_EXTENDED_FLAGS & 0x80CFFFFF\n>>>>> +#error \"CE_EXTENDED_FLAGS out of range\"\n>>>>> +#endif\n>>>>\n>>>>\n>>>> I don't quite understand the above fragment (especially with the fact\n>>>>  that CE_EXTENDED_FLAGS is defined as (0))...\n>>> \n>>> Because this patch does not introduce any new on-disk flag yet so\n>>> CE_EXTENDED_FLAGS remains 0. In the next patch, CE_EXTENDED_FLAGS will\n>>> be updated to have CE_NO_CHECKOUT.\n>> \n>> Well, now I understand CE_EXTENDED_FLAGS being (0).\n>> \n>> What I still don't understand the pattern it is protected against.  \n>> As I understand it if CE_EXTENDED_FLAGS & 0x0000FFFF it is bad,\n>> because ce_flags saved flags are not extended flags, and \n>> CE_EXTENDED_FLAGS & 0x003F0000 are in-memory flags.  But why\n>> CE_EXTENDED_FLAGS & 0x80C00000 is bad, and why (if I understand it)\n>> CE_EXTENDED_FLAGS & 0x00300000 is not bad.\n> \n> Wrong bit computation, should be \"#if CE_EXTENDED_FLAGS & 0x803FFFFF\".\n> Thanks for pointing out. \n\nSo now there is:\n\nNow CE_EXTENDED_FLAGS & 0x803FFFFF is bad because:\n  * CE_EXTENDED_FLAGS & 0x0000FFFF are saved flags (not extended)\n  * CE_EXTENDED_FLAGS & 0x003F0000 are in-memory flags\n  * CE_EXTENDED_FLAGS & 0x80000000 is 'extra flags' bit\n    (this is not mentioned in quoted comment; I'm not sure if\n     it needs to be or not)\n\nIs that correct?\n-- \nJakub Narebski\nPoland\n"},{"id":"91789","messageId":"fcaeb9bf0809280521m5bd0de7aladdbb50b2b750018@mail.gmail.com","threadId":"15696","inReplyTo":"200809281359.46858.jnareb@gmail.com","subject":"Re: [PATCH 01/14] Extend index to save more flags","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2008-09-28T12:21:22Z","receivedAt":"2008-09-28T12:21:22Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On 9/28/08, Jakub Narebski <jnareb@gmail.com> wrote:\n> So now there is:\n>\n>  Now CE_EXTENDED_FLAGS & 0x803FFFFF is bad because:\n>   * CE_EXTENDED_FLAGS & 0x0000FFFF are saved flags (not extended)\n>\n>   * CE_EXTENDED_FLAGS & 0x003F0000 are in-memory flags\n>\n>   * CE_EXTENDED_FLAGS & 0x80000000 is 'extra flags' bit\n>     (this is not mentioned in quoted comment; I'm not sure if\n>      it needs to be or not)\n>\n>  Is that correct?\n\nCorrect.\n-- \nDuy\n"}]}