1
0
mirror of https://github.com/elua/elua.git synced 2025-01-08 20:56:17 +08:00

bitarray: fix post-creation value setting for arrays with value sizes of 8,16,32 bits

This commit is contained in:
James Snyder 2011-05-02 17:28:39 -05:00
parent ae856ae163
commit 286f1263df

View File

@ -175,15 +175,15 @@ static int bitarray_set( lua_State *L )
switch( pa->elsize )
{
case 8:
pa->values[ idx ] = val;;
pa->values[ idx ] = ( u8 )newval;
break;
case 16:
*( ( u16* )pa->values + idx ) = val;
*( ( u16* )pa->values + idx ) = ( u16 )newval;
break;
case 32:
*( ( u32* )pa->values + idx ) = val;
*( ( u32* )pa->values + idx ) = ( u32 )newval;
break;
}
return 0;