On Fri, Feb 24, 2012 at 10:15:51AM +0100, Andreas Färber wrote: > Am 24.02.2012 01:36, schrieb David Gibson: > > Currently get_image_size(), used to find the size of files, returns an int. > > But for modern systems, int may be only 32-bit and we can have files > > larger than that. > > > > This patch, therefore, changes the return type of get_image_size() to off_t > > (the same as the return type from lseek() itself). It also audits all the > > callers of get_image_size() to make sure they process the new unsigned > > return type correctly. > > It's a size, so why off_t and not size_t?
Because it's a file size, rather than an in-memory size. Or more specifically, off_t is the return type of lseek() which is where the information is coming from in the first place. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson