fix splint issues

This PR makes the code processable with Splint.

Tested using Splint 3.1.2, Mac OS X.