A whole lot of int -> unsigned int and int -> result and int -> bool changes.