diff options
author | Simon Howard | 2006-05-22 00:56:12 +0000 |
---|---|---|
committer | Simon Howard | 2006-05-22 00:56:12 +0000 |
commit | 11643c088751a2d3797467463bce4476d3b03292 (patch) | |
tree | 3647ce861bdd91ce90a1fecf02c9d31d8540a9cc /textscreen/txt_label.c | |
parent | 8d188ff3d11c199621c56275d4fd6730d6f63c1b (diff) | |
download | chocolate-doom-11643c088751a2d3797467463bce4476d3b03292.tar.gz chocolate-doom-11643c088751a2d3797467463bce4476d3b03292.tar.bz2 chocolate-doom-11643c088751a2d3797467463bce4476d3b03292.zip |
Add casting macros to allow for easy casts between types.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 503
Diffstat (limited to 'textscreen/txt_label.c')
-rw-r--r-- | textscreen/txt_label.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/textscreen/txt_label.c b/textscreen/txt_label.c index afdf9b01..022e0480 100644 --- a/textscreen/txt_label.c +++ b/textscreen/txt_label.c @@ -4,20 +4,19 @@ #include "txt_label.h" #include "txt_io.h" #include "txt_main.h" -#include "txt_widget.h" #include "txt_window.h" -static void TXT_LabelSizeCalc(txt_widget_t *widget, int *w, int *h) +static void TXT_LabelSizeCalc(UNCAST(label), int *w, int *h) { - txt_label_t *label = (txt_label_t *) widget; + CAST(txt_label_t, label); *w = label->w; *h = label->h; } -static void TXT_LabelDrawer(txt_widget_t *widget, int w, int selected) +static void TXT_LabelDrawer(UNCAST(label), int w, int selected) { - txt_label_t *label = (txt_label_t *) widget; + CAST(txt_label_t, label); int i; int origin_x, origin_y; @@ -33,9 +32,9 @@ static void TXT_LabelDrawer(txt_widget_t *widget, int w, int selected) } } -static void TXT_LabelDestructor(txt_widget_t *widget) +static void TXT_LabelDestructor(UNCAST(label)) { - txt_label_t *label = (txt_label_t *) widget; + CAST(txt_label_t, label); free(label->label); free(label->lines); |