From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=47166 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OG83J-000724-8v for qemu-devel@nongnu.org; Sun, 23 May 2010 06:05:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OG838-0007i3-1J for qemu-devel@nongnu.org; Sun, 23 May 2010 06:04:51 -0400 Received: from fmmailgate03.web.de ([217.72.192.234]:58441) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OG837-0007hu-MY for qemu-devel@nongnu.org; Sun, 23 May 2010 06:04:49 -0400 Message-ID: <4BF8FDBA.2050000@web.de> Date: Sun, 23 May 2010 12:04:42 +0200 From: Jan Kiszka MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH v2 08/15] Add base64 encoder/decoder References: <4BF8DF6D.20409@web.de> <4BF8EBEB.4010104@redhat.com> In-Reply-To: <4BF8EBEB.4010104@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigDBAA009B728883FEB42A138A" Sender: jan.kiszka@web.de List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Anthony Liguori , Juan Quintela , Jan Kiszka , qemu-devel@nongnu.org, Markus Armbruster , Blue Swirl , Luiz Capitulino This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigDBAA009B728883FEB42A138A Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Avi Kivity wrote: > On 05/23/2010 10:55 AM, Jan Kiszka wrote: >>>> +/* >>>> + * Convert string 'src' of length 'srclen' from base64 to binary fo= rm, >>>> + * saving the result in 'dest'. The size of the destination buffer >>>> must be at >>>> + * least srclen * 3 / 4. >>>> + * >>>> + * Returns 0 on success, -1 on conversion error. >>>> + */ >>>> +int base64_decode(const char *src, size_t srclen, void *dest) >>>> =20 >>> I think dest should be char *, like all the functions where dest is >>> passed to. >>> =20 >> The output may but need not be a string, it's binary data. And to avoi= d >> needless warnings about signedness mismatches if unsigned char or >> uint8_t buffers are passed, I chose void *. >> =20 >=20 > I think qemu is pretty consistent in using uint8_t for binary, and void= > * is a little dangerous as it allows passing any kind of data (anything= > above a byte is subject to endianness issues for example). >=20 > But I don't feel strongly about this. >=20 Let's go for consistency: I switched to uint8_t for the binary input/outp= ut. Jan --------------enigDBAA009B728883FEB42A138A Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkv4/boACgkQitSsb3rl5xR7hgCg7FApJasP5xnPV1qjHweoOPwM 2z0An2aMKSzBjtzTNveke7uCWWqooDRZ =9fW9 -----END PGP SIGNATURE----- --------------enigDBAA009B728883FEB42A138A--