From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NR2LG-0008He-BW for mharc-grub-devel@gnu.org; Sat, 02 Jan 2010 06:40:22 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NR2LD-0008GI-7x for grub-devel@gnu.org; Sat, 02 Jan 2010 06:40:19 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NR2L8-0008E9-Ku for grub-devel@gnu.org; Sat, 02 Jan 2010 06:40:18 -0500 Received: from [199.232.76.173] (port=56018 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NR2L8-0008E3-AM for grub-devel@gnu.org; Sat, 02 Jan 2010 06:40:14 -0500 Received: from mail-bw0-f215.google.com ([209.85.218.215]:57441) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NR2L7-0007TE-Te for grub-devel@gnu.org; Sat, 02 Jan 2010 06:40:14 -0500 Received: by bwz7 with SMTP id 7so9545462bwz.26 for ; Sat, 02 Jan 2010 03:40:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :x-enigmail-version:content-type; bh=OiyP+JTSuSNW8uyrJ7hZLJf14bNogJ0AmcTlia5Y4gQ=; b=de/aiy9KJ+3CRpva6qN8Saj5aPn378ZVs0gW+/B2sgt3asicADlMXh4N8NepoEOunl yQNiCsL4YNh1ZuLQExlale2xWe9Upf/UY5X53+EAwbI8EXeciuA+eYSK/nVPxtCh1QRa 1uwUA+9BCzGhLf4eb3cUeDjXCH5XDAhHS+WrU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type; b=uzd8UHtYAiythCxYEAZWSDUic2shQelAOjXDy+Np5bB2Ul4EGbduOk1VTK9MFIHcws Xy5FSwtS5JizaE2ods2K0E9AshaW580OLW1pd14zo/nstee//rWED6/h7xnsbVNO4+kn fEfm7eArlay0FwtIbjS5oDke0Uh3HHHMgjWJw= Received: by 10.204.148.88 with SMTP id o24mr2520826bkv.182.1262432410014; Sat, 02 Jan 2010 03:40:10 -0800 (PST) Received: from debian.bg45.phnet (27-169.2-85.cust.bluewin.ch [85.2.169.27]) by mx.google.com with ESMTPS id 16sm4569034bwz.15.2010.01.02.03.40.09 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 02 Jan 2010 03:40:09 -0800 (PST) Message-ID: <4B3F3090.9090706@gmail.com> Date: Sat, 02 Jan 2010 12:40:00 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20091109) MIME-Version: 1.0 To: The development of GNU GRUB References: <4B37B094.7040102@labri.fr> <4B395C02.9060500@labri.fr> <20100101113953.GC3692@thorin> <4B3F2F90.2020308@labri.fr> In-Reply-To: <4B3F2F90.2020308@labri.fr> X-Enigmail-Version: 0.95.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enig8228E8A1A3BFD8C986E7392D" X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [PATCH] grub-probe support for NetBSD X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Jan 2010 11:40:19 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig8228E8A1A3BFD8C986E7392D Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Gr=C3=A9goire Sutre wrote: > Robert Millan wrote: >> On Tue, Dec 29, 2009 at 02:31:46AM +0100, Gr=C3=A9goire Sutre wrote: >>> +#if defined(__NetBSD__) >>> + /* Convert this block device to its character (raw) device */ >>> + res =3D xmalloc (strlen (cwd) + strlen (ent->d_name) + 3); >>> + sprintf (res, "%s/r%s", cwd, ent->d_name); >>> +#else >>> res =3D xmalloc (strlen (cwd) + strlen (ent->d_name) + 2); >>> sprintf (res, "%s/%s", cwd, ent->d_name); >>> +#endif >> >> Can you avoid code duplication here? Something like: >> >> #ifdef __NetBSD__ >> const char *template =3D "%s/r%s"; >> #else >> const char *template =3D "%s/%s"; >> #endif > > Indeed, it's better. But we also need a variable for the extra length > (3 for NetBSD and 2 otherwise). =20 One byte is cheap. No need for gimmicks just to save one byte. You can always allocate with +3 > I have updated the patch. > > http://pkgsrc-wip.cvs.sourceforge.net/viewvc/*checkout*/pkgsrc-wip/wip/= grub2-current/patches/patch-grub-probe-netbsd > > > The patch is not finished yet: as discussed on IRC, I'll try to > factorize Linux and NetBSD code in grub_util_biosdisk_get_grub_dev, > and to fix the floppy problem. > > Gr=C3=A9goire > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel > --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------enig8228E8A1A3BFD8C986E7392D Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iF4EAREKAAYFAks/MJgACgkQNak7dOguQglUigD/RkFO/Tt4KpPaYV9x3OOEH4nX 4SqTTLdacPX6CkpKycAA/2JiAo3AK15CbPbBDfKLdWqG4tGaxFqzWUQ1gEHMQGaD =EIoi -----END PGP SIGNATURE----- --------------enig8228E8A1A3BFD8C986E7392D--