summaryrefslogtreecommitdiff
path: root/textscreen
diff options
context:
space:
mode:
authorSimon Howard2009-09-20 15:27:40 +0000
committerSimon Howard2009-09-20 15:27:40 +0000
commit42f7a9b8a27ae1192b49005f5be3eba32f740d05 (patch)
treec8e5898cefc9a4f8af061528ad0b755fbcdf4bb6 /textscreen
parent10da45b90cba29506c142982e76abc35c39d5d26 (diff)
downloadchocolate-doom-42f7a9b8a27ae1192b49005f5be3eba32f740d05.tar.gz
chocolate-doom-42f7a9b8a27ae1192b49005f5be3eba32f740d05.tar.bz2
chocolate-doom-42f7a9b8a27ae1192b49005f5be3eba32f740d05.zip
Use "const char" in libtextscreen where appropriate (thanks entryway).
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1679
Diffstat (limited to 'textscreen')
-rw-r--r--textscreen/txt_desktop.c4
-rw-r--r--textscreen/txt_dropdown.c2
-rw-r--r--textscreen/txt_gui.c8
-rw-r--r--textscreen/txt_gui.h6
-rw-r--r--textscreen/txt_io.c6
-rw-r--r--textscreen/txt_io.h2
-rw-r--r--textscreen/txt_sdl.c6
-rw-r--r--textscreen/txt_widget.c4
-rw-r--r--textscreen/txt_widget.h4
-rw-r--r--textscreen/txt_window_action.c2
-rw-r--r--textscreen/txt_window_action.h2
11 files changed, 23 insertions, 23 deletions
diff --git a/textscreen/txt_desktop.c b/textscreen/txt_desktop.c
index 99a5062d..f833441f 100644
--- a/textscreen/txt_desktop.c
+++ b/textscreen/txt_desktop.c
@@ -61,7 +61,7 @@ void TXT_RemoveDesktopWindow(txt_window_t *win)
num_windows = to;
}
-static void DrawDesktopBackground(char *title)
+static void DrawDesktopBackground(const char *title)
{
int i;
unsigned char *screendata;
@@ -117,7 +117,7 @@ void TXT_SetDesktopTitle(char *title)
void TXT_DrawDesktop(void)
{
int i;
- char *title;
+ const char *title;
TXT_InitClipArea();
diff --git a/textscreen/txt_dropdown.c b/textscreen/txt_dropdown.c
index c5c4f99f..efed8d67 100644
--- a/textscreen/txt_dropdown.c
+++ b/textscreen/txt_dropdown.c
@@ -193,7 +193,7 @@ static void TXT_DropdownListDrawer(TXT_UNCAST_ARG(list), int selected)
{
TXT_CAST_ARG(txt_dropdown_list_t, list);
unsigned int i;
- char *str;
+ const char *str;
// Set bg/fg text colors.
diff --git a/textscreen/txt_gui.c b/textscreen/txt_gui.c
index 276176ec..ec166415 100644
--- a/textscreen/txt_gui.c
+++ b/textscreen/txt_gui.c
@@ -55,7 +55,7 @@ static txt_cliparea_t *cliparea = NULL;
#define VALID_X(x) ((x) >= cliparea->x1 && (x) < cliparea->x2)
#define VALID_Y(y) ((y) >= cliparea->y1 && (y) < cliparea->y2)
-void TXT_DrawDesktopBackground(char *title)
+void TXT_DrawDesktopBackground(const char *title)
{
int i;
unsigned char *screendata;
@@ -125,7 +125,7 @@ void TXT_DrawShadow(int x, int y, int w, int h)
}
}
-void TXT_DrawWindowFrame(char *title, int x, int y, int w, int h)
+void TXT_DrawWindowFrame(const char *title, int x, int y, int w, int h)
{
int x1, y1;
int bx, by;
@@ -224,11 +224,11 @@ void TXT_DrawSeparator(int x, int y, int w)
}
}
-void TXT_DrawString(char *s)
+void TXT_DrawString(const char *s)
{
int x, y;
int x1;
- char *p;
+ const char *p;
TXT_GetXY(&x, &y);
diff --git a/textscreen/txt_gui.h b/textscreen/txt_gui.h
index 3795c65a..ad7ae428 100644
--- a/textscreen/txt_gui.h
+++ b/textscreen/txt_gui.h
@@ -27,10 +27,10 @@
#ifndef TXT_GUI_H
#define TXT_GUI_H
-void TXT_DrawDesktopBackground(char *title);
-void TXT_DrawWindowFrame(char *title, int x, int y, int w, int h);
+void TXT_DrawDesktopBackground(const char *title);
+void TXT_DrawWindowFrame(const char *title, int x, int y, int w, int h);
void TXT_DrawSeparator(int x, int y, int w);
-void TXT_DrawString(char *s);
+void TXT_DrawString(const char *s);
void TXT_DrawHorizScrollbar(int x, int y, int w, int cursor, int range);
void TXT_DrawVertScrollbar(int x, int y, int h, int cursor, int range);
diff --git a/textscreen/txt_io.c b/textscreen/txt_io.c
index 1e8106e7..1ecc7bd6 100644
--- a/textscreen/txt_io.c
+++ b/textscreen/txt_io.c
@@ -33,7 +33,7 @@
static struct
{
txt_color_t color;
- char *name;
+ const char *name;
} colors[] = {
{TXT_COLOR_BLACK, "black"},
{TXT_COLOR_BLUE, "blue"},
@@ -147,11 +147,11 @@ void TXT_PutChar(int c)
PutChar(screen, c);
}
-void TXT_Puts(char *s)
+void TXT_Puts(const char *s)
{
int previous_color = TXT_COLOR_BLACK;
unsigned char *screen;
- char *p;
+ const char *p;
char colorname_buf[20];
char *ending;
int col;
diff --git a/textscreen/txt_io.h b/textscreen/txt_io.h
index 78c68f46..dc25aa93 100644
--- a/textscreen/txt_io.h
+++ b/textscreen/txt_io.h
@@ -30,7 +30,7 @@
#include "txt_main.h"
void TXT_PutChar(int c);
-void TXT_Puts(char *s);
+void TXT_Puts(const char *s);
void TXT_GotoXY(int x, int y);
void TXT_GetXY(int *x, int *y);
void TXT_FGColor(txt_color_t color);
diff --git a/textscreen/txt_sdl.c b/textscreen/txt_sdl.c
index 367ed095..bc98a51b 100644
--- a/textscreen/txt_sdl.c
+++ b/textscreen/txt_sdl.c
@@ -217,7 +217,7 @@ static inline void UpdateCharacter(int x, int y)
unsigned char *p;
unsigned char *s, *s1;
int bg, fg;
- int x1, y1;
+ unsigned int x1, y1;
p = &screendata[(y * TXT_SCREEN_W + x) * 2];
character = p[0];
@@ -458,7 +458,7 @@ signed int TXT_GetChar(void)
return -1;
}
-static char *SpecialKeyName(int key)
+static const char *SpecialKeyName(int key)
{
switch (key)
{
@@ -524,7 +524,7 @@ static char *SpecialKeyName(int key)
void TXT_GetKeyDescription(int key, char *buf)
{
- char *keyname;
+ const char *keyname;
keyname = SpecialKeyName(key);
diff --git a/textscreen/txt_widget.c b/textscreen/txt_widget.c
index 2f019c94..2300b32c 100644
--- a/textscreen/txt_widget.c
+++ b/textscreen/txt_widget.c
@@ -94,7 +94,7 @@ void TXT_InitWidget(TXT_UNCAST_ARG(widget), txt_widget_class_t *widget_class)
}
void TXT_SignalConnect(TXT_UNCAST_ARG(widget),
- char *signal_name,
+ const char *signal_name,
TxtWidgetSignalFunc func,
void *user_data)
{
@@ -117,7 +117,7 @@ void TXT_SignalConnect(TXT_UNCAST_ARG(widget),
callback->user_data = user_data;
}
-void TXT_EmitSignal(TXT_UNCAST_ARG(widget), char *signal_name)
+void TXT_EmitSignal(TXT_UNCAST_ARG(widget), const char *signal_name)
{
TXT_CAST_ARG(txt_widget_t, widget);
txt_callback_table_t *table;
diff --git a/textscreen/txt_widget.h b/textscreen/txt_widget.h
index 63cc5f35..9688829d 100644
--- a/textscreen/txt_widget.h
+++ b/textscreen/txt_widget.h
@@ -106,7 +106,7 @@ struct txt_widget_s
void TXT_InitWidget(TXT_UNCAST_ARG(widget), txt_widget_class_t *widget_class);
void TXT_CalcWidgetSize(TXT_UNCAST_ARG(widget));
void TXT_DrawWidget(TXT_UNCAST_ARG(widget), int selected);
-void TXT_EmitSignal(TXT_UNCAST_ARG(widget), char *signal_name);
+void TXT_EmitSignal(TXT_UNCAST_ARG(widget), const char *signal_name);
int TXT_WidgetKeyPress(TXT_UNCAST_ARG(widget), int key);
void TXT_WidgetMousePress(TXT_UNCAST_ARG(widget), int x, int y, int b);
void TXT_DestroyWidget(TXT_UNCAST_ARG(widget));
@@ -121,7 +121,7 @@ void TXT_LayoutWidget(TXT_UNCAST_ARG(widget));
* @param user_data User-specified pointer to pass to the callback function.
*/
-void TXT_SignalConnect(TXT_UNCAST_ARG(widget), char *signal_name,
+void TXT_SignalConnect(TXT_UNCAST_ARG(widget), const char *signal_name,
TxtWidgetSignalFunc func, void *user_data);
/**
diff --git a/textscreen/txt_window_action.c b/textscreen/txt_window_action.c
index 45a2482c..a326a5ed 100644
--- a/textscreen/txt_window_action.c
+++ b/textscreen/txt_window_action.c
@@ -101,7 +101,7 @@ txt_widget_class_t txt_window_action_class =
NULL,
};
-txt_window_action_t *TXT_NewWindowAction(int key, char *label)
+txt_window_action_t *TXT_NewWindowAction(int key, const char *label)
{
txt_window_action_t *action;
diff --git a/textscreen/txt_window_action.h b/textscreen/txt_window_action.h
index ab87f72c..7f93dd48 100644
--- a/textscreen/txt_window_action.h
+++ b/textscreen/txt_window_action.h
@@ -59,7 +59,7 @@ struct txt_window_action_s
* @return Pointer to the new window action widget.
*/
-txt_window_action_t *TXT_NewWindowAction(int key, char *label);
+txt_window_action_t *TXT_NewWindowAction(int key, const char *label);
/**
* Create a new window action that closes the window when the