foxygit / doom Log in
commit 0cff90defcb069c351fd81bed9e57f3519c70ef7
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Thu Sep 21 16:25:10 2006 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Thu Sep 21 16:25:10 2006 +0000

    Fix some warnings in textscreen code.

    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 645
---
 textscreen/txt_dropdown.c  |  2 +-
 textscreen/txt_inputbox.h  |  2 +-
 textscreen/txt_label.c     |  9 +++++----
 textscreen/txt_label.h     |  2 +-
 textscreen/txt_main.c      |  2 +-
 textscreen/txt_separator.c |  1 +
 textscreen/txt_spinctrl.c  |  4 ++--
 textscreen/txt_strut.c     |  1 +
 textscreen/txt_table.c     | 12 ++++++------
 textscreen/txt_widget.h    |  2 +-
 textscreen/txt_window.c    |  7 ++++---
 textscreen/txt_window.h    |  2 +-
 12 files changed, 25 insertions(+), 21 deletions(-)

diff --git a/textscreen/txt_dropdown.c b/textscreen/txt_dropdown.c
index 3242b21c..5c39bad5 100644
--- a/textscreen/txt_dropdown.c
+++ b/textscreen/txt_dropdown.c
@@ -190,7 +190,7 @@ static void TXT_DropdownListSizeCalc(TXT_UNCAST_ARG(list))
 static void TXT_DropdownListDrawer(TXT_UNCAST_ARG(list), int selected)
 {
     TXT_CAST_ARG(txt_dropdown_list_t, list);
-    int i;
+    unsigned int i;
     char *str;

     // Set bg/fg text colors.
diff --git a/textscreen/txt_inputbox.h b/textscreen/txt_inputbox.h
index 400a1ed8..fa610485 100644
--- a/textscreen/txt_inputbox.h
+++ b/textscreen/txt_inputbox.h
@@ -30,7 +30,7 @@ struct txt_inputbox_s
 {
     txt_widget_t widget;
     char *buffer;
-    int size;
+    unsigned int size;
     int editing;
     void *value;
 };
diff --git a/textscreen/txt_label.c b/textscreen/txt_label.c
index 48b38cda..7ae29c3d 100644
--- a/textscreen/txt_label.c
+++ b/textscreen/txt_label.c
@@ -39,10 +39,10 @@ static void TXT_LabelSizeCalc(TXT_UNCAST_ARG(label))
 static void TXT_LabelDrawer(TXT_UNCAST_ARG(label), int selected)
 {
     TXT_CAST_ARG(txt_label_t, label);
-    int x, y;
+    unsigned int x, y;
     int origin_x, origin_y;
-    int align_indent = 0;
-    int w;
+    unsigned int align_indent = 0;
+    unsigned int w;

     w = label->widget.w;

@@ -109,12 +109,13 @@ txt_widget_class_t txt_label_class =
     NULL,
     TXT_LabelDestructor,
     NULL,
+    NULL,
 };

 void TXT_SetLabel(txt_label_t *label, char *value)
 {
     char *p;
-    int y;
+    unsigned int y;

     // Free back the old label

diff --git a/textscreen/txt_label.h b/textscreen/txt_label.h
index f4e336cb..c8e002e0 100644
--- a/textscreen/txt_label.h
+++ b/textscreen/txt_label.h
@@ -32,7 +32,7 @@ struct txt_label_s
     txt_widget_t widget;
     char *label;
     char **lines;
-    int w, h;
+    unsigned int w, h;
     txt_color_t fgcolor;
     txt_color_t bgcolor;
 };
diff --git a/textscreen/txt_main.c b/textscreen/txt_main.c
index a4a7f7e3..45971a23 100644
--- a/textscreen/txt_main.c
+++ b/textscreen/txt_main.c
@@ -420,7 +420,7 @@ int TXT_ScreenHasBlinkingChars(void)

 void TXT_Sleep(int timeout)
 {
-    int start_time;
+    unsigned int start_time;

     if (TXT_ScreenHasBlinkingChars())
     {
diff --git a/textscreen/txt_separator.c b/textscreen/txt_separator.c
index 5e190856..2bf74b8f 100644
--- a/textscreen/txt_separator.c
+++ b/textscreen/txt_separator.c
@@ -87,6 +87,7 @@ txt_widget_class_t txt_separator_class =
     NULL,
     TXT_SeparatorDestructor,
     NULL,
+    NULL,
 };

 txt_separator_t *TXT_NewSeparator(char *label)
diff --git a/textscreen/txt_spinctrl.c b/textscreen/txt_spinctrl.c
index 69c2e98f..469d60d2 100644
--- a/textscreen/txt_spinctrl.c
+++ b/textscreen/txt_spinctrl.c
@@ -73,7 +73,7 @@ static void TXT_SpinControlDrawer(TXT_UNCAST_ARG(spincontrol), int selected)
 {
     TXT_CAST_ARG(txt_spincontrol_t, spincontrol);
     char buf[20];
-    int i;
+    unsigned int i;

     TXT_FGColor(TXT_COLOR_BRIGHT_WHITE);
     TXT_BGColor(TXT_COLOR_BLUE, 0);
@@ -143,7 +143,7 @@ static void TXT_SpinControlMousePress(TXT_UNCAST_ARG(spincontrol),
                                    int x, int y, int b)
 {
     TXT_CAST_ARG(txt_spincontrol_t, spincontrol);
-    int rel_x;
+    unsigned int rel_x;

     rel_x = x - spincontrol->widget.x;

diff --git a/textscreen/txt_strut.c b/textscreen/txt_strut.c
index aeab0181..e7fe6328 100644
--- a/textscreen/txt_strut.c
+++ b/textscreen/txt_strut.c
@@ -60,6 +60,7 @@ txt_widget_class_t txt_strut_class =
     TXT_StrutKeyPress,
     TXT_StrutDestructor,
     NULL,
+    NULL,
 };

 txt_strut_t *TXT_NewStrut(int width, int height)
diff --git a/textscreen/txt_table.c b/textscreen/txt_table.c
index a063f05d..e0d34cdb 100644
--- a/textscreen/txt_table.c
+++ b/textscreen/txt_table.c
@@ -59,8 +59,8 @@ static int TableRows(txt_table_t *table)
 }

 static void CalcRowColSizes(txt_table_t *table,
-                            int *row_heights,
-                            int *col_widths)
+                            unsigned int *row_heights,
+                            unsigned int *col_widths)
 {
     int x, y;
     int rows;
@@ -98,8 +98,8 @@ static void CalcRowColSizes(txt_table_t *table,
 static void TXT_CalcTableSize(TXT_UNCAST_ARG(table))
 {
     TXT_CAST_ARG(txt_table_t, table);
-    int *column_widths;
-    int *row_heights;
+    unsigned int *column_widths;
+    unsigned int *row_heights;
     int x, y;
     int rows;

@@ -400,8 +400,8 @@ static void LayoutCell(txt_table_t *table, int x, int y, int col_width,
 static void TXT_TableLayout(TXT_UNCAST_ARG(table))
 {
     TXT_CAST_ARG(txt_table_t, table);
-    int *column_widths;
-    int *row_heights;
+    unsigned int *column_widths;
+    unsigned int *row_heights;
     int draw_x, draw_y;
     int x, y;
     int i;
diff --git a/textscreen/txt_widget.h b/textscreen/txt_widget.h
index 89f47627..0e80f3c1 100644
--- a/textscreen/txt_widget.h
+++ b/textscreen/txt_widget.h
@@ -76,7 +76,7 @@ struct txt_widget_s
     // not be set manually.

     int x, y;
-    int w, h;
+    unsigned int w, h;
 };

 void TXT_InitWidget(TXT_UNCAST_ARG(widget), txt_widget_class_t *widget_class);
diff --git a/textscreen/txt_window.c b/textscreen/txt_window.c
index 5c27e6a5..38cc2b2a 100644
--- a/textscreen/txt_window.c
+++ b/textscreen/txt_window.c
@@ -191,7 +191,8 @@ static void DrawActionArea(txt_window_t *window)
     }
 }

-static void CalcActionAreaSize(txt_window_t *window, int *w, int *h)
+static void CalcActionAreaSize(txt_window_t *window,
+                               unsigned int *w, unsigned int *h)
 {
     txt_widget_t *widget;
     int i;
@@ -224,8 +225,8 @@ static void CalcActionAreaSize(txt_window_t *window, int *w, int *h)
 void TXT_LayoutWindow(txt_window_t *window)
 {
     txt_widget_t *widgets = (txt_widget_t *) window;
-    int widgets_w;
-    int actionarea_w, actionarea_h;
+    unsigned int widgets_w;
+    unsigned int actionarea_w, actionarea_h;

     // Calculate size of table

diff --git a/textscreen/txt_window.h b/textscreen/txt_window.h
index 7aec10de..3659ed29 100644
--- a/textscreen/txt_window.h
+++ b/textscreen/txt_window.h
@@ -65,7 +65,7 @@ struct txt_window_s
     // These are set automatically when the window is drawn

     int window_x, window_y;
-    int window_w, window_h;
+    unsigned int window_w, window_h;
 };

 txt_window_t *TXT_NewWindow(char *title);