Avi Kivity wrote: > 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. >
Let's go for consistency: I switched to uint8_t for the binary input/output. Jan
signature.asc
Description: OpenPGP digital signature