const-qualify configuration schema items
Alpine 3.20 Success Details

This commit is contained in:
Přemysl Eric Janouch 2024-08-08 08:53:49 +02:00
parent 8a8437634a
commit 75fc6f1c37
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 6 additions and 6 deletions

View File

@ -4501,7 +4501,7 @@ struct config_item
} }
value; ///< The value of this item value; ///< The value of this item
struct config_schema *schema; ///< Schema describing this value const struct config_schema *schema; ///< Schema describing this value
void *user_data; ///< User value attached by schema owner void *user_data; ///< User value attached by schema owner
}; };
@ -4653,7 +4653,7 @@ config_item_object (void)
static bool static bool
config_schema_accepts_type config_schema_accepts_type
(struct config_schema *self, enum config_item_type type) (const struct config_schema *self, enum config_item_type type)
{ {
if (self->type == type) if (self->type == type)
return true; return true;
@ -4666,7 +4666,7 @@ config_schema_accepts_type
static bool static bool
config_item_validate_by_schema (struct config_item *self, config_item_validate_by_schema (struct config_item *self,
struct config_schema *schema, struct error **e) const struct config_schema *schema, struct error **e)
{ {
struct error *error = NULL; struct error *error = NULL;
if (!config_schema_accepts_type (schema, self->type)) if (!config_schema_accepts_type (schema, self->type))
@ -4687,7 +4687,7 @@ static bool
config_item_set_from (struct config_item *self, struct config_item *source, config_item_set_from (struct config_item *self, struct config_item *source,
struct error **e) struct error **e)
{ {
struct config_schema *schema = self->schema; const struct config_schema *schema = self->schema;
if (!schema) if (!schema)
{ {
// Easy, we don't know what this item is // Easy, we don't know what this item is
@ -5483,7 +5483,7 @@ end:
/// "user_data" is passed to allow its immediate use in validation callbacks /// "user_data" is passed to allow its immediate use in validation callbacks
static struct config_item * static struct config_item *
config_schema_initialize_item (struct config_schema *schema, config_schema_initialize_item (const struct config_schema *schema,
struct config_item *parent, void *user_data, struct error **warning, struct config_item *parent, void *user_data, struct error **warning,
struct error **e) struct error **e)
{ {
@ -5540,7 +5540,7 @@ keep_current:
/// Assign schemas and user_data to multiple items at once; /// Assign schemas and user_data to multiple items at once;
/// feel free to copy over and modify to suit your particular needs /// feel free to copy over and modify to suit your particular needs
static void static void
config_schema_apply_to_object (struct config_schema *schema_array, config_schema_apply_to_object (const struct config_schema *schema_array,
struct config_item *object, void *user_data) struct config_item *object, void *user_data)
{ {
while (schema_array->name) while (schema_array->name)