mirror of
https://github.com/MoleskiCoder/EightBitNet.git
synced 2026-04-21 12:16:55 +00:00
Correct some straightforward analysis issues.
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
+6
-6
@@ -10,17 +10,17 @@ namespace EightBit
|
||||
{
|
||||
}
|
||||
|
||||
public static byte SetFlag(byte input, byte flag) => (byte)(input | flag);
|
||||
public static byte SetBit(byte input, byte which) => (byte)(input | which);
|
||||
|
||||
public static byte SetFlag(byte input, byte flag, int condition) => SetFlag(input, flag, condition != 0);
|
||||
public static byte SetBit(byte input, byte which, int condition) => SetBit(input, which, condition != 0);
|
||||
|
||||
public static byte SetFlag(byte input, byte flag, bool condition) => condition ? SetFlag(input, flag) : ClearFlag(input, flag);
|
||||
public static byte SetBit(byte input, byte which, bool condition) => condition ? SetBit(input, which) : ClearBit(input, which);
|
||||
|
||||
public static byte ClearFlag(byte input, byte flag) => (byte)(input & (byte)~flag);
|
||||
public static byte ClearBit(byte input, byte which) => (byte)(input & (byte)~which);
|
||||
|
||||
public static byte ClearFlag(byte input, byte flag, int condition) => ClearFlag(input, flag, condition != 0);
|
||||
public static byte ClearBit(byte input, byte which, int condition) => ClearBit(input, which, condition != 0);
|
||||
|
||||
public static byte ClearFlag(byte input, byte flag, bool condition) => SetFlag(input, flag, !condition);
|
||||
public static byte ClearBit(byte input, byte which, bool condition) => SetBit(input, which, !condition);
|
||||
|
||||
public static byte HighByte(int value) => (byte)(value >> 8);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user