diff --git a/bar.c b/bar.c index 5020a71..c839567 100644 --- a/bar.c +++ b/bar.c @@ -101,21 +101,21 @@ expose(const struct bar *_bar) struct module_expose_context ctx_left[bar->left.count]; for (size_t i = 0; i < bar->left.count; i++) { - const struct module *m = bar->left.mods[i]; + struct module *m = bar->left.mods[i]; ctx_left[i] = m->begin_expose(m, bar->cairo); left_width += bar->left_spacing + ctx_left[i].width + bar->right_spacing; } struct module_expose_context ctx_center[bar->center.count]; for (size_t i = 0; i < bar->center.count; i++) { - const struct module *m = bar->center.mods[i]; + struct module *m = bar->center.mods[i]; ctx_center[i] = m->begin_expose(m, bar->cairo); center_width += bar->left_spacing + ctx_center[i].width + bar->right_spacing; } struct module_expose_context ctx_right[bar->right.count]; for (size_t i = 0; i < bar->right.count; i++) { - const struct module *m = bar->right.mods[i]; + struct module *m = bar->right.mods[i]; ctx_right[i] = m->begin_expose(m, bar->cairo); right_width += bar->left_spacing + ctx_right[i].width + bar->right_spacing; } diff --git a/module.c b/module.c index af66538..9dcf5d5 100644 --- a/module.c +++ b/module.c @@ -25,7 +25,7 @@ module_default_destroy(struct module *mod) } struct module_expose_context -module_default_begin_expose(const struct module *mod, cairo_t *cr) +module_default_begin_expose(struct module *mod, cairo_t *cr) { struct exposable *e = mod->content(mod); return (struct module_expose_context){ diff --git a/module.h b/module.h index b7a9620..18314fc 100644 --- a/module.h +++ b/module.h @@ -29,8 +29,8 @@ struct module { int (*run)(struct module_run_context *ctx); void (*destroy)(struct module *module); - struct exposable *(*content)(const struct module *mod); - struct module_expose_context (*begin_expose)(const struct module *mod, cairo_t *cr); + struct exposable *(*content)(struct module *mod); + struct module_expose_context (*begin_expose)(struct module *mod, cairo_t *cr); void (*expose)(const struct module *mod, const struct module_expose_context *ctx, cairo_t *cr, int x, int y, int height); @@ -42,7 +42,7 @@ struct module *module_common_new(void); void module_default_destroy(struct module *mod); struct module_expose_context module_default_begin_expose( - const struct module *mod, cairo_t *cr); + struct module *mod, cairo_t *cr); void module_default_expose( const struct module *mod, diff --git a/modules/battery/battery.c b/modules/battery/battery.c index 24c7dc2..3792ea2 100644 --- a/modules/battery/battery.c +++ b/modules/battery/battery.c @@ -49,11 +49,11 @@ destroy(struct module *mod) } static struct exposable * -content(const struct module *mod) +content(struct module *mod) { const struct private *m = mod->private; - mtx_lock(&((struct module *)mod)->lock); + mtx_lock(&mod->lock); assert(m->state == STATE_FULL || m->state == STATE_CHARGING || @@ -92,7 +92,7 @@ content(const struct module *mod) .count = 6, }; - mtx_unlock(&((struct module *)mod)->lock); + mtx_unlock(&mod->lock); struct exposable *exposable = m->label->instantiate(m->label, &tags); diff --git a/modules/clock/clock.c b/modules/clock/clock.c index 529b886..4680a03 100644 --- a/modules/clock/clock.c +++ b/modules/clock/clock.c @@ -21,7 +21,7 @@ destroy(struct module *mod) } static struct exposable * -content(const struct module *mod) +content(struct module *mod) { const struct private *m = mod->private; time_t t = time(NULL); diff --git a/modules/i3/i3.c b/modules/i3/i3.c index 34617a8..c9cff0c 100644 --- a/modules/i3/i3.c +++ b/modules/i3/i3.c @@ -397,7 +397,7 @@ destroy(struct module *mod) } static struct exposable * -content(const struct module *mod) +content(struct module *mod) { struct private *m = mod->private; diff --git a/modules/label/label.c b/modules/label/label.c index afc0b6b..c215380 100644 --- a/modules/label/label.c +++ b/modules/label/label.c @@ -19,7 +19,7 @@ destroy(struct module *mod) } static struct exposable * -content(const struct module *mod) +content(struct module *mod) { const struct private *m = mod->private; return m->label->instantiate(m->label, NULL); diff --git a/modules/xkb/xkb.c b/modules/xkb/xkb.c index adbbed8..1087e48 100644 --- a/modules/xkb/xkb.c +++ b/modules/xkb/xkb.c @@ -52,7 +52,7 @@ destroy(struct module *mod) } static struct exposable * -content(const struct module *mod) +content(struct module *mod) { const struct private *m = mod->private; diff --git a/modules/xwindow/xwindow.c b/modules/xwindow/xwindow.c index 9a16d92..5779e14 100644 --- a/modules/xwindow/xwindow.c +++ b/modules/xwindow/xwindow.c @@ -255,7 +255,7 @@ run(struct module_run_context *ctx) } static struct exposable * -content(const struct module *mod) +content(struct module *mod) { struct private *m = mod->private;