From 2a86ff1cb089d7fb1589e1da54ea880721371000 Mon Sep 17 00:00:00 2001 From: lgao4 Date: Fri, 11 Jul 2008 08:18:17 +0000 Subject: Code Scrub for DxeCrc32GuidedSectionExtractLib library instance. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5455 6f19259b-4bc3-4df7-8a09-765794883524 --- .../DxeCrc32GuidedSectionExtractLib.c | 6 ++++-- MdeModulePkg/Library/DxeNetLib/DxeNetLib.c | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'MdeModulePkg/Library') diff --git a/MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.c b/MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.c index 99f7285108..7271108c40 100644 --- a/MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.c +++ b/MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.c @@ -22,6 +22,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include +#define EFI_SECITON_SIZE_MASK 0x00ffffff + typedef struct { EFI_GUID_DEFINED_SECTION GuidedSectionHeader; UINT32 CRC32Checksum; @@ -64,7 +66,7 @@ Crc32GuidedSectionGetInfo ( // *SectionAttribute = ((EFI_GUID_DEFINED_SECTION *) InputSection)->Attributes; *ScratchBufferSize = 0; - *OutputBufferSize = *(UINT32 *) (((EFI_COMMON_SECTION_HEADER *) InputSection)->Size) & 0x00ffffff; + *OutputBufferSize = *(UINT32 *) (((EFI_COMMON_SECTION_HEADER *) InputSection)->Size) & EFI_SECITON_SIZE_MASK; *OutputBufferSize -= ((EFI_GUID_DEFINED_SECTION *) InputSection)->DataOffset; return EFI_SUCCESS; @@ -117,7 +119,7 @@ Crc32GuidedSectionHandler ( // Crc32SectionHeader = (CRC32_SECTION_HEADER *) InputSection; *OutputBuffer = (UINT8 *) InputSection + Crc32SectionHeader->GuidedSectionHeader.DataOffset; - OutputBufferSize = *(UINT32 *) (((EFI_COMMON_SECTION_HEADER *) InputSection)->Size) & 0x00ffffff; + OutputBufferSize = *(UINT32 *) (((EFI_COMMON_SECTION_HEADER *) InputSection)->Size) & EFI_SECITON_SIZE_MASK; OutputBufferSize -= Crc32SectionHeader->GuidedSectionHeader.DataOffset; // diff --git a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c index bf1a969821..a3ea083b51 100644 --- a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c +++ b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c @@ -43,7 +43,7 @@ EFI_DPC_PROTOCOL *mDpc = NULL; // // All the supported IP4 maskes in host byte order. // -IP4_ADDR mIp4AllMasks[IP4_MASK_NUM] = { +IP4_ADDR gIp4AllMasks[IP4_MASK_NUM] = { 0x00000000, 0x80000000, 0xC0000000, @@ -104,7 +104,7 @@ NetGetMaskLength ( INTN Index; for (Index = 0; Index < IP4_MASK_NUM; Index++) { - if (NetMask == mIp4AllMasks[Index]) { + if (NetMask == gIp4AllMasks[Index]) { break; } } @@ -179,7 +179,7 @@ Ip4IsUnicast ( } if (NetMask == 0) { - NetMask = mIp4AllMasks[Class << 3]; + NetMask = gIp4AllMasks[Class << 3]; } if (((Ip &~NetMask) == ~NetMask) || ((Ip &~NetMask) == 0)) { -- cgit v1.2.3