forked from microsoft/CsWin32
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changes from discussions in microsoft#624
- Loading branch information
Showing
2 changed files
with
4 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,6 @@ | ||
partial struct BOOL | ||
{ | ||
internal unsafe BOOL(bool value) => this.Value = value ? 1 : 0; | ||
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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,6 @@ | ||
partial struct BOOLEAN | ||
{ | ||
internal unsafe BOOLEAN(bool value) => this.Value = value ? 1 : 0; | ||
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); | ||
} |