From 7216263bb779cb4a31d457bae0503fc24e7300e2 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Wed, 11 Oct 2006 23:03:19 +0000 Subject: Shut up compiler warnings Subversion-branch: /trunk/chocolate-doom Subversion-revision: 695 --- textscreen/txt_spinctrl.c | 14 +++++++------- textscreen/txt_table.c | 4 ++-- textscreen/txt_window.c | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/textscreen/txt_spinctrl.c b/textscreen/txt_spinctrl.c index dcb8a4ee..145e398b 100644 --- a/textscreen/txt_spinctrl.c +++ b/textscreen/txt_spinctrl.c @@ -53,7 +53,7 @@ static void FloatFormatString(float step, char *buf) // Number of characters needed to represent a character -static int IntWidth(int val) +static unsigned int IntWidth(int val) { char buf[25]; @@ -62,10 +62,10 @@ static int IntWidth(int val) return strlen(buf); } -static int FloatWidth(float val, float step) +static unsigned int FloatWidth(float val, float step) { - int precision; - int result; + unsigned int precision; + unsigned int result; // Calculate the width of the int value @@ -73,7 +73,7 @@ static int FloatWidth(float val, float step) // Add a decimal part if the precision specifies it - precision = (int) ceil(-log(step) / log(10)); + precision = (unsigned int) ceil(-log(step) / log(10)); if (precision > 0) { @@ -85,9 +85,9 @@ static int FloatWidth(float val, float step) // Returns the minimum width of the input box -static int SpinControlWidth(txt_spincontrol_t *spincontrol) +static unsigned int SpinControlWidth(txt_spincontrol_t *spincontrol) { - int minw, maxw; + unsigned int minw, maxw; switch (spincontrol->type) { diff --git a/textscreen/txt_table.c b/textscreen/txt_table.c index e23ff843..8b31af24 100644 --- a/textscreen/txt_table.c +++ b/textscreen/txt_table.c @@ -529,8 +529,8 @@ static void TXT_TableMousePress(TXT_UNCAST_ARG(table), int x, int y, int b) if (widget != NULL) { - if (x >= widget->x && x < widget->x + widget->w - && y >= widget->y && y < widget->y + widget->h) + if (x >= widget->x && x < (signed) (widget->x + widget->w) + && y >= widget->y && y < (signed) (widget->y + widget->h)) { // This is the widget that was clicked! diff --git a/textscreen/txt_window.c b/textscreen/txt_window.c index ce0692d4..7a965d27 100644 --- a/textscreen/txt_window.c +++ b/textscreen/txt_window.c @@ -362,8 +362,8 @@ static void MouseButtonPress(txt_window_t *window, int b) widgets = (txt_widget_t *) window; - if (x >= widgets->x && x < widgets->x + widgets->w - && y >= widgets->y && y < widgets->y + widgets->h) + if (x >= widgets->x && x < (signed) (widgets->x + widgets->w) + && y >= widgets->y && y < (signed) (widgets->y + widgets->h)) { TXT_WidgetMousePress(window, x, y, b); } @@ -375,8 +375,8 @@ static void MouseButtonPress(txt_window_t *window, int b) widget = (txt_widget_t *) window->actions[i]; if (widget != NULL - && x >= widget->x && x < widget->x + widget->w - && y >= widget->y && y < widget->y + widget->h) + && x >= widget->x && x < (signed) (widget->x + widget->w) + && y >= widget->y && y < (signed) (widget->y + widget->h)) { TXT_WidgetMousePress(widget, x, y, b); break; -- cgit v1.2.3