Remove 5 unused `Bit` methods and reduce visibility of 2

This commit is contained in:
YoshiRulz 2025-07-26 12:06:43 +10:00
parent f7866ce0b7
commit f458acbbb4
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
2 changed files with 2 additions and 29 deletions

View File

@ -18,43 +18,16 @@ namespace BizHawk.Common
return new Bit((uint)rhs);
}
public static implicit operator Bit(uint rhs)
{
Debug.Assert((rhs & ~1) is 0, "higher bits can't be used");
return new Bit(rhs);
}
public static implicit operator Bit(byte rhs)
{
Debug.Assert((rhs & ~1) is 0, "higher bits can't be used");
return new Bit(rhs);
}
public static implicit operator Bit(bool rhs)
{
return new Bit(rhs ? (byte)1 : (byte)0);
}
public static implicit operator long(Bit rhs)
{
return rhs._val;
}
public static implicit operator int(Bit rhs)
{
return (int)rhs._val;
}
public static implicit operator uint(Bit rhs)
{
return rhs._val;
}
public static implicit operator byte(Bit rhs)
{
return (byte)rhs._val;
}
public static implicit operator bool(Bit rhs)
{
return rhs._val != 0;

View File

@ -99,12 +99,12 @@ namespace BizHawk.Common.IOExtensions
}
}
public static void WriteBit(this BinaryWriter bw, Bit bit)
internal static void WriteBit(this BinaryWriter bw, Bit bit)
{
bw.Write((bool)bit);
}
public static Bit ReadBit(this BinaryReader br)
internal static Bit ReadBit(this BinaryReader br)
{
return br.ReadBoolean();
}