summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2019-02-15 19:20:25 +0100
committerBardur Arantsson <bardur@scientician.net>2019-02-15 19:20:25 +0100
commit04dac607b2c1cb30a4f0e23598fe4746504d276a (patch)
tree227869f5e6a01be38332737a269ef9cc935df87c
parent88723af2c30fba10e77b42442c89d2ecb5a03f99 (diff)
Remove unused return value of {text,curs,xtra}_hook_t
-rw-r--r--src/main-gcu.c47
-rw-r--r--src/main-gtk2.c75
-rw-r--r--src/main-sdl.c35
-rw-r--r--src/main-win.c70
-rw-r--r--src/main-x11.c80
-rw-r--r--src/z-term.c65
-rw-r--r--src/z-term.h8
7 files changed, 141 insertions, 239 deletions
diff --git a/src/main-gcu.c b/src/main-gcu.c
index 28e9f383..20b04aa6 100644
--- a/src/main-gcu.c
+++ b/src/main-gcu.c
@@ -433,7 +433,7 @@ static void keymap_game_prepare(void)
/*
* Suspend/Resume
*/
-static errr Term_xtra_gcu_alive(int v)
+static void Term_xtra_gcu_alive(int v)
{
int x, y;
@@ -483,9 +483,6 @@ static errr Term_xtra_gcu_alive(int v)
/* Go to angband keymap mode */
keymap_game();
}
-
- /* Success */
- return (0);
}
@@ -607,7 +604,7 @@ static errr Term_xtra_gcu_event(int v)
/*
* React to changes
*/
-static errr Term_xtra_gcu_react(void)
+static void Term_xtra_gcu_react()
{
#ifdef A_COLOR
@@ -615,7 +612,10 @@ static errr Term_xtra_gcu_react(void)
int i;
/* Cannot handle color redefinition */
- if (!can_fix_color) return (0);
+ if (!can_fix_color)
+ {
+ return;
+ }
/* Set the colors */
for (i = 0; i < 16; i++)
@@ -628,16 +628,13 @@ static errr Term_xtra_gcu_react(void)
}
#endif
-
- /* Success */
- return (0);
}
/*
* Handle a "special request"
*/
-static errr Term_xtra_gcu(int n, int v)
+static void Term_xtra_gcu(int n, int v)
{
term_data *td = (term_data *)(Term->data);
@@ -648,62 +645,57 @@ static errr Term_xtra_gcu(int n, int v)
case TERM_XTRA_CLEAR:
touchwin(td->win);
(void)wclear(td->win);
- return (0);
+ return;
/* Make a noise */
case TERM_XTRA_NOISE:
(void)write(1, "\007", 1);
- return (0);
+ return;
/* Flush the Curses buffer */
case TERM_XTRA_FRESH:
(void)wrefresh(td->win);
- return (0);
-
+ return;
/* Suspend/Resume curses */
case TERM_XTRA_ALIVE:
- return (Term_xtra_gcu_alive(v));
+ Term_xtra_gcu_alive(v);
+ return;
/* Process events */
case TERM_XTRA_EVENT:
- return (Term_xtra_gcu_event(v));
+ Term_xtra_gcu_event(v);
+ return;
/* Flush events */
case TERM_XTRA_FLUSH:
while (!Term_xtra_gcu_event(FALSE));
- return (0);
+ return;
/* React to events */
case TERM_XTRA_REACT:
Term_xtra_gcu_react();
- return (0);
+ return;
}
-
- /* Unknown */
- return (1);
}
/*
* Actually MOVE the hardware cursor
*/
-static errr Term_curs_gcu(int x, int y)
+static void Term_curs_gcu(int x, int y)
{
term_data *td = (term_data *)(Term->data);
/* Literally move the cursor */
wmove(td->win, y, x);
-
- /* Success */
- return (0);
}
/*
* Place some text on the screen using an attribute
*/
-static errr Term_text_gcu(int x, int y, int n, byte a, const char *s)
+static void Term_text_gcu(int x, int y, int n, byte a, const char *s)
{
term_data *td = (term_data *)(Term->data);
@@ -724,9 +716,6 @@ static errr Term_text_gcu(int x, int y, int n, byte a, const char *s)
/* Draw a normal character */
waddch(td->win, (byte)s[i]);
}
-
- /* Success */
- return (0);
}
diff --git a/src/main-gtk2.c b/src/main-gtk2.c
index 126ec3b6..ee4f6ee3 100644
--- a/src/main-gtk2.c
+++ b/src/main-gtk2.c
@@ -284,13 +284,16 @@ static void Term_nuke_gtk(void *data)
/*
* Erase the whole term.
*/
-static errr Term_clear_gtk(void)
+static void Term_clear_gtk()
{
term_data *td = (term_data*)(Term->data);
/* Don't draw to hidden windows */
- if (!td->shown) return (0);
+ if (!td->shown)
+ {
+ return;
+ }
/* Paranoia */
g_assert(td->drawing_area->window != 0);
@@ -307,9 +310,6 @@ static errr Term_clear_gtk(void)
/* Copy image from backing store if present */
TERM_DATA_REFRESH(td, 0, 0, td->cols, td->rows);
-
- /* Success */
- return (0);
}
@@ -348,13 +348,16 @@ static errr Term_wipe_gtk(int x, int y, int n)
/*
* Draw some textual characters.
*/
-static errr Term_text_gtk(int x, int y, int n, byte a, const char *s)
+static void Term_text_gtk(int x, int y, int n, byte a, const char *s)
{
term_data *td = (term_data*)(Term->data);
/* Don't draw to hidden windows */
- if (!td->shown) return (0);
+ if (!td->shown)
+ {
+ return;
+ }
/* Paranoia */
g_assert(td->drawing_area->window != 0);
@@ -377,23 +380,23 @@ static errr Term_text_gtk(int x, int y, int n, byte a, const char *s)
/* Copy image from backing store if present */
TERM_DATA_REFRESH(td, x, y, n, 1);
-
- /* Success */
- return (0);
}
/*
* Draw software cursor at (x, y)
*/
-static errr Term_curs_gtk(int x, int y)
+static void Term_curs_gtk(int x, int y)
{
term_data *td = (term_data*)(Term->data);
int cells = 1;
/* Don't draw to hidden windows */
- if (!td->shown) return (0);
+ if (!td->shown)
+ {
+ return;
+ }
/* Paranoia */
g_assert(td->drawing_area->window != 0);
@@ -413,9 +416,6 @@ static errr Term_curs_gtk(int x, int y)
/* Copy image from backing store if present */
TERM_DATA_REFRESH(td, x, y, cells, 1);
-
- /* Success */
- return (0);
}
@@ -445,7 +445,7 @@ static void DrainEvents(void)
/*
* Handle a "special request"
*/
-static errr Term_xtra_gtk(int n, int v)
+static void Term_xtra_gtk(int n, int v)
{
/* Handle a subset of the legal requests */
switch (n)
@@ -453,78 +453,59 @@ static errr Term_xtra_gtk(int n, int v)
/* Make a noise */
case TERM_XTRA_NOISE:
{
- /* Beep */
gdk_beep();
-
- /* Success */
- return (0);
+ return;
}
/* Flush the output */
case TERM_XTRA_FRESH:
{
- /* Flush pending X requests - almost always no-op */
gdk_flush();
-
- /* Success */
- return (0);
+ return;
}
/* Process random events */
case TERM_XTRA_BORED:
{
- /* Process a pending event if there's one */
CheckEvent(FALSE);
-
- /* Success */
- return (0);
+ return;
}
/* Process Events */
case TERM_XTRA_EVENT:
{
- /* Process an event */
CheckEvent(v);
-
- /* Success */
- return (0);
+ return;
}
/* Flush the events */
case TERM_XTRA_FLUSH:
{
- /* Process all pending events */
DrainEvents();
-
- /* Success */
- return (0);
+ return;
}
/* Handle change in the "level" */
case TERM_XTRA_LEVEL:
- return (0);
+ return;
/* Clear the screen */
case TERM_XTRA_CLEAR:
- return (Term_clear_gtk());
+ Term_clear_gtk();
+ return;
/* Rename main window */
- case TERM_XTRA_RENAME_MAIN_WIN: gtk_window_set_title(GTK_WINDOW(data[0].window), angband_term_name[0]); return (0);
+ case TERM_XTRA_RENAME_MAIN_WIN:
+ gtk_window_set_title(GTK_WINDOW(data[0].window), angband_term_name[0]);
+ return;
/* React to changes */
case TERM_XTRA_REACT:
{
- /* (re-)init colours */
init_colours();
-
-
- /* Success */
- return (0);
+ return;
}
}
-
- /* Unknown */
- return (1);
}
diff --git a/src/main-sdl.c b/src/main-sdl.c
index d745eccd..62068fb3 100644
--- a/src/main-sdl.c
+++ b/src/main-sdl.c
@@ -505,7 +505,7 @@ void handleEvent(SDL_Event *event)
/* declare the screen clearing function used below */
void eraseTerminal();
void drawTermStuff(term_data *td, SDL_Rect *rect);
-static errr Term_xtra_sdl(int n, int v)
+static void Term_xtra_sdl(int n, int v)
{
static SDL_Event event;
term_data *td;
@@ -528,7 +528,7 @@ static errr Term_xtra_sdl(int n, int v)
handleEvent(&event);
}
}
- return(0);
+ return;
}
case TERM_XTRA_FLUSH:
@@ -538,7 +538,7 @@ static errr Term_xtra_sdl(int n, int v)
{
handleEvent(&event);
}
- return (0);
+ return;
}
case TERM_XTRA_CLEAR:
@@ -547,7 +547,7 @@ static errr Term_xtra_sdl(int n, int v)
DB("TERM_XTRA_CLEAR");
suspendUpdate = TRUE;
eraseTerminal();
- return (0);
+ return;
}
case TERM_XTRA_SHAPE:
@@ -562,7 +562,7 @@ static errr Term_xtra_sdl(int n, int v)
* efficiency (and attractiveness) of the program.
*/
- return (0);
+ return;
}
case TERM_XTRA_FRESH:
@@ -587,7 +587,7 @@ static errr Term_xtra_sdl(int n, int v)
suspendUpdate = FALSE;
drawTermStuff(td,NULL);
}
- return (0);
+ return;
}
case TERM_XTRA_NOISE:
@@ -599,8 +599,7 @@ static errr Term_xtra_sdl(int n, int v)
*
* This action is optional, but convenient.
*/
-
- return (1);
+ return;
}
case TERM_XTRA_BORED:
@@ -610,7 +609,7 @@ static errr Term_xtra_sdl(int n, int v)
/* We found an event! */
handleEvent(&event);
}
- return(0);
+ return;
}
case TERM_XTRA_REACT:
@@ -625,7 +624,7 @@ static errr Term_xtra_sdl(int n, int v)
* handling "color changes" and the "arg_sound" and/or
* "arg_graphics" options.
*/
- return (1);
+ return;
}
case TERM_XTRA_ALIVE:
@@ -644,7 +643,7 @@ static errr Term_xtra_sdl(int n, int v)
* on UNIX machines, to allow proper "suspending".
*/
- return (1);
+ return;
}
case TERM_XTRA_LEVEL:
@@ -665,13 +664,10 @@ static errr Term_xtra_sdl(int n, int v)
* one "term_data" structure is supported by this file.
*/
- return (1);
+ return;
}
}
-
- /* Unknown or Unhandled action */
- return (1);
}
/*************************************************
@@ -947,7 +943,7 @@ void createCursor(byte r, byte g, byte b, byte a)
/* Cursor Display routine - just blits the global cursor
surface onto the correct location */
-static errr Term_curs_sdl(int x, int y)
+static void Term_curs_sdl(int x, int y)
{
term_data *td = (term_data*)(Term->data);
static SDL_Rect base;
@@ -965,8 +961,6 @@ static errr Term_curs_sdl(int x, int y)
/* Now draw to the main screen */
drawTermStuff(td,&base);
- /* Success */
- return (0);
}
/* Perform a full clear of active terminal; redraw the borders.*/
@@ -1034,7 +1028,7 @@ void eraseTerminal(void)
* the resulting "blank" correctly.
*
*/
-static errr Term_text_sdl(int x, int y, int n, byte a, const char *cp)
+static void Term_text_sdl(int x, int y, int n, byte a, const char *cp)
{
term_data *td = (term_data*)(Term->data);
static SDL_Rect base;
@@ -1095,9 +1089,6 @@ static errr Term_text_sdl(int x, int y, int n, byte a, const char *cp)
/* And update */
drawTermStuff(td,&base_back);
-
- /* Success */
- return (0);
}
/*************************************************
diff --git a/src/main-win.c b/src/main-win.c
index 0e88d337..3fa1f300 100644
--- a/src/main-win.c
+++ b/src/main-win.c
@@ -1245,7 +1245,7 @@ static void term_data_redraw(term_data *td)
/*
* React to global changes
*/
-static errr Term_xtra_win_react(void)
+static void Term_xtra_win_react(void)
{
int i;
@@ -1324,17 +1324,13 @@ static errr Term_xtra_win_react(void)
Term_activate(old);
}
}
-
-
- /* Success */
- return (0);
}
/*
* Process at least one event
*/
-static errr Term_xtra_win_event(int v)
+static void Term_xtra_win_event(int v)
{
MSG msg;
@@ -1359,16 +1355,13 @@ static errr Term_xtra_win_event(int v)
DispatchMessage(&msg);
}
}
-
- /* Success */
- return 0;
}
/*
* Process all pending events
*/
-static errr Term_xtra_win_flush(void)
+static void Term_xtra_win_flush(void)
{
MSG msg;
@@ -1378,9 +1371,6 @@ static errr Term_xtra_win_flush(void)
TranslateMessage(&msg);
DispatchMessage(&msg);
}
-
- /* Success */
- return (0);
}
@@ -1389,7 +1379,7 @@ static errr Term_xtra_win_flush(void)
*
* Make this more efficient XXX XXX XXX
*/
-static errr Term_xtra_win_clear(void)
+static void Term_xtra_win_clear(void)
{
term_data *td = (term_data*)(Term->data);
@@ -1408,26 +1398,22 @@ static errr Term_xtra_win_clear(void)
SelectObject(hdc, td->font_id);
ExtTextOut(hdc, 0, 0, ETO_OPAQUE, &rc, NULL, 0, NULL);
ReleaseDC(td->w, hdc);
-
- /* Success */
- return 0;
}
/*
* Hack -- make a noise
*/
-static errr Term_xtra_win_noise(void)
+static void Term_xtra_win_noise(void)
{
MessageBeep(MB_ICONASTERISK);
- return (0);
}
/*
* Delay for "x" milliseconds
*/
-static int Term_xtra_win_delay(int v)
+static void Term_xtra_win_delay(int v)
{
#ifdef WIN32
@@ -1455,9 +1441,6 @@ static int Term_xtra_win_delay(int v)
}
#endif /* WIN32 */
-
- /* Success */
- return (0);
}
/*
@@ -1471,7 +1454,7 @@ HWND get_main_hwnd()
/*
* Do a "special thing"
*/
-static errr Term_xtra_win(int n, int v)
+static void Term_xtra_win(int n, int v)
{
/* Handle a subset of the legal requests */
switch (n)
@@ -1479,52 +1462,59 @@ static errr Term_xtra_win(int n, int v)
/* Make a bell sound */
case TERM_XTRA_NOISE:
{
- return (Term_xtra_win_noise());
+ Term_xtra_win_noise();
+ return;
}
/* Process random events */
case TERM_XTRA_BORED:
{
- return (Term_xtra_win_event(0));
+ Term_xtra_win_event(0);
+ return;
}
/* Process an event */
case TERM_XTRA_EVENT:
{
- return (Term_xtra_win_event(v));
+ Term_xtra_win_event(v);
+ return;
}
/* Flush all events */
case TERM_XTRA_FLUSH:
{
- return (Term_xtra_win_flush());
+ Term_xtra_win_flush();
+ return;
}
/* Clear the screen */
case TERM_XTRA_CLEAR:
{
- return (Term_xtra_win_clear());
+ Term_xtra_win_clear();
+ return;
}
/* React to global changes */
case TERM_XTRA_REACT:
{
- return (Term_xtra_win_react());
+ Term_xtra_win_react();
+ return;
}
/* Delay for some milliseconds */
case TERM_XTRA_DELAY:
{
- return (Term_xtra_win_delay(v));
+ Term_xtra_win_delay(v);
+ return;
}
/* Rename main window */
case TERM_XTRA_RENAME_MAIN_WIN:
- SetWindowText(get_main_hwnd(), angband_term_name[0]); return (0);
+ {
+ SetWindowText(get_main_hwnd(), angband_term_name[0]);
+ return;
+ }
}
-
- /* Oops */
- return 1;
}
@@ -1534,7 +1524,7 @@ static errr Term_xtra_win(int n, int v)
*
* Draw a "cursor" at (x,y), using a "yellow box".
*/
-static errr Term_curs_win(int x, int y)
+static void Term_curs_win(int x, int y)
{
term_data *td = (term_data*)(Term->data);
@@ -1551,9 +1541,6 @@ static errr Term_curs_win(int x, int y)
hdc = GetDC(data[0].w);
FrameRect(hdc, &rc, hbrYellow);
ReleaseDC(data[0].w, hdc);
-
- /* Success */
- return 0;
}
@@ -1568,7 +1555,7 @@ static errr Term_curs_win(int x, int y)
* what color it should be using to draw with, but perhaps simply changing
* it every time is not too inefficient. XXX XXX XXX
*/
-static errr Term_text_win(int x, int y, int n, byte a, const char *s)
+static void Term_text_win(int x, int y, int n, byte a, const char *s)
{
term_data *td = (term_data*)(Term->data);
RECT rc;
@@ -1643,9 +1630,6 @@ static errr Term_text_win(int x, int y, int n, byte a, const char *s)
/* Release DC */
ReleaseDC(td->w, hdc);
-
- /* Success */
- return 0;
}
diff --git a/src/main-x11.c b/src/main-x11.c
index 8ed303f1..9d7390cf 100644
--- a/src/main-x11.c
+++ b/src/main-x11.c
@@ -662,28 +662,23 @@ static errr Metadpy_init_2(Display *dpy, const char *name)
/*
* General Flush/ Sync/ Discard routine
*/
-static errr Metadpy_update(int flush, int sync, int discard)
+static void Metadpy_update(int flush, int sync, int discard)
{
/* Flush if desired */
if (flush) XFlush(Metadpy->dpy);
/* Sync if desired, using 'discard' */
if (sync) XSync(Metadpy->dpy, discard);
-
- /* Success */
- return (0);
}
/*
* Make a simple beep
*/
-static errr Metadpy_do_beep(void)
+static void Metadpy_do_beep()
{
/* Make a simple beep */
XBell(Metadpy->dpy, 100);
-
- return (0);
}
@@ -691,7 +686,7 @@ static errr Metadpy_do_beep(void)
/*
* Set the name (in the title bar) of Infowin
*/
-static errr Infowin_set_name(const char *name)
+static void Infowin_set_name(const char *name)
{
Status st;
XTextProperty tp;
@@ -700,7 +695,6 @@ static errr Infowin_set_name(const char *name)
strcpy(buf, name);
st = XStringListToTextProperty(&bp, 1, &tp);
if (st) XSetWMName(Metadpy->dpy, Infowin->win, &tp);
- return (0);
}
@@ -864,13 +858,10 @@ static errr Infowin_impell(int x, int y)
/*
* Visually clear Infowin
*/
-static errr Infowin_wipe(void)
+static void Infowin_wipe()
{
/* Execute the request */
XClearWindow(Metadpy->dpy, Infowin->win);
-
- /* Success */
- return (0);
}
@@ -2056,7 +2047,7 @@ static errr CheckEvent(bool_ wait)
/*
* Handle "activation" of a term
*/
-static errr Term_xtra_x11_level(int v)
+static void Term_xtra_x11_level(int v)
{
term_data *td = (term_data*)(Term->data);
@@ -2069,16 +2060,13 @@ static errr Term_xtra_x11_level(int v)
/* Activate the font */
Infofnt_set(td->fnt);
}
-
- /* Success */
- return (0);
}
/*
* React to changes
*/
-static errr Term_xtra_x11_react(void)
+static void Term_xtra_x11_react()
{
int i;
@@ -2112,57 +2100,63 @@ static errr Term_xtra_x11_react(void)
}
}
}
-
- /* Success */
- return (0);
}
/*
* Handle a "special request"
*/
-static errr Term_xtra_x11(int n, int v)
+static void Term_xtra_x11(int n, int v)
{
/* Handle a subset of the legal requests */
switch (n)
{
/* Make a noise */
case TERM_XTRA_NOISE:
- Metadpy_do_beep(); return (0);
+ Metadpy_do_beep();
+ return;
/* Flush the output XXX XXX */
- case TERM_XTRA_FRESH: Metadpy_update(1, 0, 0); return (0);
+ case TERM_XTRA_FRESH:
+ Metadpy_update(1, 0, 0);
+ return;
/* Process random events XXX */
case TERM_XTRA_BORED:
- {
- return (CheckEvent(0));
- }
+ CheckEvent(0);
+ return;
/* Process Events XXX */
case TERM_XTRA_EVENT:
- {
- return (CheckEvent(v));
- }
+ CheckEvent(v);
+ return;
/* Flush the events XXX */
- case TERM_XTRA_FLUSH: while (!CheckEvent(FALSE)); return (0);
+ case TERM_XTRA_FLUSH:
+ while (!CheckEvent(FALSE));
+ return;
/* Handle change in the "level" */
- case TERM_XTRA_LEVEL: return (Term_xtra_x11_level(v));
+ case TERM_XTRA_LEVEL:
+ Term_xtra_x11_level(v);
+ return;
/* Clear the screen, and redraw any selection later. */
- case TERM_XTRA_CLEAR: Infowin_wipe(); s_ptr->drawn = FALSE; return (0);
+ case TERM_XTRA_CLEAR:
+ Infowin_wipe();
+ s_ptr->drawn = FALSE;
+ return;
/* React to changes */
- case TERM_XTRA_REACT: return (Term_xtra_x11_react());
+ case TERM_XTRA_REACT:
+ Term_xtra_x11_react();
+ return;
/* Rename main window */
- case TERM_XTRA_RENAME_MAIN_WIN: Infowin_set_name(angband_term_name[0]); return (0);
+ case TERM_XTRA_RENAME_MAIN_WIN:
+ Infowin_set_name(angband_term_name[0]);
+ return;
}
-
- /* Unknown */
- return (1);
}
@@ -2171,7 +2165,7 @@ static errr Term_xtra_x11(int n, int v)
*
* Consider a rectangular outline like "main-mac.c". XXX XXX
*/
-static errr Term_curs_x11(int x, int y)
+static void Term_curs_x11(int x, int y)
{
/* Draw the cursor */
Infoclr_set(xor);
@@ -2181,25 +2175,19 @@ static errr Term_curs_x11(int x, int y)
/* Redraw the selection if any, as it may have been obscured. (later) */
s_ptr->drawn = FALSE;
-
- /* Success */
- return (0);
}
/*
* Draw some textual characters.
*/
-static errr Term_text_x11(int x, int y, int n, byte a, const char *s)
+static void Term_text_x11(int x, int y, int n, byte a, const char *s)
{
/* Draw the text */
Infoclr_set(clr[a]);
/* Draw the text */
Infofnt_text_std(x, y, s, n);
-
- /* Success */
- return (0);
}
diff --git a/src/z-term.c b/src/z-term.c
index e8f308b0..b65bf9b7 100644
--- a/src/z-term.c
+++ b/src/z-term.c
@@ -10,6 +10,7 @@
#include "z-term.h"
+#include <assert.h>
/*
@@ -368,49 +369,17 @@ static errr term_win_copy(term_win *s, term_win *f, int w, int h)
/*
- * Execute the "Term->xtra_hook" hook, if available (see above).
- * And *hacky* get a return code
+ * Execute the "Term->xtra_hook" hook, if any.
*/
-errr Term_xtra(int n, int v)
+void Term_xtra(int n, int v)
{
- /* Verify the hook */
- if (!Term->xtra_hook) return ( -1);
-
- /* Call the hook */
- return ((*Term->xtra_hook)(n, v));
-}
-
-
-
-/*** Fake hooks ***/
-
-
-/*
- * Hack -- fake hook for "Term_curs()" (see above)
- */
-static errr Term_curs_hack(int x, int y)
-{
- /* Compiler silliness */
- if (x || y) return ( -2);
-
- /* Oops */
- return ( -1);
-}
-
-/*
- * Hack -- fake hook for "Term_text()" (see above)
- */
-static errr Term_text_hack(int x, int y, int n, byte a, const char *cp)
-{
- /* Compiler silliness */
- if (x || y || n || a || cp) return ( -2);
-
- /* Oops */
- return ( -1);
+ if (Term->xtra_hook)
+ {
+ (*Term->xtra_hook)(n, v);
+ }
}
-
/*** Efficient routines ***/
@@ -544,7 +513,7 @@ static void Term_fresh_row_text(int y, int x1, int x2)
/* Flush */
if (fn)
{
- (void)((*Term->text_hook)(fx, y, fn, fa, &scr_cc[fx]));
+ (*Term->text_hook)(fx, y, fn, fa, &scr_cc[fx]);
/* Forget */
fn = 0;
@@ -565,7 +534,7 @@ static void Term_fresh_row_text(int y, int x1, int x2)
if (fn)
{
/* Draw the pending chars */
- (void)((*Term->text_hook)(fx, y, fn, fa, &scr_cc[fx]));
+ (*Term->text_hook)(fx, y, fn, fa, &scr_cc[fx]);
/* Forget */
fn = 0;
@@ -582,7 +551,7 @@ static void Term_fresh_row_text(int y, int x1, int x2)
/* Flush */
if (fn)
{
- (void)((*Term->text_hook)(fx, y, fn, fa, &scr_cc[fx]));
+ (*Term->text_hook)(fx, y, fn, fa, &scr_cc[fx]);
}
}
@@ -700,8 +669,8 @@ errr Term_fresh(void)
/* Paranoia -- use "fake" hooks to prevent core dumps */
- if (!Term->curs_hook) Term->curs_hook = Term_curs_hack;
- if (!Term->text_hook) Term->text_hook = Term_text_hack;
+ assert(Term->curs_hook != NULL);
+ assert(Term->text_hook != NULL);
/* Handle "total erase" */
@@ -763,7 +732,7 @@ errr Term_fresh(void)
char oc = old_cc[tx];
/* Hack -- restore the actual character */
- (void)((*Term->text_hook)(tx, ty, 1, oa, &oc));
+ (*Term->text_hook)(tx, ty, 1, oa, &oc);
}
}
@@ -829,7 +798,7 @@ errr Term_fresh(void)
if (!scr->cu && scr->cv)
{
/* Call the cursor display routine */
- (void)((*Term->curs_hook)(scr->cx, scr->cy));
+ (*Term->curs_hook)(scr->cx, scr->cy);
}
}
@@ -840,7 +809,7 @@ errr Term_fresh(void)
if (scr->cu)
{
/* Paranoia -- Put the cursor NEAR where it belongs */
- (void)((*Term->curs_hook)(w - 1, scr->cy));
+ (*Term->curs_hook)(w - 1, scr->cy);
/* Make the cursor invisible */
/* Term_xtra(TERM_XTRA_SHAPE, 0); */
@@ -850,7 +819,7 @@ errr Term_fresh(void)
else if (!scr->cv)
{
/* Paranoia -- Put the cursor where it belongs */
- (void)((*Term->curs_hook)(scr->cx, scr->cy));
+ (*Term->curs_hook)(scr->cx, scr->cy);
/* Make the cursor invisible */
/* Term_xtra(TERM_XTRA_SHAPE, 0); */
@@ -860,7 +829,7 @@ errr Term_fresh(void)
else
{
/* Put the cursor where it belongs */
- (void)((*Term->curs_hook)(scr->cx, scr->cy));
+ (*Term->curs_hook)(scr->cx, scr->cy);
/* Make the cursor visible */
Term_xtra(TERM_XTRA_SHAPE, 1);
diff --git a/src/z-term.h b/src/z-term.h
index 5984e6ba..a7da44e4 100644
--- a/src/z-term.h
+++ b/src/z-term.h
@@ -27,9 +27,9 @@ struct term_win; // Opaque
typedef void(init_hook_t)(void *data);
typedef void(nuke_hook_t)(void *data);
-typedef errr(xtra_hook_t)(int n, int v);
-typedef errr(curs_hook_t)(int x, int y);
-typedef errr(text_hook_t)(int x, int y, int n, byte a, const char *s);
+typedef void(xtra_hook_t)(int n, int v);
+typedef void(curs_hook_t)(int x, int y);
+typedef void(text_hook_t)(int x, int y, int n, byte a, const char *s);
typedef struct term_ui_hooks_t term_ui_hooks_t;
@@ -214,7 +214,7 @@ extern term *Term;
/**** Available Functions ****/
-errr Term_xtra(int n, int v);
+void Term_xtra(int n, int v);
void Term_queue_char(int x, int y, byte a, char c);
void Term_queue_chars(int x, int y, int n, byte a, const char *s);