本文整理汇总了C#中ILuaState.PushUnsigned方法的典型用法代码示例。如果您正苦于以下问题:C# ILuaState.PushUnsigned方法的具体用法?C# ILuaState.PushUnsigned怎么用?C# ILuaState.PushUnsigned使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ILuaState
的用法示例。
在下文中一共展示了ILuaState.PushUnsigned方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: B_ArithShift
private static int B_ArithShift( ILuaState lua )
{
uint r = lua.L_CheckUnsigned( 1 );
int i = lua.L_CheckInteger( 2 );
if( i < 0 || ((r & ((uint)1 << (LUA_NBITS-1))) == 0) )
return B_Shift( lua, r, -i );
else // arithmetic shift for `nagetive' number
{
if( i>= LUA_NBITS )
r = ALLONES;
else
r = Trim((r >> i) | ~(~(uint)0 >> i)); // add signal bit
lua.PushUnsigned( r );
}
return 1;
}
示例2: B_Shift
private static int B_Shift( ILuaState lua, uint r, int i )
{
if( i < 0 ) // shift right?
{
i = -i;
r = Trim( r );
if( i >= LUA_NBITS ) r = 0;
else r >>= i;
}
else // shift left
{
if( i >= LUA_NBITS ) r = 0;
else r <<= i;
r = Trim(r);
}
lua.PushUnsigned( r );
return 1;
}
示例3: B_And
private static int B_And( ILuaState lua )
{
uint r = AndAux( lua );
lua.PushUnsigned( r );
return 1;
}
示例4: B_Replace
private static int B_Replace( ILuaState lua )
{
uint r = lua.L_CheckUnsigned( 1 );
uint v = lua.L_CheckUnsigned( 2 );
int w;
int f = FieldArgs( lua, 3, out w );
uint m = Mask( w );
v &= m; //erase bits outside given width
r = (r & ~(m << f)) | (v << f);
lua.PushUnsigned( r );
return 1;
}
示例5: B_Rotate
private static int B_Rotate( ILuaState lua, int i )
{
uint r = lua.L_CheckUnsigned( 1 );
i &= (LUA_NBITS-1); // i = i % NBITS
r = Trim( r );
r = (r << i) | (r >> (LUA_NBITS - i));
lua.PushUnsigned( Trim(r) );
return 1;
}
示例6: B_Extract
private static int B_Extract( ILuaState lua )
{
uint r = lua.L_CheckUnsigned( 1 );
int w;
int f = FieldArgs( lua, 2, out w );
r = (r >> f) & Mask(w);
lua.PushUnsigned( r );
return 1;
}
示例7: B_Xor
private static int B_Xor( ILuaState lua )
{
int n = lua.GetTop();
uint r = 0;
for( int i=1; i<=n; ++i )
{
r ^= lua.L_CheckUnsigned( i );
}
lua.PushUnsigned( Trim(r) );
return 1;
}
示例8: B_Not
private static int B_Not( ILuaState lua )
{
uint r = ~lua.L_CheckUnsigned( 1 );
lua.PushUnsigned( Trim(r) );
return 1;
}