]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools/Ecc: Remove checkpoint for STATIC modifier
authorHess Chen <hesheng.chen@intel.com>
Mon, 24 Aug 2015 02:53:27 +0000 (02:53 +0000)
committerhchen30 <hchen30@Edk2>
Mon, 24 Aug 2015 02:53:27 +0000 (02:53 +0000)
Remove checkpoint for STATIC modifier to allow this usage

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hess Chen <hesheng.chen@intel.com>
Reviewed-by: YangX Li <yangx.li@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18264 6f19259b-4bc3-4df7-8a09-765794883524

BaseTools/Source/Python/Ecc/c.py
BaseTools/Source/Python/Ecc/config.ini

index a7eefa1e07a446503b6af14f203095ec74934cf8..dcb37e5632fb88b96991ad04f2978f7421b4d57d 100644 (file)
@@ -1289,13 +1289,13 @@ def CheckFuncLayoutReturnType(FullFileName):
         FuncName = Result[5]\r
         if EccGlobalData.gException.IsException(ERROR_C_FUNCTION_LAYOUT_CHECK_RETURN_TYPE, FuncName):\r
             continue\r
-        Index = Result[0].find(ReturnType)\r
+        Result0 = Result[0]\r
+        if Result0.upper().startswith('STATIC'):\r
+            Result0 = Result0[6:].strip()\r
+        Index = Result0.find(ReturnType)\r
         if Index != 0 or Result[3] != 0:\r
             PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_RETURN_TYPE, '[%s] Return Type should appear at the start of line' % FuncName, 'Function', Result[1])\r
 \r
-        if Result[2] == Result[4]:\r
-            PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_RETURN_TYPE, '[%s] Return Type should appear on its own line' % FuncName, 'Function', Result[1])\r
-\r
 def CheckFuncLayoutModifier(FullFileName):\r
     ErrorMsgList = []\r
 \r
@@ -1329,7 +1329,10 @@ def CheckFuncLayoutModifier(FullFileName):
         TypeStart = ReturnType.split()[0]\r
 #        if len(ReturnType) == 0:\r
 #            continue\r
-        Index = Result[0].find(TypeStart)\r
+        Result0 = Result[0]\r
+        if Result0.upper().startswith('STATIC'):\r
+            Result0 = Result0[6:].strip()\r
+        Index = Result0.find(TypeStart)\r
         if Index != 0:\r
             PrintErrorMsg(ERROR_C_FUNCTION_LAYOUT_CHECK_OPTIONAL_FUNCTIONAL_MODIFIER, '', 'Function', Result[1])\r
 \r
index b3c1204aed35e694cbbf1b9d6150bdeed0ea70e3..e3481251af9eff996be7dc6d11abe511dac1bfa5 100644 (file)
@@ -41,7 +41,7 @@ AutoCorrect = 1
 #\r
 # List customized Modifer here, split with ','\r
 #\r
-ModifierList = IN, OUT, OPTIONAL, UNALIGNED, EFI_RUNTIMESERVICE, EFI_BOOTSERVICE, EFIAPI, TPMINTERNALAPI\r
+ModifierList = IN, OUT, OPTIONAL, UNALIGNED, EFI_RUNTIMESERVICE, EFI_BOOTSERVICE, EFIAPI, TPMINTERNALAPI, STATIC\r
 \r
 #\r
 # General Checking\r