//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
// UserRTX.NET satellite library | Author: Sergei Y.Kitáev
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
using System;

#if !WASM
namespace user_rtx { using u = user_rtx;
#else
namespace user_rtx.wasm { using u = user_rtx.wasm;
#endif

static partial class bitwise {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

public static int Clear( ref int location, int flagsToClear ) =>
   location &= ~flagsToClear;

public static long Clear( ref long location, long flagsToClear ) =>
   location &= ~flagsToClear;

public static short Clear( ref short location, short flagsToClear ) =>
   location &= unchecked( (short)~flagsToClear );

public static byte Clear( ref byte location, byte flagsToClear ) =>
   location &= unchecked( (byte)~flagsToClear );

//--------------------------------------------------------------------------------------------------

[CLSCompliant( false )]
public static uint Clear( ref uint location, uint flagsToClear ) =>
   location &= ~flagsToClear;

[CLSCompliant( false )]
public static ulong Clear( ref ulong location, ulong flagsToClear ) =>
   location &= ~flagsToClear;

[CLSCompliant( false )]
public static ushort Clear( ref ushort location, ushort flagsToClear ) =>
   location &= unchecked( (ushort)~flagsToClear );

[CLSCompliant( false )]
public static sbyte Clear( ref sbyte location, sbyte flagsToClear ) =>
   location &= unchecked( (sbyte)~flagsToClear );

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
} // bitwise

} // user_rtx (.wasm)
