[Swan-dev] pluto: sprinkle const on many struct fd * parameters

Andrew Cagney andrew.cagney at gmail.com
Wed Feb 19 17:44:26 UTC 2020


This feels wrong - struct fd is opaque so what more needs to be said?
Adding the 'const', forces an internal detail onto the clients and an
artifical limitation on the implementation.  For instance:

ssize_t fd_read(const struct fd *fd, void *buf, size_t nbytes,
        where_t where);

is prevented from modifying the structure it owns.


On Sun, 16 Feb 2020 at 19:22, D. Hugh Redelmeier
<hugh at vault.libreswan.fi> wrote:
> New commits:
> commit 35f8db42466d838e3ade687fa38be2ec70c833e1
> Author: D. Hugh Redelmeier <hugh at mimosa.com>
> Date:   Sun Feb 16 19:10:25 2020 -0500
>     pluto: sprinkle const on many struct fd * parameters
>     also rename show_shunt_count => shunt_count since it doesn't show anything
> _______________________________________________
> Swan-commit mailing list
> Swan-commit at lists.libreswan.org
> https://lists.libreswan.org/mailman/listinfo/swan-commit

More information about the Swan-dev mailing list