diff options
-rw-r--r-- | src/config.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/config.c b/src/config.c index 6074773..e8497d2 100644 --- a/src/config.c +++ b/src/config.c @@ -38,10 +38,10 @@ enum type { }; union callback { - void (*boolean_cb)(const gchar *, gboolean, gpointer); - void (*integer_cb)(const gchar *, gint, gpointer); - void (*double_cb)(const gchar *, gdouble, gpointer); - void (*string_cb)(const gchar *, gchar *, gpointer); + void (*boolean_cb)(const gchar *, const gboolean, gpointer); + void (*integer_cb)(const gchar *, const gint, gpointer); + void (*double_cb)(const gchar *, const gdouble, gpointer); + void (*string_cb)(const gchar *, const gchar *, gpointer); }; struct callbacks { @@ -283,8 +283,8 @@ mq_config_get_string(MqConfig *config, const gchar *name) } static void -set_type_or_run_callbacks(MqConfig *config, const gchar *name, gpointer value, - enum type type) +set_type_or_run_callbacks(MqConfig *config, const gchar *name, + gconstpointer value, enum type type) { struct item *item; struct callbacks *cbs; @@ -301,22 +301,22 @@ set_type_or_run_callbacks(MqConfig *config, const gchar *name, gpointer value, switch (item->type) { case TYPE_BOOLEAN: cbs->cb.boolean_cb(name, - *((gboolean *) value), + *((const gboolean *) value), cbs->user_data); break; case TYPE_INTEGER: cbs->cb.integer_cb(name, - *((gint *) value), + *((const gint *) value), cbs->user_data); break; case TYPE_DOUBLE: cbs->cb.double_cb(name, - *((gdouble *) value), + *((const gdouble *) value), cbs->user_data); break; case TYPE_STRING: cbs->cb.string_cb(name, - (gchar *) value, + (const gchar *) value, cbs->user_data); break; } |