Intel driver doesn't like signed integer division.

If you use signed integer division with the Intel HD 4000
driver, it prints a warning (which gets turned into an error) suggesting
that signed integer division should be avoided in favor of unsigned division.

I'm not sure this patch is the right way to fix this issue; maybe some of the other variables should have type uint?