Skip to content

Commit 9206826

Browse files
deprecate lua bit functions which have direct operator counterparts in new lua
1 parent dcd570b commit 9206826

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/BizHawk.Client.Common/lua/LuaHelperLibs/BitLuaLibrary.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,39 @@ public BitLuaLibrary(IPlatformLuaLibEnv luaLibsImpl, ApiContainer apiContainer,
1313

1414
public override string Name => "bit";
1515

16+
[LuaDeprecatedMethod]
1617
[LuaMethodExample("local uibitban = bit.band( 1000, 4 );")]
1718
[LuaMethod("band", "Bitwise AND of 'val' against 'amt'")]
1819
public static uint Band(uint val, uint amt)
1920
{
2021
return val & amt;
2122
}
2223

24+
[LuaDeprecatedMethod]
2325
[LuaMethodExample("local uibitbno = bit.bnot( 1000 );")]
2426
[LuaMethod("bnot", "Bitwise NOT of 'val'")]
2527
public static uint Bnot(uint val)
2628
{
2729
return ~val;
2830
}
2931

32+
[LuaDeprecatedMethod]
3033
[LuaMethodExample("local uibitbor = bit.bor( 1000, 4 );")]
3134
[LuaMethod("bor", "Bitwise OR of 'val' against 'amt'")]
3235
public static uint Bor(uint val, uint amt)
3336
{
3437
return val | amt;
3538
}
3639

40+
[LuaDeprecatedMethod]
3741
[LuaMethodExample("local uibitbxo = bit.bxor( 1000, 4 );")]
3842
[LuaMethod("bxor", "Bitwise XOR of 'val' against 'amt'")]
3943
public static uint Bxor(uint val, uint amt)
4044
{
4145
return val ^ amt;
4246
}
4347

48+
[LuaDeprecatedMethod]
4449
[LuaMethodExample("local uibitlsh = bit.lshift( 1000, 4 );")]
4550
[LuaMethod("lshift", "Logical shift left of 'val' by 'amt' bits")]
4651
public static uint Lshift(uint val, int amt)
@@ -62,6 +67,7 @@ public static uint Ror(uint val, int amt)
6267
return (val >> amt) | (val << (32 - amt));
6368
}
6469

70+
[LuaDeprecatedMethod]
6571
[LuaMethodExample("local uibitrsh = bit.rshift( 1000, 4 );")]
6672
[LuaMethod("rshift", "Logical shift right of 'val' by 'amt' bits")]
6773
public static uint Rshift(uint val, int amt)

0 commit comments

Comments
 (0)