shithub: choc

Download patch

ref: 7bc72c666dc1d1e033c01b60ca38673651c7e81c
parent: 3b747fcb62f9b3e5ffd9aec2f39c9ecc9f9fc5c8
author: Simon Howard <[email protected]>
date: Tue Sep 19 19:49:20 EDT 2006

Fix textscreen warnings.

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 626

--- a/textscreen/examples/calculator.c
+++ b/textscreen/examples/calculator.c
@@ -99,6 +99,8 @@
         case OP_DIV:
             input_value = first_operand / input_value;
             break;
+        case OP_NONE:
+            break;
     }
 
     UpdateInputBox();
@@ -156,5 +158,7 @@
     BuildGUI();
 
     TXT_GUIMainLoop();
+
+    return 0;
 }
 
--- a/textscreen/examples/guitest.c
+++ b/textscreen/examples/guitest.c
@@ -64,7 +64,7 @@
 {
     txt_window_t *window;
     txt_table_t *table;
-    txt_table_t *leftpane, *rightpane;
+    txt_table_t *rightpane;
     txt_button_t *button;
     txt_checkbox_t *cheesy_checkbox;
     txt_window_action_t *pwn;
@@ -159,25 +159,6 @@
     TXT_AddWidget(table, TXT_NewIntInputBox(&numbox_value, 10));
 }
 
-void DrawASCIIChart()
-{
-    int x, y;
-
-    TXT_ClearScreen();
-
-    for (y=0; y<16; ++y)
-    {
-        for (x=0; x<16; ++x)
-        {
-            TXT_PutChar(' ');
-            TXT_PutChar(' ');
-            TXT_PutChar(' ');
-            TXT_PutChar(y * 16 + x);
-        }
-        TXT_PutChar('\n');
-    }
-}
-
 int main(int argc, char *argv[])
 {
     TXT_Init();
@@ -188,6 +169,8 @@
     SetupWindow();
 
     TXT_GUIMainLoop();
+
+    return 0;
 }
 
 
--- a/textscreen/txt_button.c
+++ b/textscreen/txt_button.c
@@ -25,6 +25,7 @@
 #include "doomkeys.h"
 
 #include "txt_button.h"
+#include "txt_gui.h"
 #include "txt_io.h"
 #include "txt_main.h"
 #include "txt_window.h"
--- a/textscreen/txt_checkbox.c
+++ b/textscreen/txt_checkbox.c
@@ -25,6 +25,7 @@
 #include "doomkeys.h"
 
 #include "txt_checkbox.h"
+#include "txt_gui.h"
 #include "txt_io.h"
 #include "txt_main.h"
 #include "txt_window.h"
--- a/textscreen/txt_desktop.c
+++ b/textscreen/txt_desktop.c
@@ -26,6 +26,7 @@
 
 #include "txt_desktop.h"
 #include "txt_gui.h"
+#include "txt_io.h"
 #include "txt_main.h"
 #include "txt_separator.h"
 #include "txt_window.h"
--- a/textscreen/txt_desktop.h
+++ b/textscreen/txt_desktop.h
@@ -31,6 +31,8 @@
 void TXT_GUIMainLoop(void);
 void TXT_DispatchEvents(void);
 void TXT_ExitMainLoop(void);
+void TXT_DrawWindow(txt_window_t *window, int selected);
+void TXT_WindowKeyPress(txt_window_t *window, int c);
 
 #endif /* #ifndef TXT_DESKTOP_T */
 
--- a/textscreen/txt_dropdown.c
+++ b/textscreen/txt_dropdown.c
@@ -26,6 +26,7 @@
 
 #include "txt_button.h"
 #include "txt_dropdown.h"
+#include "txt_gui.h"
 #include "txt_io.h"
 #include "txt_main.h"
 #include "txt_window.h"
--- a/textscreen/txt_inputbox.c
+++ b/textscreen/txt_inputbox.c
@@ -19,6 +19,7 @@
 // 02111-1307, USA.
 //
 
+#include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -26,6 +27,7 @@
 #include "doomkeys.h"
 
 #include "txt_inputbox.h"
+#include "txt_gui.h"
 #include "txt_io.h"
 #include "txt_main.h"
 #include "txt_window.h"
--- a/textscreen/txt_label.c
+++ b/textscreen/txt_label.c
@@ -23,6 +23,7 @@
 #include <string.h>
 
 #include "txt_label.h"
+#include "txt_gui.h"
 #include "txt_io.h"
 #include "txt_main.h"
 #include "txt_window.h"
@@ -40,7 +41,7 @@
     TXT_CAST_ARG(txt_label_t, label);
     int x, y;
     int origin_x, origin_y;
