use intpointer() casts instead of uint() for casting pointer.