From 6e0255f6cfabc540ed6272294fb3f5e81592ab6d Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Fri, 2 Apr 2021 12:11:01 +0100 Subject: [PATCH] Use explicit narrowing conversion --- X10D/src/BooleanExtensions/BooleanExtensions.Unsigned.cs | 4 ++-- X10D/src/BooleanExtensions/BooleanExtensions.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/X10D/src/BooleanExtensions/BooleanExtensions.Unsigned.cs b/X10D/src/BooleanExtensions/BooleanExtensions.Unsigned.cs index de02a17..85cd623 100644 --- a/X10D/src/BooleanExtensions/BooleanExtensions.Unsigned.cs +++ b/X10D/src/BooleanExtensions/BooleanExtensions.Unsigned.cs @@ -27,7 +27,7 @@ namespace X10D.BooleanExtensions [CLSCompliant(false)] public static sbyte ToSByte(this bool value) { - return value ? 1 : 0; + return (sbyte)(value ? 1 : 0); } /// @@ -53,7 +53,7 @@ namespace X10D.BooleanExtensions [CLSCompliant(false)] public static ushort ToUInt16(this bool value) { - return value ? 1 : 0; + return (ushort)(value ? 1 : 0); } /// diff --git a/X10D/src/BooleanExtensions/BooleanExtensions.cs b/X10D/src/BooleanExtensions/BooleanExtensions.cs index ca8c8f9..fe05ed5 100644 --- a/X10D/src/BooleanExtensions/BooleanExtensions.cs +++ b/X10D/src/BooleanExtensions/BooleanExtensions.cs @@ -59,7 +59,7 @@ namespace X10D.BooleanExtensions /// public static byte ToByte(this bool value) { - return value ? 1 : 0; + return (byte)(value ? 1 : 0); } /// @@ -135,7 +135,7 @@ namespace X10D.BooleanExtensions /// public static short ToInt16(this bool value) { - return value ? 1 : 0; + return (short)(value ? 1 : 0); } ///