Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1MTNA0-00018e-MA for mharc-grub-devel@gnu.org; Tue, 21 Jul 2009 17:46:08 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MTN9y-00018I-1V for grub-devel@gnu.org; Tue, 21 Jul 2009 17:46:06 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MTN9t-00017y-Ft for grub-devel@gnu.org; Tue, 21 Jul 2009 17:46:05 -0400 Received: from [199.232.76.173] (port=38657 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MTN9t-00017v-9y for grub-devel@gnu.org; Tue, 21 Jul 2009 17:46:01 -0400 Received: from mail-fx0-f223.google.com ([209.85.220.223]:51357) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MTN9s-0006jd-Sy for grub-devel@gnu.org; Tue, 21 Jul 2009 17:46:01 -0400 Received: by fxm23 with SMTP id 23so971477fxm.42 for ; Tue, 21 Jul 2009 14:46:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=tIXDYjVdd4yRXoreV1eUG61V5YHPRMUtYHuLBHOU9R4=; b=JND9px70NG47So4VN3Xm0Lx9vwsbN1BiPRMoqjAICeZ9+CloFHRzbxg61NIULUXWaF 5GOIduUsNZScuIX40pzxk6UaTD5V0TNA+pqCNxFD0RYeFptmPkBhAAXuiD0KyL8XB23B dWr6iMdFoOHNfFL3SVk38k2qVEU7jv+36gkag= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=NZAAgGXnghgfpspQx0vn5r7eJ4x+PZm3/IrmuTT8YcdKRwf+ViV9uEGMVkD9QSPA5f qpwhi69EkGR3QMTEr+KggzEiS+zBYsKHuYPgYRMdJyyx7lm9T8puewGtg4ZR6+CK6P8G nHOMSW1wqZtRxPJsmPfSWG+4sU42M9RJEl+fM= MIME-Version: 1.0 Received: by 10.204.112.205 with SMTP id x13mr124059bkp.170.1248212759960; Tue, 21 Jul 2009 14:45:59 -0700 (PDT) In-Reply-To: <1248211910.18091.8.camel@mj> References: <1248196443.27068.86.camel@mj> <4A660CE9.6040104@gmail.com> <1248211910.18091.8.camel@mj> Date: Tue, 21 Jul 2009 23:45:59 +0200 Message-ID: From: "Vladimir 'phcoder' Serbinenko" To: The development of GRUB 2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [PATCH] UUID support for UFS 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: Tue, 21 Jul 2009 21:46:06 -0000 On Tue, Jul 21, 2009 at 11:31 PM, Pavel Roskin wrote: > On Tue, 2009-07-21 at 20:46 +0200, Javier Mart=EDn wrote: >> Vladimir 'phcoder' Serbinenko escribi=F3: >> > On Tue, Jul 21, 2009 at 7:14 PM, Pavel Roskin wrote: >> >> On Tue, 2009-07-21 at 15:03 +0200, Vladimir 'phcoder' Serbinenko wrot= e: >> >>> + =A0 =A0 =A0grub_sprintf (*uuid, "%08lx%08lx", >> >>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (unsigned long) grub_le_to_cpu= 32 (data->sblock.uuidhi), >> >>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (unsigned long) grub_le_to_cpu= 32 (data->sblock.uuidlow)); >> >> unsigned long is 64-bit on x86_64. =A0unsigned int would do just fine >> >> here. >> > Ok >> We could use the macros for [u]intN_t types: >> =A0 =A0 =A0 =A0grub_sprintf (*uuid, PRIx32 "-" PRIx32, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 grub_le_to_cpu32 (data->= sblock.uuidhi), >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 grub_le_to_cpu32 (data->= sblock.uuidlow)); >> Of course, our *printf functions would have to recognize them, and we'd >> have to provide a suitable default for the header if the system compiler >> is not C99 compliant, but I think it's a good step forwards. >> >> I would be willing to implement such a header/change to the *printf >> functions if there's any interest in them. > > I think we shouldn't overengineer this. =A0We don't support platforms > where int is not 32-bit. =A0If we add support for such platform, we'll > have more issues than just printf. > 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. Instead we could just define somewhere: GRUB_PRIx32 "%x" #ifdef LONG_SIZEOF =3D=3D 8 GRUB_PRIx64 "%lx" #else GRUB_PRIx64 "%llx" #endif > -- > Regards, > Pavel Roskin > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel > --=20 Regards Vladimir 'phcoder' Serbinenko Personal git repository: http://repo.or.cz/w/grub2/phcoder.git