summaryrefslogtreecommitdiff
path: root/textscreen/txt_label.c
diff options
context:
space:
mode:
authorSimon Howard2006-05-22 00:56:12 +0000
committerSimon Howard2006-05-22 00:56:12 +0000
commit11643c088751a2d3797467463bce4476d3b03292 (patch)
tree3647ce861bdd91ce90a1fecf02c9d31d8540a9cc /textscreen/txt_label.c
parent8d188ff3d11c199621c56275d4fd6730d6f63c1b (diff)
downloadchocolate-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.c13
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);