From 2229c413544eecae0e957ba0c19003a80a17388a Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Tue, 29 Sep 2020 16:18:05 -0700 Subject: [PATCH] Fix true and false for the Bool marshaler While working on testing the SafeHandle marshalling code I'm working on, I noticed that I fat-fingered the true and false values for the bool marshallers and flipped the values for CBool and WinBool --- .../DllImportGenerator/Marshalling/BoolMarshaller.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DllImportGenerator/DllImportGenerator/Marshalling/BoolMarshaller.cs b/DllImportGenerator/DllImportGenerator/Marshalling/BoolMarshaller.cs index 14599fab49d6..a0416bbf730c 100644 --- a/DllImportGenerator/DllImportGenerator/Marshalling/BoolMarshaller.cs +++ b/DllImportGenerator/DllImportGenerator/Marshalling/BoolMarshaller.cs @@ -105,7 +105,7 @@ public IEnumerable Generate(TypePositionInfo info, StubCodeCont internal class CBoolMarshaller : BoolMarshallerBase { public CBoolMarshaller() - : base(PredefinedType(Token(SyntaxKind.ByteKeyword)), 0, 1) + : base(PredefinedType(Token(SyntaxKind.ByteKeyword)), trueValue: 1, falseValue: 0) { } } @@ -113,7 +113,7 @@ public CBoolMarshaller() internal class WinBoolMarshaller : BoolMarshallerBase { public WinBoolMarshaller() - : base(PredefinedType(Token(SyntaxKind.IntKeyword)), 0, 1) + : base(PredefinedType(Token(SyntaxKind.IntKeyword)), trueValue: 1, falseValue: 0) { } }