On 04/01/15 16:46, Kinney, Michael D wrote:
> Oliver,
> 
> What is the test case that fails?  It is passing in a constant or a
> variable as the first parameter to the macro.  If it is a variable, I am
> guessing that the type is smaller than UINT32?
> 
> It makes sense that the left shift 31 bits needs to be considered as a
> UINT32 for that to be meaningful. 
> 
> I am curious.  Does the following change top use a typecast to UINT32
> before the shift also resolve the compiler compatibility issue? 
> 
> #defineACPI_DISPLAY_ADR(_DeviceIdScheme, _HeadId, _NonVgaOutput,
> _BiosCanDetect, _VendorInfo, _Type, _Port, _Index) \
> 
>           ((UINT32)(  ((UINT32)((_DeviceIdScheme) & 0x1) << 31) |  \
>                       (((_HeadId)         & 0x7) << 18) |  \
>                       (((_NonVgaOutput)   & 0x1) << 17) |  \
>                       (((_BiosCanDetect)  & 0x1) << 16) |  \
>                       (((_VendorInfo)     & 0xf) << 12) |  \
>                       (((_Type)           & 0xf) << 8)  |  \
>                       (((_Port)           & 0xf) << 4)  |  \
>                        ((_Index)          & 0xf) ))

Side point (since this thread seems to be finished): the simplest would
be to use the constant

  0x1u

in the subexpression in question. That would force _DeviceIdScheme to be
converted to unsigned int (from int), according to the Usual Arithmetic
Conversions. Then the result of the bitwise and, ie. the LHS operand of
the bitwise shift, would also be UINT32.

Thanks
Laszlo


------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to