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:
parent
ae856ae163
commit
286f1263df
@ -175,15 +175,15 @@ static int bitarray_set( lua_State *L )
|
|||||||
switch( pa->elsize )
|
switch( pa->elsize )
|
||||||
{
|
{
|
||||||
case 8:
|
case 8:
|
||||||
pa->values[ idx ] = val;;
|
pa->values[ idx ] = ( u8 )newval;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 16:
|
case 16:
|
||||||
*( ( u16* )pa->values + idx ) = val;
|
*( ( u16* )pa->values + idx ) = ( u16 )newval;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 32:
|
case 32:
|
||||||
*( ( u32* )pa->values + idx ) = val;
|
*( ( u32* )pa->values + idx ) = ( u32 )newval;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user