-    int align_indent;
+    int align_indent = 0;
     int w;
 
     w = label->widget.w;
--- a/textscreen/txt_main.c
+++ b/textscreen/txt_main.c
@@ -25,6 +25,8 @@
 //-----------------------------------------------------------------------------
 
 #include <SDL.h>
+
+#include <ctype.h>
 #include <stdlib.h>
 #include <string.h>
 
--- a/textscreen/txt_main.h
+++ b/textscreen/txt_main.h
@@ -97,7 +97,7 @@
 
 // Retrieve the current position of the mouse
 
-void TXT_GetMouseState(int *x, int *y);
+void TXT_GetMousePosition(int *x, int *y);
 
 // Sleep until an event is received or the screen needs updating
 // Optional timeout in ms (timeout == 0 : sleep forever)
--- a/textscreen/txt_radiobutton.c
+++ b/textscreen/txt_radiobutton.c
@@ -25,6 +25,7 @@
 #include "doomkeys.h"
 
 #include "txt_radiobutton.h"
+#include "txt_gui.h"
 #include "txt_io.h"
 #include "txt_main.h"
 #include "txt_window.h"
--- a/textscreen/txt_separator.c
+++ b/textscreen/txt_separator.c
@@ -23,6 +23,7 @@
 #include <string.h>
 
 #include "txt_separator.h"
+#include "txt_gui.h"
 #include "txt_io.h"
 #include "txt_main.h"
 #include "txt_window.h"
@@ -48,7 +49,6 @@
 static void TXT_SeparatorDrawer(TXT_UNCAST_ARG(separator), int selected)
 {
     TXT_CAST_ARG(txt_separator_t, separator);
-    int i;
     int x, y;
     int w;
 
--- a/textscreen/txt_strut.c
+++ b/textscreen/txt_strut.c
@@ -50,6 +50,7 @@
 
 static int TXT_StrutKeyPress(TXT_UNCAST_ARG(strut), int key)
 {
+    return 0;
 }
 
 txt_widget_class_t txt_strut_class =
--- a/textscreen/txt_table.c
+++ b/textscreen/txt_table.c
@@ -27,6 +27,7 @@
 
 #include "txt_desktop.h"
 #include "txt_gui.h"
+#include "txt_io.h"
 #include "txt_main.h"
 #include "txt_separator.h"
 #include "txt_strut.h"
@@ -61,7 +62,6 @@
                             int *row_heights, 
                             int *col_widths)
 {
-    int table_height;
     int x, y;
     int rows;
     txt_widget_t *widget;
@@ -194,7 +194,6 @@
 static int FindSelectableColumn(txt_table_t *table, int row, int start_col)
 {
     int x;
-    int i;
 
     for (x=0; x<table->columns; ++x)
     {
@@ -287,7 +286,6 @@
     if (key == KEY_LEFTARROW)
     {
         int new_x;
-        int i;
 
         // Move cursor left
 
@@ -307,7 +305,6 @@
     if (key == KEY_RIGHTARROW)
     {
         int new_x;
-        int i;
 
         // Move cursor left
 
--- a/textscreen/txt_widget.c
+++ b/textscreen/txt_widget.c
@@ -22,6 +22,7 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "txt_io.h"
 #include "txt_widget.h"
 
 typedef struct
@@ -100,7 +101,6 @@
     TXT_CAST_ARG(txt_widget_t, widget);
     txt_callback_table_t *table;
     txt_callback_t *callback;
-    int i;
 
     table = widget->callback_table;
 
--- a/textscreen/txt_window.c
+++ b/textscreen/txt_window.c
@@ -45,8 +45,6 @@
 txt_window_t *TXT_NewWindow(char *title)
 {
     int i;
-    txt_window_action_t *cancel_action;
-    txt_window_action_t *accept_action;
 
     txt_window_t *win;
 
@@ -289,9 +287,6 @@
 void TXT_DrawWindow(txt_window_t *window, int selected)
 {
     txt_widget_t *widgets;
-    int x, y;
-    int i;
-    int ww, wh;
 
     TXT_LayoutWindow(window);
     
--- a/textscreen/txt_window_action.c
+++ b/textscreen/txt_window_action.c
@@ -25,6 +25,7 @@
 #include "doomkeys.h"
 
 #include "txt_window_action.h"
+#include "txt_gui.h"
 #include "txt_io.h"
 #include "txt_main.h"
 #include "txt_window.h"
@@ -45,7 +46,6 @@
 static void TXT_WindowActionDrawer(TXT_UNCAST_ARG(action), int selected)
 {
     TXT_CAST_ARG(txt_window_action_t, action);
-    int i;
     char buf[10];
 
     TXT_GetKeyDescription(action->key, buf);