From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KE6PT-00077M-8Q for mharc-grub-devel@gnu.org; Wed, 02 Jul 2008 13:46:27 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KE6PR-00076n-9y for grub-devel@gnu.org; Wed, 02 Jul 2008 13:46:25 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KE6PL-00073V-KL for grub-devel@gnu.org; Wed, 02 Jul 2008 13:46:23 -0400 Received: from [199.232.76.173] (port=36311 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KE6PL-00073L-Eq for grub-devel@gnu.org; Wed, 02 Jul 2008 13:46:19 -0400 Received: from mta-out.inet.fi ([195.156.147.13]:59172 helo=jenni1.rokki.sonera.fi) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KE6PK-0001fn-9Q for grub-devel@gnu.org; Wed, 02 Jul 2008 13:46:19 -0400 Received: from [127.0.0.1] (88.193.32.97) by jenni1.rokki.sonera.fi (8.5.014) id 483E82F101833D9E for grub-devel@gnu.org; Wed, 2 Jul 2008 20:46:10 +0300 Message-ID: <486BBEF1.6000105@nic.fi> Date: Wed, 02 Jul 2008 20:46:25 +0300 From: =?ISO-8859-1?Q?Vesa_J=E4=E4skel=E4inen?= User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: The development of GRUB 2 References: <1214964880.7362.17.camel@dv> <1214966028.9353.95.camel@localhost> <20080702002031.7gkuoel14wg80c0k-cebfxv@webmail.spamcop.net> In-Reply-To: <20080702002031.7gkuoel14wg80c0k-cebfxv@webmail.spamcop.net> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: Quoted-Printable X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: Re: Eliminating grub_size_t X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2008 17:46:25 -0000 Pavel Roskin wrote: > Quoting Javier Mart=EDn : >=20 >> El mar, 01-07-2008 a las 22:14 -0400, Pavel Roskin escribi=F3: >>> Hello! >>> >>> I wonder if we would be better off without grub_size_t. I cannot thi= nk >>> of any code that could use it legitimately. >>> >>> The ordinary size_t is used to represent the result of sizeof, i.e. s= ize >>> of a structure. There is no need for grub to support data structures >>> exceeding 4 gigabytes. If we want to support more memory, that's fin= e, >>> but that would involve other types that can hold the pointer values, >>> such as long. >> I'm not sure if I'm getting you right. Are you suggesting that we "und= o" >> the someinteger->size_t conversion that caused so many headaches in ma= ny >> 32->64 bit ports? Machine-dependant types like size_t and ptrdiff_t ar= e >> here to help us, not to haunt us. What is the exact problem with size_= t >> in GRUB right now? I agree that grub_size_t is redundant, though. >=20 > No real problem. There are some warnings in fs/reiserfs.c about it. =20 > But I think removing or redefining grub_size_t would be the cleanest=20 > solution. If reiserfs is using it in wrong place, fix the reiserfs. If you are=20 reading some file system variable, then you should use grub_uintN_t to=20 specify storage size in bits. size_t is usually used as common index or offset (or size) to some=20 buffer. size_t is returned by sizeof(). It is meant to be optimal size=20 for platform. Eg. on 64bit memory bus it is 64bit and on 32bit memory=20 bus it is 32bit. What grub is doing here is just defining yet another=20 type for the same thing. Google for size_t if you want to find out more about it.