fix type mess by using stdint.h types

there was a plethora of uint, uchar, ushort etc macros used,
which caused build issues in a number of cases, for example when
compiling against musl libc.
the function is only used from one other function, which came later in the source - so it couldn't see the declaration, which results in an implicit declaration and a gcc warning.
an alternate solution is to leave the function where it was but add a prototype declaration before the function using it, however this is more code in the end.
and if the function signature changes, it has to be changed in 2 places.