switches static to reinterpret_cast references #218
adds a bunch of explicit casts where signedness or truncation occurs references #218