> -----Original Message----- > From: Paolo Bonzini [mailto:paolo.bonz...@gmail.com] On Behalf Of Paolo > Bonzini > Sent: Wednesday, September 20, 2017 1:06 AM > To: Wu, Hao A; edk2-devel@lists.01.org > Cc: Dong, Eric; Zeng, Star > Subject: Re: [edk2] [PATCH 5/6] MdeModulePkg/Crc32: Fix possible out of > range left shift > > On 19/09/2017 13:43, Hao Wu wrote: > > NewValue = 0; > > for (Index = 0; Index < 32; Index++) { > > - if ((Value & (1 << Index)) != 0) { > > - NewValue = NewValue | (1 << (31 - Index)); > > + if ((Value & (((UINT32)1) << Index)) != 0) { > > + NewValue = NewValue | (((UINT32)1) << (31 - Index)); > > } > > > Why not just "1u" instead of the cast?
Thanks for the feedback. I will update the patch according to the suggestion. Best Regards, Hao Wu > > Paolo _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel