ugtrain: improve the use of common data types

Also for C we use bools now with the 'stdbool.h' include. This makes
bools much more obvious and unified.

Also the type 'ptr_t' can be improved by just using 'unsigned long'
for it. On 64-bit systems it has 8 bytes and on 32-bit systems it
has 4 bytes.