From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=33596 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OG6rY-00005g-Pr for qemu-devel@nongnu.org; Sun, 23 May 2010 04:48:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OG6rX-0008Ru-Cg for qemu-devel@nongnu.org; Sun, 23 May 2010 04:48:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25768) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OG6rX-0008Rq-5F for qemu-devel@nongnu.org; Sun, 23 May 2010 04:48:47 -0400 Message-ID: <4BF8EBEB.4010104@redhat.com> Date: Sun, 23 May 2010 11:48:43 +0300 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH v2 08/15] Add base64 encoder/decoder References: <4BF8DF6D.20409@web.de> In-Reply-To: <4BF8DF6D.20409@web.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: Anthony Liguori , Juan Quintela , Jan Kiszka , qemu-devel@nongnu.org, Markus Armbruster , Blue Swirl , Luiz Capitulino On 05/23/2010 10:55 AM, Jan Kiszka wrote: >>> +/* >>> + * Convert string 'src' of length 'srclen' from base64 to binary form, >>> + * 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) >>> >> I think dest should be char *, like all the functions where dest is passed to. >> > The output may but need not be a string, it's binary data. And to avoid > needless warnings about signedness mismatches if unsigned char or > uint8_t buffers are passed, I chose void *. > 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). But I don't feel strongly about this. -- error compiling committee.c: too many arguments to function