# HG changeset patch # User luis # Date 1202119652 -3600 # Node ID 193558036df4438249c2cdf804ecf67343cc1e78 # Parent d2abf6c8c27bb83baa0bdef0db961ffb0da4f4fc Minor changes to guarantee that UNS8 cast is well done diff -r d2abf6c8c27b -r 193558036df4 src/pdo.c --- a/src/pdo.c Fri Feb 01 18:06:55 2008 +0100 +++ b/src/pdo.c Mon Feb 04 11:07:32 2008 +0100 @@ -68,7 +68,7 @@ /* pointer fo the var which holds the mapping parameter of an mapping entry */ UNS32* pMappingParameter = (UNS32*) TPDO_map->pSubindex[prp_j + 1].pObject; UNS16 index = (UNS16)((*pMappingParameter) >> 16); - UNS8 Size = (UNS8)(*pMappingParameter); /* Size in bits */ + UNS8 Size = (UNS8)(*pMappingParameter) & (UNS32)0x000000FF); /* Size in bits */ /* get variable only if Size != 0 and Size is lower than remaining bits in the PDO */ if(Size && ((offset + Size) <= 64)) { @@ -229,7 +229,7 @@ /* and the lower 8 bits contains the size of the mapped variable. */ - Size = (UNS8)(*pMappingParameter); + Size = (UNS8)(*pMappingParameter) & (UNS32)0x000000FF); /* set variable only if Size != 0 and Size is lower than remaining bits in the PDO */ if(Size && ((offset + Size) <= (m->len << 3))) {