Author: spouliot Date: 2008-02-17 15:12:19 -0500 (Sun, 17 Feb 2008) New Revision: 95996
Modified: trunk/mono-tools/gendarme/rules/Gendarme.Rules.Interoperability/ChangeLog trunk/mono-tools/gendarme/rules/Gendarme.Rules.Interoperability/GetLastErrorMustBeCalledRightAfterPInvokeRule.cs Log: 2008-02-17 Sebastien Pouliot <[EMAIL PROTECTED]> * GetLastErrorMustBeCalledRightAfterPInvokeRule.cs: Change to static and initialize it directly. Modified: trunk/mono-tools/gendarme/rules/Gendarme.Rules.Interoperability/ChangeLog =================================================================== --- trunk/mono-tools/gendarme/rules/Gendarme.Rules.Interoperability/ChangeLog 2008-02-17 19:08:47 UTC (rev 95995) +++ trunk/mono-tools/gendarme/rules/Gendarme.Rules.Interoperability/ChangeLog 2008-02-17 20:12:19 UTC (rev 95996) @@ -1,3 +1,8 @@ +2008-02-17 Sebastien Pouliot <[EMAIL PROTECTED]> + + * GetLastErrorMustBeCalledRightAfterPInvokeRule.cs: Change to static + and initialize it directly. + 2008-02-16 Sebastien Pouliot <[EMAIL PROTECTED]> * GetLastErrorMustBeCalledRightAfterPInvokeRule.cs: Fix the case Modified: trunk/mono-tools/gendarme/rules/Gendarme.Rules.Interoperability/GetLastErrorMustBeCalledRightAfterPInvokeRule.cs =================================================================== --- trunk/mono-tools/gendarme/rules/Gendarme.Rules.Interoperability/GetLastErrorMustBeCalledRightAfterPInvokeRule.cs 2008-02-17 19:08:47 UTC (rev 95995) +++ trunk/mono-tools/gendarme/rules/Gendarme.Rules.Interoperability/GetLastErrorMustBeCalledRightAfterPInvokeRule.cs 2008-02-17 20:12:19 UTC (rev 95996) @@ -56,15 +56,12 @@ private const string Message = "GetLastError() should be called immediately after this the PInvoke call."; private const string GetLastError = "System.Int32 System.Runtime.InteropServices.Marshal::GetLastWin32Error()"; - private List<string> AllowedCalls; - public GetLastErrorMustBeCalledRightAfterPInvokeRule () - { - AllowedCalls = new List<string> (); - AllowedCalls.Add ("System.Boolean System.Runtime.InteropServices.SafeHandle::get_IsInvalid()"); - AllowedCalls.Add ("System.Boolean System.IntPtr::op_Inequality(System.IntPtr,System.IntPtr)"); - AllowedCalls.Add ("System.Boolean System.IntPtr::op_Equality(System.IntPtr,System.IntPtr)"); - } + static List<string> AllowedCalls = new List<string> () { + "System.Boolean System.Runtime.InteropServices.SafeHandle::get_IsInvalid()", + "System.Boolean System.IntPtr::op_Inequality(System.IntPtr,System.IntPtr)", + "System.Boolean System.IntPtr::op_Equality(System.IntPtr,System.IntPtr)" + }; List<Branch> branches = new List<Branch> (); _______________________________________________ Mono-patches maillist - Mono-patches@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-patches