On 18 November 2017 at 20:19, Berthold Stoeger <[email protected]> wrote: > On Samstag, 18. November 2017 17:23:05 CET Lubomir I. Ivanov wrote: >> On 18 November 2017 at 17:53, Dirk Hohndel <[email protected]> wrote: >> >> On Nov 18, 2017, at 12:02 AM, Berthold Stoeger > <[email protected]> wrote: >> <snip> >> >> >> For consistency, I made a few C-strings non-const. And ultimately also >> >> the >> >> return of system_default_filename(void). If preferred, the latter could >> >> be kept const and the const cast away when assigning to the item of the >> >> pref struct.> >> > That I'm not so sure about. We try to use these const declarations to >> > prevent users of these strings from modifying them when they are supposed >> > to be immutable. >> >> i agree that things like system_default_...() calls should return a >> "const char *". >> >> const char *language; >> const char *lang_locale; >> >> ^ also make sense to me to be "const". > > I see your point. But shouldn't then the numerous other non-const strings in > pref.h also be made const? >
probably, yes. lubomir -- _______________________________________________ subsurface mailing list [email protected] http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
