printf: cast variables to the expected type

%x expects unsigned int and %p expects void *

GCC emits a diagnostic about %p/void* in pedantic mode:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26542
Merge pull request #2563 from cremno/printf-cast-variables-to-expected-type

printf: cast variables to the expected type