Replace manual typedefs with stdint.h, replace PRI64[xdu] with PRI[xdu]64 from inttypes.h