[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 08/15] Add base64 encoder/decoder

From: Avi Kivity
Subject: Re: [Qemu-devel] [PATCH v2 08/15] Add base64 encoder/decoder
Date: Sun, 23 May 2010 11:48:43 +0300
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20100330 Fedora/3.0.4-1.fc12 Thunderbird/3.0.4

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]