A large number of changes have been mades as a result of running csplint on the
code.
More to follow....
Updates becasue of xsplint analysis of code.
More changes to satisfy splint. Passes the -weak tests pretty well now,
with a few warnings because of 32/64 bit differences.