diff options
author | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-09-16 04:51:25 +0000 |
---|---|---|
committer | ydong10 <ydong10@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-09-16 04:51:25 +0000 |
commit | cd7bfc2c632841fab110f601a32850eeddc16af1 (patch) | |
tree | 4d1f82523dd545fa241053cf52b31b8c2b915fe7 /MdeModulePkg/Universal/Network | |
parent | 7bee5a761f4cbafd1e1805dfd99255a0353bbf88 (diff) | |
download | edk2-cd7bfc2c632841fab110f601a32850eeddc16af1.zip edk2-cd7bfc2c632841fab110f601a32850eeddc16af1.tar.gz edk2-cd7bfc2c632841fab110f601a32850eeddc16af1.tar.bz2 |
Refine code to make code run safely.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10880 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Network')
4 files changed, 5 insertions, 5 deletions
diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c index e8e127d..0884026 100644 --- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c +++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Impl.c @@ -467,7 +467,7 @@ DhcpCopyConfigure ( {
EFI_DHCP4_PACKET_OPTION **DstOptions;
EFI_DHCP4_PACKET_OPTION **SrcOptions;
- INTN Len;
+ UINTN Len;
UINT32 Index;
CopyMem (Dst, Src, sizeof (*Dst));
diff --git a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Option.c b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Option.c index ff48bec..d7700bc 100644 --- a/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Option.c +++ b/MdeModulePkg/Universal/Network/Dhcp4Dxe/Dhcp4Option.c @@ -611,7 +611,7 @@ DhcpParseOption ( // Allocate a buffer to hold the DHCP options, and after that, a
// continuous buffer to put all the options' data.
//
- Options = AllocateZeroPool (OptNum * sizeof (DHCP_OPTION) + TotalLen);
+ Options = AllocateZeroPool ((UINTN) (OptNum * sizeof (DHCP_OPTION)) + TotalLen);
if (Options == NULL) {
Status = EFI_OUT_OF_RESOURCES;
@@ -754,7 +754,7 @@ DhcpAppendOption ( *(Buf++) = Tag;
*(Buf++) = (UINT8) Len;
- CopyMem (Buf, Data + Index * 255, Len);
+ CopyMem (Buf, Data + Index * 255, (UINTN) Len);
Buf += Len;
}
diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.c b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.c index bb4ce0a..26860e5 100644 --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.c +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.c @@ -223,7 +223,7 @@ Mtftp4RemoveBlockNum ( *TotalBlock = Num;
if (Range->Round > 0) {
- *TotalBlock += Range->Bound + MultU64x32 (Range->Round -1, (UINT32)(Range->Bound + 1)) + 1;
+ *TotalBlock += Range->Bound + MultU64x32 ((UINTN) (Range->Round -1), (UINT32) (Range->Bound + 1)) + 1;
}
if (Range->Start > Range->Bound) {
diff --git a/MdeModulePkg/Universal/Network/SnpDxe/Transmit.c b/MdeModulePkg/Universal/Network/SnpDxe/Transmit.c index ac6b664..e6c5af7 100644 --- a/MdeModulePkg/Universal/Network/SnpDxe/Transmit.c +++ b/MdeModulePkg/Universal/Network/SnpDxe/Transmit.c @@ -90,7 +90,7 @@ PxeFillHeader ( Snp->Cdb.DBsize = PXE_DBSIZE_NOT_USED;
Snp->Cdb.DBaddr = PXE_DBADDR_NOT_USED;
- Snp->Cdb.CPBsize = sizeof (PXE_CPB_FILL_HEADER_FRAGMENTED);
+ Snp->Cdb.CPBsize = (UINT16) sizeof (PXE_CPB_FILL_HEADER_FRAGMENTED);
Snp->Cdb.CPBaddr = (UINT64)(UINTN) Cpb;
Snp->Cdb.StatCode = PXE_STATCODE_INITIALIZE;
|