bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] base32, base64: prefer signed to unsigned integers


From: Simon Josefsson
Subject: Re: [PATCH] base32, base64: prefer signed to unsigned integers
Date: Sun, 29 Aug 2021 10:20:45 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Paul Eggert <eggert@cs.ucla.edu> writes:

> -extern void base64_encode (const char *restrict in, size_t inlen,
> -                           char *restrict out, size_t outlen);
> +extern void base64_encode (const char *restrict in, idx_t inlen,
> +                           char *restrict out, idx_t outlen);

Thanks for improving the code -- however, the API is quite wide spread
already, and size_t (or unsigned int) is widely used for many other
base64 APIs so this change causes friction at the API level.  What do
you think?  I'm not sure I understand why idx_t is better than size_t
here, can you elaborate?  Why not ssize_t?  Maybe a compromise is to
keep the old API but add new APIs with idx_t types and the
implementation of the old functions uses the new one.

/Simon

Attachment: signature.asc
Description: PGP signature


reply via email to

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