From 1bffbe8dee04bd58d27413f0e4ba10fbee2bcede Mon Sep 17 00:00:00 2001 From: Andrius Bentkus Date: Wed, 4 Mar 2015 16:13:44 +0100 Subject: [PATCH 1/3] Fix warning, OrignalPtr is an IntPtr and therefore can not be null. --- src/Core/Parser/ASTConverter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Core/Parser/ASTConverter.cs b/src/Core/Parser/ASTConverter.cs index 593c9a3c..f66bc2d0 100644 --- a/src/Core/Parser/ASTConverter.cs +++ b/src/Core/Parser/ASTConverter.cs @@ -619,7 +619,7 @@ namespace CppSharp if (decl == null) return null; - if (decl.OriginalPtr == null) + if (decl.OriginalPtr == IntPtr.Zero) throw new NotSupportedException("Original pointer must not be null"); var originalPtr = decl.OriginalPtr; From 5102fb55d7caf4d65e44c18c15bec94e35d969c0 Mon Sep 17 00:00:00 2001 From: Andrius Bentkus Date: Wed, 4 Mar 2015 16:14:19 +0100 Subject: [PATCH 2/3] Remove not used variable. --- src/Generator.Tests/AST/TestAST.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Generator.Tests/AST/TestAST.cs b/src/Generator.Tests/AST/TestAST.cs index 99445547..c1f9ddd8 100644 --- a/src/Generator.Tests/AST/TestAST.cs +++ b/src/Generator.Tests/AST/TestAST.cs @@ -9,8 +9,6 @@ namespace CppSharp.Generator.Tests.AST [TestFixture] public class TestAST : ASTTestFixture { - private PassBuilder passBuilder; - [TestFixtureSetUp] public void Init() { @@ -20,7 +18,6 @@ namespace CppSharp.Generator.Tests.AST public void Setup() { ParseLibrary("AST.h", "ASTExtensions.h"); - passBuilder = new PassBuilder(Driver); } [Test] From 2a8b45e54980360e21be903091260e5729cfbc1f Mon Sep 17 00:00:00 2001 From: Andrius Bentkus Date: Wed, 4 Mar 2015 16:16:51 +0100 Subject: [PATCH 3/3] Throw exception on not support VTable instead of silently using Itanium. --- src/Generator/AST/VTables.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Generator/AST/VTables.cs b/src/Generator/AST/VTables.cs index 040cf740..31a7689b 100644 --- a/src/Generator/AST/VTables.cs +++ b/src/Generator/AST/VTables.cs @@ -12,11 +12,13 @@ namespace CppSharp.AST { case CppAbi.Microsoft: return GatherVTableMethodsMS(@class); - default: + case CppAbi.Itanium: return GatherVTableMethodsItanium(@class); } - throw new NotSupportedException(); + throw new NotSupportedException( + string.Format("VTable format for {0} is not supported", @class.Layout.ABI.ToString().Split('.').Last()) + ); } private static List GatherVTableMethodEntries(VTableLayout layout)