From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B97B11A1E3C for ; Tue, 18 Oct 2016 01:46:17 -0700 (PDT) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP; 18 Oct 2016 01:46:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,361,1473145200"; d="scan'208";a="180933764" Received: from ray-dev.ccr.corp.intel.com ([10.239.9.25]) by fmsmga004.fm.intel.com with ESMTP; 18 Oct 2016 01:46:16 -0700 From: Ruiyu Ni To: edk2-devel@lists.01.org Cc: Jiewen Yao , Michael D Kinney Date: Tue, 18 Oct 2016 16:46:06 +0800 Message-Id: <20161018084613.58420-2-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.9.0.windows.1 In-Reply-To: <20161018084613.58420-1-ruiyu.ni@intel.com> References: <20161018084613.58420-1-ruiyu.ni@intel.com> Subject: [PATCH v2 1/8] ShellPkg: Move SHELL_FREE_NON_NULL from ShellBase.h to ShellLib.h X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Oct 2016 08:46:17 -0000 The more proper place for macro SHELL_FREE_NON_NULL is ShellLib.h instead of ShellBase.h. Modify Compress.c to resolve build failure due to this change. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni Reviewed-by: Jaben Carsey Cc: Jiewen Yao Cc: Michael D Kinney --- ShellPkg/Include/Library/ShellLib.h | 10 +++++++++- ShellPkg/Include/ShellBase.h | 10 +--------- ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ShellPkg/Include/Library/ShellLib.h b/ShellPkg/Include/Library/ShellLib.h index fe4b9cf..fafa041 100644 --- a/ShellPkg/Include/Library/ShellLib.h +++ b/ShellPkg/Include/Library/ShellLib.h @@ -1,7 +1,7 @@ /** @file Provides interface to shell functionality for shell commands and applications. - Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
+ Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -24,6 +24,14 @@ #include #include +#define SHELL_FREE_NON_NULL(Pointer) \ + do { \ + if ((Pointer) != NULL) { \ + FreePool((Pointer)); \ + (Pointer) = NULL; \ + } \ + } while(FALSE) + // (20 * (6+5+2))+1) unicode characters from EFI FAT spec (doubled for bytes) #define MAX_FILE_NAME_LEN 512 diff --git a/ShellPkg/Include/ShellBase.h b/ShellPkg/Include/ShellBase.h index 09f87b4..4b7a3d1 100644 --- a/ShellPkg/Include/ShellBase.h +++ b/ShellPkg/Include/ShellBase.h @@ -1,7 +1,7 @@ /** @file Root include file for Shell Package modules that utilize the SHELL_RETURN type - Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -17,14 +17,6 @@ typedef VOID *SHELL_FILE_HANDLE; -#define SHELL_FREE_NON_NULL(Pointer) \ - do { \ - if ((Pointer) != NULL) { \ - FreePool((Pointer)); \ - (Pointer) = NULL; \ - } \ - } while(FALSE) - typedef enum { /// /// The operation completed successfully. diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c index dda2fed..da8e647 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Compress.c @@ -7,7 +7,7 @@ This sequence is further divided into Blocks and Huffman codings are applied to each Block. - Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
+ Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -17,12 +17,12 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ - +#include +#include #include #include #include -#include -#include +#include // // Macro Definitions -- 2.9.0.windows.1