Quell unused variable warning - I *think* this is what this function is actually supposed to do?
apply r55331 - use delete[] to free new[] memory
r55977 - malloc.h has been replaced by stdlib.h
r55978 - force 64b constants to use unsigned long long instead of compile native long, which is too small on 32b machines
r55979 - explicitely cast stream position before comparison to avoid an ambiguous overload for the == operator
r56686 - clear compiler warning