mirror of https://github.com/acidanthera/audk.git
MdeModulePkg/UdfDxe: Add type cast to fix build failure in VS tools
V3: Remove one unnecessay type cast in patch 1. Codes: if (FilePosition + ExtentLength > ReadFileInfo->FilePosition) { Offset = ReadFileInfo->FilePosition - FilePosition; if (Offset < 0) { Offset = -(Offset) } ... } Offset is UINT64 can not < 0, so the code logic may have some issue. and Offset = -(Offset) may build failure in some circumstance. Previously type cast Offset to INT64 to fix build break. Now remove the type cast. Then can to check the code logic later. Cc: Eric Dong <eric.dong@intel.com> Cc: Paulo Alcantara <pcacjr@zytor.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Paulo Alcantara <pcacjr@zytor.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
parent
1f48070740
commit
0b4c8f003a
|
@ -472,7 +472,7 @@ DuplicateFid (
|
||||||
{
|
{
|
||||||
*NewFileIdentifierDesc =
|
*NewFileIdentifierDesc =
|
||||||
(UDF_FILE_IDENTIFIER_DESCRIPTOR *)AllocateCopyPool (
|
(UDF_FILE_IDENTIFIER_DESCRIPTOR *)AllocateCopyPool (
|
||||||
GetFidDescriptorLength (FileIdentifierDesc), FileIdentifierDesc);
|
(UINTN) GetFidDescriptorLength (FileIdentifierDesc), FileIdentifierDesc);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -809,7 +809,7 @@ GetAedAdsData (
|
||||||
//
|
//
|
||||||
// Allocate buffer to read in AED's data.
|
// Allocate buffer to read in AED's data.
|
||||||
//
|
//
|
||||||
*Data = AllocatePool (*Length);
|
*Data = AllocatePool ((UINTN) (*Length));
|
||||||
if (*Data == NULL) {
|
if (*Data == NULL) {
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
@ -818,7 +818,7 @@ GetAedAdsData (
|
||||||
DiskIo,
|
DiskIo,
|
||||||
BlockIo->Media->MediaId,
|
BlockIo->Media->MediaId,
|
||||||
Offset,
|
Offset,
|
||||||
*Length,
|
(UINTN) (*Length),
|
||||||
*Data
|
*Data
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -844,7 +844,7 @@ GrowUpBufferToNextAd (
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
*Buffer = ReallocatePool (Length, Length + ExtentLength, *Buffer);
|
*Buffer = ReallocatePool ((UINTN) Length, (UINTN) (Length + ExtentLength), *Buffer);
|
||||||
if (*Buffer == NULL) {
|
if (*Buffer == NULL) {
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
@ -933,7 +933,7 @@ ReadFile (
|
||||||
//
|
//
|
||||||
// Allocate buffer for starting read data.
|
// Allocate buffer for starting read data.
|
||||||
//
|
//
|
||||||
ReadFileInfo->FileData = AllocatePool (Length);
|
ReadFileInfo->FileData = AllocatePool ((UINTN) Length);
|
||||||
if (ReadFileInfo->FileData == NULL) {
|
if (ReadFileInfo->FileData == NULL) {
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
@ -941,7 +941,7 @@ ReadFile (
|
||||||
//
|
//
|
||||||
// Read all inline data into ReadFileInfo->FileData
|
// Read all inline data into ReadFileInfo->FileData
|
||||||
//
|
//
|
||||||
CopyMem (ReadFileInfo->FileData, Data, Length);
|
CopyMem (ReadFileInfo->FileData, Data, (UINTN) Length);
|
||||||
ReadFileInfo->ReadLength = Length;
|
ReadFileInfo->ReadLength = Length;
|
||||||
} else if (ReadFileInfo->Flags == READ_FILE_SEEK_AND_READ) {
|
} else if (ReadFileInfo->Flags == READ_FILE_SEEK_AND_READ) {
|
||||||
//
|
//
|
||||||
|
@ -951,7 +951,7 @@ ReadFile (
|
||||||
CopyMem (
|
CopyMem (
|
||||||
ReadFileInfo->FileData,
|
ReadFileInfo->FileData,
|
||||||
(VOID *)((UINT8 *)Data + ReadFileInfo->FilePosition),
|
(VOID *)((UINT8 *)Data + ReadFileInfo->FilePosition),
|
||||||
ReadFileInfo->FileDataSize
|
(UINTN) ReadFileInfo->FileDataSize
|
||||||
);
|
);
|
||||||
|
|
||||||
ReadFileInfo->FilePosition += ReadFileInfo->FileDataSize;
|
ReadFileInfo->FilePosition += ReadFileInfo->FileDataSize;
|
||||||
|
@ -1099,7 +1099,7 @@ ReadFile (
|
||||||
DiskIo,
|
DiskIo,
|
||||||
BlockIo->Media->MediaId,
|
BlockIo->Media->MediaId,
|
||||||
Offset + MultU64x32 (Lsn, LogicalBlockSize),
|
Offset + MultU64x32 (Lsn, LogicalBlockSize),
|
||||||
DataLength,
|
(UINTN) DataLength,
|
||||||
(VOID *)((UINT8 *)ReadFileInfo->FileData +
|
(VOID *)((UINT8 *)ReadFileInfo->FileData +
|
||||||
DataOffset)
|
DataOffset)
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue