From 286f1263df584cbf016a9613badcc449d99730f4 Mon Sep 17 00:00:00 2001 From: James Snyder Date: Mon, 2 May 2011 17:28:39 -0500 Subject: [PATCH] bitarray: fix post-creation value setting for arrays with value sizes of 8,16,32 bits --- src/modules/bitarray.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/bitarray.c b/src/modules/bitarray.c index 0c69876d..1df3283c 100644 --- a/src/modules/bitarray.c +++ b/src/modules/bitarray.c @@ -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;