From 4089e006820e1029a2dd7093bae596b1b31d1686 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sun, 2 Jul 2017 15:16:23 +0200 Subject: simplified some driver manager code around calling virtual driver methods declared method tables const per class --- src/gui/composite_widget.c | 2 +- src/gui/desktop.c | 2 +- src/gui/text_widget.c | 2 +- src/gui/widget.c | 2 +- src/gui/widget.h | 2 +- src/gui/window.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/gui') diff --git a/src/gui/composite_widget.c b/src/gui/composite_widget.c index 4a7a607..743360f 100644 --- a/src/gui/composite_widget.c +++ b/src/gui/composite_widget.c @@ -3,7 +3,7 @@ #include "string.h" #include "stddef.h" -static composite_widget_vtable_t composite_widget_vtable = { +static composite_widget_vtable_t const composite_widget_vtable = { { composite_widget_draw, composite_widget_get_focus, diff --git a/src/gui/desktop.c b/src/gui/desktop.c index a27ac9a..98fb900 100644 --- a/src/gui/desktop.c +++ b/src/gui/desktop.c @@ -3,7 +3,7 @@ #include "string.h" #include "stddef.h" -static desktop_vtable_t desktop_vtable = { +static desktop_vtable_t const desktop_vtable = { { { desktop_draw, diff --git a/src/gui/text_widget.c b/src/gui/text_widget.c index 170066a..49c1be7 100644 --- a/src/gui/text_widget.c +++ b/src/gui/text_widget.c @@ -3,7 +3,7 @@ #include "string.h" #include "stddef.h" -static text_widget_vtable_t text_widget_vtable = { +static text_widget_vtable_t const text_widget_vtable = { { text_widget_draw, widget_get_focus, diff --git a/src/gui/widget.c b/src/gui/widget.c index 81ab264..3620761 100644 --- a/src/gui/widget.c +++ b/src/gui/widget.c @@ -3,7 +3,7 @@ #include "string.h" #include "stddef.h" -static widget_vtable_t widget_vtable = { +static widget_vtable_t const widget_vtable = { widget_draw, widget_get_focus, widget_model_to_screen, diff --git a/src/gui/widget.h b/src/gui/widget.h index ceb5b71..87b8c62 100644 --- a/src/gui/widget.h +++ b/src/gui/widget.h @@ -27,7 +27,7 @@ typedef struct widget_t { vga_color_t background_color; bool focusable; struct widget_t *parent; - widget_vtable_t *vtable; + widget_vtable_t const *vtable; } widget_t; void widget_init( widget_t *widget, widget_t *parent, const int x, const int y, const int w, const int h, const vga_color_t background_color ); diff --git a/src/gui/window.c b/src/gui/window.c index 3a75434..80c0b6c 100644 --- a/src/gui/window.c +++ b/src/gui/window.c @@ -3,7 +3,7 @@ #include "string.h" #include "stddef.h" -static window_vtable_t window_vtable = { +static window_vtable_t const window_vtable = { { { window_draw, -- cgit v1.2.3-54-g00ecf