Re: Eliminating grub_size_t

2008-07-03 Thread Pavel Roskin
On Thu, 2008-07-03 at 22:07 +0300, Vesa Jääskeläinen wrote: > And size_t is kinda connected to memory addresses. Do you agree :) ? Yes. However, size_t should hold the maximal structure size, and we can limit it to 4 (or even 2) gigabytes. You can think of it as of the size of a contiguous chun

Re: Eliminating grub_size_t

2008-07-03 Thread Vesa Jääskeläinen
Pavel Roskin wrote: On Thu, 2008-07-03 at 21:42 +0300, Vesa Jääskeläinen wrote: I think I'll try to make grub_size_t 32-bit everywhere and see if it's going to make any difference or help discover some issues. Why? I would let it be optimal type for current memory bus width. int is supposed

Re: Eliminating grub_size_t

2008-07-03 Thread Pavel Roskin
On Thu, 2008-07-03 at 20:56 +0200, Marco Gerards wrote: > Pavel Roskin <[EMAIL PROTECTED]> writes: > > I think I'll try to make grub_size_t 32-bit everywhere and see if it's > > going to make any difference or help discover some issues. > > Please don't. I'd rather stick to integers, such change

Re: Eliminating grub_size_t

2008-07-03 Thread Pavel Roskin
On Thu, 2008-07-03 at 21:42 +0300, Vesa Jääskeläinen wrote: > > I think I'll try to make grub_size_t 32-bit everywhere and see if it's > > going to make any difference or help discover some issues. > > Why? I would let it be optimal type for current memory bus width. int is supposed to be the op

Re: Eliminating grub_size_t

2008-07-03 Thread Marco Gerards
Pavel Roskin <[EMAIL PROTECTED]> writes: > On Thu, 2008-07-03 at 20:02 +0200, Marco Gerards wrote: >> > 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. >> >> Pe

Re: Eliminating grub_size_t

2008-07-03 Thread Vesa Jääskeläinen
Pavel Roskin wrote: On Thu, 2008-07-03 at 20:02 +0200, Marco Gerards wrote: 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 thin

Re: Eliminating grub_size_t

2008-07-03 Thread Pavel Roskin
On Thu, 2008-07-03 at 20:02 +0200, Marco Gerards wrote: > > 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

Re: Eliminating grub_size_t

2008-07-03 Thread Marco Gerards
Pavel Roskin <[EMAIL PROTECTED]> 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

Re: Eliminating grub_size_t

2008-07-02 Thread Pavel Roskin
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 usuall

Re: Eliminating grub_size_t

2008-07-02 Thread Vesa Jääskeläinen
Pavel Roskin wrote: Quoting Javier Martín <[EMAIL PROTECTED]>: El mar, 01-07-2008 a las 22:14 -0400, Pavel Roskin escribió: Hello! I wonder if we would be better off without grub_size_t. I cannot think of any code that could use it legitimately. The ordinary size_t is used to represent the

Re: Eliminating grub_size_t

2008-07-02 Thread Pavel Roskin
Quoting Isaac Dupree <[EMAIL PROTECTED]>: I mean that if, say, GRUB fails to read reiserfs, I'd like to be able to reproduce the problem in grub-fstest even if I'm compiling it on x86_64. In this case, so we're producing a 32-bit, pc grub image. To have a similar effect in grub-fstest, w

Re: Eliminating grub_size_t

2008-07-02 Thread Isaac Dupree
size_t has different size on 32-bit and 64-bit systems, but we should strive to make the userspace utilities work like the bootloader, so that possible problems can be detected early and debugged easily. I didn't understand this. What do you mean with "US working like the bootloader?" I mean th

Re: Eliminating grub_size_t

2008-07-01 Thread Pavel Roskin
Quoting Javier Martín <[EMAIL PROTECTED]>: El mar, 01-07-2008 a las 22:14 -0400, Pavel Roskin escribió: Hello! I wonder if we would be better off without grub_size_t. I cannot think of any code that could use it legitimately. The ordinary size_t is used to represent the result of sizeof, i.e

Re: Eliminating grub_size_t

2008-07-01 Thread Javier Martín
El mar, 01-07-2008 a las 22:14 -0400, Pavel Roskin escribió: > Hello! > > I wonder if we would be better off without grub_size_t. I cannot think > of any code that could use it legitimately. > > The ordinary size_t is used to represent the result of sizeof, i.e. size > of a structure. There is