Closed georeth closed 1 year ago
in the doc, the signature of config_setting_lookup is:
config_setting_lookup
config_setting_t *config_setting_lookup(const config_setting_t *setting, const char *path)
this is problematic, since it can return its argument directly. thus, the const qualifier is removed. and i expect it does not change the config_setting_t since the argument is const.
in the code, the signature is:
config_setting_t *config_setting_lookup(config_setting_t *setting, const char *path)
I think the right way is providing both a mutable version and a const version:
const config_setting_t *config_setting_lookup_const(const config_setting_t *setting, const char *path) config_setting_t *config_setting_lookup(config_setting_t *setting, const char *path)
In my application, i passes const config_setting_t * to do some initialization without change the config, so I want a const version.
const config_setting_t *
Fixed in cca09fa1115512fd7b68a170e18c20d0843e8066
in the doc, the signature of
config_setting_lookup
is:this is problematic, since it can return its argument directly. thus, the const qualifier is removed. and i expect it does not change the config_setting_t since the argument is const.
in the code, the signature is:
I think the right way is providing both a mutable version and a const version:
In my application, i passes
const config_setting_t *
to do some initialization without change the config, so I want a const version.