grub-devel
[Top][All Lists]
Advanced

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

Re: Imminent bugfix release (1.97.1)


From: Darron Black
Subject: Re: Imminent bugfix release (1.97.1)
Date: Mon, 09 Nov 2009 17:09:31 -0600
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

Duboucher Thomas wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Robert Millan a écrit :
On Mon, Nov 09, 2009 at 10:43:48PM +0100, Duboucher Thomas wrote:
        Well, the only way to solve that problem would be IMHO to add a limit
to the size of s2, and use this maximum size as an end condition for the
'for' statement. Any better idea? :)
We have a maximum line read size anyway.  If we do this, we might as
well make that limit global so that the macro can be shared with
this routine.


Sounds good to me. :)
Any ideas for renaming s1 and s2?

Thomas.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkr4m8EACgkQBV7eXqefhqj9SgCgjHomnoIkzzu5WuTCZQVcB/8t
cwcAn1EkevCL3PXGlIuhLzFPlER9fXD3
=okR/
-----END PGP SIGNATURE-----


_______________________________________________
Grub-devel mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/grub-devel
Hello,

I'd be concerned about (s1 != s2). Depending on how efficiently this compiles, could not branch prediction make this faster for match vs. not match, etc?. I'd be worried about all the ways (and future ways) compilers might help us and introduce time differences.

I'd feel most comfortable with the time delay, but why not stick to complete artithmetic?


int i;
int acc = 0;

for(i=0;i<MAX_LEN;i++,s1++,s2++)
{
   acc |= (*s1 ^ *s2);

   if (*s1 == 0)
      break;
}

return (acc == 0);


Also, these strcmp functions don't properly return < or >. Just = / !=. However, my context being so new is quite limited.


Darron





reply via email to

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