summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/libgui.cc
diff options
context:
space:
mode:
authorSteven Noonan <steven@uplinklabs.net>2009-09-20 18:09:20 -0700
committerSteven Noonan <steven@uplinklabs.net>2009-09-25 14:32:29 -0700
commitcc048878478df69796822c164e85e88c023deb43 (patch)
treea25c63b492484825e279b83b33186fea185473e9 /crawl-ref/source/libgui.cc
parent7ddbb5591ef05997318b0f56cb1bc2c29fdd3227 (diff)
downloadcrawl-ref-cc048878478df69796822c164e85e88c023deb43.tar.gz
crawl-ref-cc048878478df69796822c164e85e88c023deb43.zip
libgui: fix declaration consistency
Lots of little things here. The forward declarations for some of these functions simply did not match the function definitions. - clrscr() was declared twice - cprintf(), putch(), putwch(), window(), clrscr() all returned 'void' instead of 'int'. - getch() and strlwr() were defined extern "C", but not declared as such. Also made libgui.cc functions behave like their ncurses equivalents, except that our functions always return the ncurses 'OK' (0) response. Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Diffstat (limited to 'crawl-ref/source/libgui.cc')
-rw-r--r--crawl-ref/source/libgui.cc17
1 files changed, 11 insertions, 6 deletions
diff --git a/crawl-ref/source/libgui.cc b/crawl-ref/source/libgui.cc
index f199d7193d..173877eed0 100644
--- a/crawl-ref/source/libgui.cc
+++ b/crawl-ref/source/libgui.cc
@@ -102,16 +102,18 @@ void gui_init_view_params(crawl_view_geometry &geom)
geom.viewsz.y = 17;
}
-void putch(unsigned char chr)
+int putch(unsigned char chr)
{
// object's method
TextRegion::text_mode->putch(chr);
+ return 0;
}
-void putwch(unsigned chr)
+int putwch(unsigned chr)
{
// No unicode support.
putch(static_cast<unsigned char>(chr));
+ return 0;
}
void writeWChar(unsigned char *ch)
@@ -241,7 +243,7 @@ void get_input_line_gui(char *const buff, int len)
} // while (!done)
}
-void cprintf(const char *format,...)
+int cprintf(const char *format,...)
{
char buffer[2048]; // One full screen if no control seq...
va_list argp;
@@ -250,6 +252,7 @@ void cprintf(const char *format,...)
va_end(argp);
// object's method
TextRegion::text_mode->addstr(buffer);
+ return 0;
}
void textcolor(int color)
@@ -304,8 +307,9 @@ void put_colour_ch(int colour, unsigned ch)
putwch(ch);
}
-void window(int x1, int y1, int x2, int y2)
+int window(int x1, int y1, int x2, int y2)
{
+ return 0;
}
int getch_ck()
@@ -318,9 +322,10 @@ int getch()
return getch_ck();
}
-void clrscr()
+int clrscr()
{
- return (tiles.clrscr());
+ tiles.clrscr();
+ return 0;
}
void message_out(int which_line, int colour, const char *s, int firstcol, bool newline)