fix warning about implicit conversion from unsigned long to int

I got this warning in the latest Xcode beta.  This PR should fix this.