]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Ecc/c.py
BaseTools/Ecc/EOT: Add Python 3 support on ECC and EOT tools.
[mirror_edk2.git] / BaseTools / Source / Python / Ecc / c.py
index 953f1630b69394d0ea1eee3848d2da3313a79a7b..7105cdf2a95110b0834d9a14a30fdbd0bb5e2970 100644 (file)
@@ -35,7 +35,7 @@ IgnoredKeywordList = ['EFI_ERROR']
 \r
 def GetIgnoredDirListPattern():\r
     skipList = list(EccGlobalData.gConfig.SkipDirList) + ['.svn']\r
-    DirString = string.join(skipList, '|')\r
+    DirString = '|'.join(skipList)\r
     p = re.compile(r'.*[\\/](?:%s)[\\/]?.*' % DirString)\r
     return p\r
 \r
@@ -963,7 +963,7 @@ def StripComments(Str):
             ListFromStr[Index] = ' '\r
             Index += 1\r
         # check for // comment\r
-        elif ListFromStr[Index] == '/' and ListFromStr[Index + 1] == '/' and ListFromStr[Index + 2] != '\n':\r
+        elif ListFromStr[Index] == '/' and ListFromStr[Index + 1] == '/':\r
             InComment = True\r
             DoubleSlashComment = True\r
 \r
@@ -1297,7 +1297,7 @@ def CheckFuncLayoutReturnType(FullFileName):
         Result0 = Result[0]\r
         if Result0.upper().startswith('STATIC'):\r
             Result0 = Result0[6:].strip()\r
-        Index = Result0.find(ReturnType)\r
+        Index = Result0.find(TypeStart)\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