Switch all the (u)long types to (u)int32_t where appropriate.
Join the license header with historical comments using a separator so IDEs can correctly parse the initial header. Also use .gitattributes to ensure all files are LF.