compiler: fix cast usage

Issue: reinterpret_cast isn't capable of removing constness.

Solution: Use C style casting which is capable of removing constness.

Change-Id: Id7815208de9c82643096ec0ea530f60361d261ca