use gsize instead of int where appropriate (64-bit cleanliness fix)