|
From: | Javier Martín |
Subject: | Re: [PATCH] UUID support for UFS |
Date: | Tue, 21 Jul 2009 22:14:02 +0200 |
User-agent: | Thunderbird 2.0.0.22 (Windows/20090605) |
Pavel Roskin escribió:
Indeed, I didn't realise so. All that's required is a grub_inttypes header that either takes from the system stdint.h types or just defines the macros you were discussing.On Tue, 2009-07-21 at 23:45 +0200, Vladimir 'phcoder' Serbinenko wrote:This change would allow to produce a code which is cleaner, easier to read and understand. However I'm opposed to modifying printf function for it.I think Javier misspoke or didn't realize that *printf doesn't need to be modified.
Yeah, that is the format used in libc. I copied the example wrong, without the "%08"s.Instead we could just define somewhere: GRUB_PRIx32 "%x"Better yet, "x", as in libc. That would allow for "%08x" that we need for UUID.
"Fixing" this would allow us to have cleaner code, and separate "casual variables" from fixed-length variables. If we print int with %d and int32_t with PRId32, the impact of the subtle bugs that appear when we port across architectures will be reduced.But I would prefer that we work on fixing bugs rather than non-bugs.
[Prev in Thread] | Current Thread | [Next in Thread] |