Convert pointer arithmetic to use longs
Change printf format specifier for 64-bit to use PRIu64 from inttypes.h