On Thu, 15 Apr 2021, [email protected] wrote: > On 15/04/2021 14:33, Carl Edquist wrote: >> PS if you are willing to cheat a bit and treat the f->width member as >> "mutable" (modifying it even when f is pointer to const), you could >> simplify things a bit if you just store the value from >> quote_name_width() in fileinfo_name_width(). Something like [1]. > > Yes that was my first iteration, > but it felt wrong to cast the const away in the presentation functions. > I think this way is more maintainable in future.
Makes sense. Too bad there isn't a cleaner way to specify a mutable member of a const struct in C. Thanks! Carl
