Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions src/Microsoft.Windows.CsWin32/templates/BOOL.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
partial struct BOOL
{
internal unsafe BOOL(bool value) => this.Value = *(sbyte*)&value;
public static unsafe implicit operator bool(BOOL value)
{
sbyte v = checked((sbyte)value.Value);
return *(bool*)&v;
}

internal BOOL(bool value) => this.Value = value ? 1 : 0;
public static implicit operator bool(BOOL value) => this.value != 0;
public static implicit operator BOOL(bool value) => new BOOL(value);
}
9 changes: 2 additions & 7 deletions src/Microsoft.Windows.CsWin32/templates/BOOLEAN.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
partial struct BOOLEAN
{
internal unsafe BOOLEAN(bool value) => this.Value = *(byte*)&value;
public static unsafe implicit operator bool(BOOLEAN value)
{
byte v = checked((byte)value.Value);
return *(bool*)&v;
}

internal BOOLEAN(bool value) => this.Value = value ? 1 : 0;
public static implicit operator bool(BOOLEAN value) => this.value != 0;
public static implicit operator BOOLEAN(bool value) => new BOOLEAN(value);
}