mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-27 07:34:06 +02:00
MdeModulePkg/HiiDatabaseDxe: Avoid struct assignment
Struct assignments are not permitted in EDK2, as they may be converted by the compiler into calls to the 'memcpy' intrinsic, which is not guaranteed to be available in EDK2. So replace the assignment with a call to CopyMem (), and -while at it- replace the loop with a single CopyMem () call, as the loop operates on items that are contiguous in memory. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
This commit is contained in:
parent
839bd17973
commit
de4cc40b8c
@ -1288,7 +1288,6 @@ HiiDrawImage (
|
|||||||
UINTN BufferLen;
|
UINTN BufferLen;
|
||||||
UINT16 Width;
|
UINT16 Width;
|
||||||
UINT16 Height;
|
UINT16 Height;
|
||||||
UINTN Xpos;
|
|
||||||
UINTN Ypos;
|
UINTN Ypos;
|
||||||
UINTN OffsetY1;
|
UINTN OffsetY1;
|
||||||
UINTN OffsetY2;
|
UINTN OffsetY2;
|
||||||
@ -1390,9 +1389,11 @@ HiiDrawImage (
|
|||||||
for (Ypos = 0; Ypos < Height; Ypos++) {
|
for (Ypos = 0; Ypos < Height; Ypos++) {
|
||||||
OffsetY1 = Image->Width * Ypos;
|
OffsetY1 = Image->Width * Ypos;
|
||||||
OffsetY2 = Width * Ypos;
|
OffsetY2 = Width * Ypos;
|
||||||
for (Xpos = 0; Xpos < Width; Xpos++) {
|
CopyMem (
|
||||||
BltBuffer[OffsetY2 + Xpos] = Image->Bitmap[OffsetY1 + Xpos];
|
&BltBuffer[OffsetY2],
|
||||||
}
|
&Image->Bitmap[OffsetY1],
|
||||||
|
Width * sizeof (*BltBuffer)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user