fix signed/unsigned issue pointed out by old apple gcc