arm64 support

Warnings occur when compiling for arm64.

I've had a go at resolving these issues myself, but there is no guarantee that I've done it correctly. I'll make a pull request if you want to take a look.