[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Eliminating grub_size_t

From: Marco Gerards
Subject: Re: Eliminating grub_size_t
Date: Thu, 03 Jul 2008 20:02:05 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

Pavel Roskin <address@hidden> writes:

> On Wed, 2008-07-02 at 20:46 +0300, Vesa Jääskeläinen wrote:
>> If reiserfs is using it in wrong place, fix the reiserfs. If you are 
>> reading some file system variable, then you should use grub_uintN_t to 
>> specify storage size in bits.
> OK, I'll have another look at the code.
>> size_t is usually used as common index or offset (or size) to some 
>> buffer. size_t is returned by sizeof(). It is meant to be optimal size 
>> for platform. Eg. on 64bit memory bus it is 64bit and on 32bit memory 
>> bus it is 32bit. What grub is doing here is just defining yet another 
>> type for the same thing.
>> Google for size_t if you want to find out more about it.
> I know what it is.  I believe int should be as good as size_t for most
> purposes is we are not working with very large structures or read
> gigabytes of data from files at once.

Perhaps, but it doesn't hurt either.  I think it is a good thing to
have a type such that it is clear what kind of variable is used.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]