Below is some code from switch statement.
#define WriteMemory(A,V) *(volatile unsigned long*)(A)=(V)
value = getvalue();
value &= 0xffffffff;
unsigned long isn't guaranteed to be 32 bit by the C standard. It is only guaranteed to be able to hold 32 bit values.
and-ing it with
0xffffffff makes sure any bits over the 32 are zeroed out.