summaryrefslogtreecommitdiff
path: root/textscreen/txt_radiobutton.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_radiobutton.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_radiobutton.c')
-rw-r--r--textscreen/txt_radiobutton.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/textscreen/txt_radiobutton.c b/textscreen/txt_radiobutton.c
index c0a87455..87501590 100644
--- a/textscreen/txt_radiobutton.c
+++ b/textscreen/txt_radiobutton.c
@@ -8,9 +8,9 @@
#include "txt_main.h"
#include "txt_window.h"
-static void TXT_RadioButtonSizeCalc(txt_widget_t *widget, int *w, int *h)
+static void TXT_RadioButtonSizeCalc(UNCAST(radiobutton), int *w, int *h)
{
- txt_radiobutton_t *radiobutton = (txt_radiobutton_t *) widget;
+ CAST(txt_radiobutton_t, radiobutton);
// Minimum width is the string length + two spaces for padding
@@ -18,9 +18,9 @@ static void TXT_RadioButtonSizeCalc(txt_widget_t *widget, int *w, int *h)
*h = 1;
}
-static void TXT_RadioButtonDrawer(txt_widget_t *widget, int w, int selected)
+static void TXT_RadioButtonDrawer(UNCAST(radiobutton), int w, int selected)
{
- txt_radiobutton_t *radiobutton = (txt_radiobutton_t *) widget;
+ CAST(txt_radiobutton_t, radiobutton);
int i;
TXT_BGColor(TXT_COLOR_BLUE, 0);
@@ -57,23 +57,23 @@ static void TXT_RadioButtonDrawer(txt_widget_t *widget, int w, int selected)
}
}
-static void TXT_RadioButtonDestructor(txt_widget_t *widget)
+static void TXT_RadioButtonDestructor(UNCAST(radiobutton))
{
- txt_radiobutton_t *radiobutton = (txt_radiobutton_t *) widget;
+ CAST(txt_radiobutton_t, radiobutton);
free(radiobutton->label);
}
-static int TXT_RadioButtonKeyPress(txt_widget_t *widget, int key)
+static int TXT_RadioButtonKeyPress(UNCAST(radiobutton), int key)
{
- txt_radiobutton_t *radiobutton = (txt_radiobutton_t *) widget;
+ CAST(txt_radiobutton_t, radiobutton);
if (key == KEY_ENTER || key == ' ')
{
if (*radiobutton->variable != radiobutton->value)
{
*radiobutton->variable = radiobutton->value;
- TXT_EmitSignal(widget, "selected");
+ TXT_EmitSignal(radiobutton, "selected");
}
return 1;
}