On Sep 4, 2015, at 6:46 AM, Dario Lombardo <dario.lombardo.ml@xxxxxxxxx> wrote:
> The first possibility is to change the "lowest" function, to keep the current prototype but with some integer checks and casts.
>
> The second possibility is to "sanitize" the lowest function (in the example above, AFAIK, there is no reason to have int as input/output, better have size_t), but this, like a domino effect, requires to change the calling function (in the example, change the codec_decode_fn typedef) that propagates the change to other functions and so on.
>
> The first has less impact, but is more dirty. The second has great impact, but is more correct/elegant.
>
> What do you think?
I vote for the second change. Object sizes in C code should be represented as size_t.