On Thu, Feb 7, 2013 at 5:12 PM, Andrew Fish <[email protected]> wrote:
>
> On Feb 7, 2013, at 3:35 PM, Jordan Justen <[email protected]> wrote:
>
>> On Thu, Feb 7, 2013 at 3:23 PM, H. Peter Anvin <[email protected]> wrote:
>>> On 01/28/2013 03:31 PM, David Woodhouse wrote:
>>>> +  if (Bp->hdr.version >= 0x20c && Bp->hdr.handover_offset &&
>>>> +      (Bp->hdr.xloadflags & sizeof(long))) {
>>>
>>> Cute.  I didn't even realize this was the bit assignment ;)
>>
>> Hmm, this is a bit too clever for EDK II. :)
>
> Clever == please add a comment.

I meant "too clever" as "let's code it another way."

>> Plus, I don't think using 'long' follows the coding style.
>
> It would be UINTN in our world, as long is compiler/ABI dependent. LP64 vs 
> LLP64 and all. So for example this code is broken on Visual Studio.
>

I'm thinking I'd prefer:
(Bp->hdr.xloadflags & ((sizeof(UINTN) == 4) ? BIT2 : BIT3))

This matches the kernel comment.

That okay David?

-Jordan

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to