OSDN Git Service

[Refactor] #40567 Moved functions can be static in z-term.c/h
authorHourier <hourier@users.sourceforge.jp>
Thu, 16 Jul 2020 11:03:31 +0000 (20:03 +0900)
committerHourier <hourier@users.sourceforge.jp>
Thu, 16 Jul 2020 11:03:31 +0000 (20:03 +0900)
13 files changed:
src/cmd-io/cmd-gameoption.c
src/cmd-visual/cmd-draw.c
src/io/chuukei.c
src/io/input-key-acceptor.c
src/main-win.c
src/main.c
src/player/player-damage.c
src/term/gameterm.c
src/term/gameterm.h
src/term/z-term.c
src/term/z-term.h
src/window/display-sub-window-spells.c
src/window/display-sub-windows.c

index 59cc9b1..5511fb3 100644 (file)
@@ -266,7 +266,7 @@ static void do_cmd_options_win(player_type *player_ptr)
     }
 
     for (j = 0; j < 8; j++) {
     }
 
     for (j = 0; j < 8; j++) {
-        term *old = Term;
+        term_type *old = Term;
         if (!angband_term[j])
             continue;
 
         if (!angband_term[j])
             continue;
 
index 6f3a2dc..d1b2fd1 100644 (file)
@@ -55,7 +55,7 @@ void do_cmd_redraw(player_type *creature_ptr)
        handle_stuff(creature_ptr);
        if (creature_ptr->prace == RACE_ANDROID) calc_android_exp(creature_ptr);
 
        handle_stuff(creature_ptr);
        if (creature_ptr->prace == RACE_ANDROID) calc_android_exp(creature_ptr);
 
-       term *old = Term;
+       term_type *old = Term;
        for (int j = 0; j < 8; j++)
        {
                if (!angband_term[j]) continue;
        for (int j = 0; j < 8; j++)
        {
                if (!angband_term[j]) continue;
index cf39312..4b9966c 100644 (file)
@@ -106,7 +106,7 @@ static errr (*old_text_hook)(int x, int y, int n, TERM_COLOR a, concptr s);
 
 static void disable_chuukei_server(void)
 {
 
 static void disable_chuukei_server(void)
 {
-    term *t = angband_term[0];
+    term_type *t = angband_term[0];
 #ifdef CHUUKEI
     chuukei_server = FALSE;
 #endif /* CHUUKEI */
 #ifdef CHUUKEI
     chuukei_server = FALSE;
 #endif /* CHUUKEI */
@@ -469,7 +469,7 @@ static errr send_bigcurs_to_chuukei_server(int x, int y)
  */
 void prepare_chuukei_hooks(void)
 {
  */
 void prepare_chuukei_hooks(void)
 {
-    term *t0 = angband_term[0];
+    term_type *t0 = angband_term[0];
 
     /* Save original z-term hooks */
     old_xtra_hook = t0->xtra_hook;
 
     /* Save original z-term hooks */
     old_xtra_hook = t0->xtra_hook;
index ca81b56..be679a5 100644 (file)
@@ -170,7 +170,7 @@ char inkey(void)
 {
     char ch = 0;
     bool done = FALSE;
 {
     char ch = 0;
     bool done = FALSE;
-    term *old = Term;
+    term_type *old = Term;
 
     if (inkey_next && *inkey_next && !inkey_xtra) {
         ch = *inkey_next++;
 
     if (inkey_next && *inkey_next && !inkey_xtra) {
         ch = *inkey_next++;
index 1e6e218..43868ef 100644 (file)
  * </p>
  */
 typedef struct {
  * </p>
  */
 typedef struct {
-    term t;
+    term_type t;
     concptr s;
     HWND w;
     DWORD dwStyle;
     concptr s;
     HWND w;
     DWORD dwStyle;
@@ -1386,7 +1386,7 @@ static errr term_xtra_win_react(player_type *player_ptr)
     }
 
     for (int i = 0; i < MAX_TERM_DATA; i++) {
     }
 
     for (int i = 0; i < MAX_TERM_DATA; i++) {
-        term *old = Term;
+        term_type *old = Term;
         term_data *td = &data[i];
         if ((td->cols != td->t.wid) || (td->rows != td->t.hgt)) {
             term_activate(&td->t);
         term_data *td = &data[i];
         if ((td->cols != td->t.wid) || (td->rows != td->t.hgt)) {
             term_activate(&td->t);
@@ -1965,7 +1965,7 @@ static void windows_map(player_type *player_ptr)
  */
 static void term_data_link(term_data *td)
 {
  */
 static void term_data_link(term_data *td)
 {
-    term *t = &td->t;
+    term_type *t = &td->t;
     term_init(t, td->cols, td->rows, td->keys);
     t->soft_cursor = TRUE;
     t->higher_pict = TRUE;
     term_init(t, td->cols, td->rows, td->keys);
     t->soft_cursor = TRUE;
     t->higher_pict = TRUE;
@@ -2723,6 +2723,28 @@ static void process_menus(player_type *player_ptr, WORD wCmd)
     }
 }
 
     }
 }
 
+/*
+ * Add a keypress to the "queue"
+ */
+static errr term_keypress(int k)
+{
+    /* Refuse to enqueue non-keys */
+    if (!k)
+        return -1;
+
+    /* Store the char, advance the queue */
+    Term->key_queue[Term->key_head++] = (char)k;
+
+    /* Circular queue, handle wrap */
+    if (Term->key_head == Term->key_size)
+        Term->key_head = 0;
+
+    if (Term->key_head != Term->key_tail)
+        return 0;
+
+    return 1;
+}
+
 static bool process_keydown(WPARAM wParam, LPARAM lParam)
 {
     bool mc = FALSE;
 static bool process_keydown(WPARAM wParam, LPARAM lParam)
 {
     bool mc = FALSE;
@@ -3162,7 +3184,7 @@ LRESULT PASCAL AngbandListProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
         TERM_LEN cols = (LOWORD(lParam) - td->size_ow1) / td->tile_wid;
         TERM_LEN rows = (HIWORD(lParam) - td->size_oh1) / td->tile_hgt;
         if ((td->cols != cols) || (td->rows != rows)) {
         TERM_LEN cols = (LOWORD(lParam) - td->size_ow1) / td->tile_wid;
         TERM_LEN rows = (HIWORD(lParam) - td->size_oh1) / td->tile_hgt;
         if ((td->cols != cols) || (td->rows != rows)) {
-            term *old_term = Term;
+            term_type *old_term = Term;
             td->cols = cols;
             td->rows = rows;
             term_activate(&td->t);
             td->cols = cols;
             td->rows = rows;
             term_activate(&td->t);
index 1f35b3e..7031a05 100644 (file)
 #if !defined(WINDOWS)
 
 /*
 #if !defined(WINDOWS)
 
 /*
+ * Nuke a term
+ */
+static errr term_nuke(term_type *t)
+{
+    TERM_LEN w = t->wid;
+    TERM_LEN h = t->hgt;
+
+    /* Call the special "nuke" hook */
+    if (t->active_flag) {
+        /* Call the "nuke" hook */
+        if (t->nuke_hook)
+            (*t->nuke_hook)(t);
+
+        /* Remember */
+        t->active_flag = FALSE;
+
+        /* Assume not mapped */
+        t->mapped_flag = FALSE;
+    }
+
+    /* Nuke "displayed" */
+    term_win_nuke(t->old, w, h);
+
+    /* Kill "displayed" */
+    KILL(t->old, term_win);
+
+    /* Nuke "requested" */
+    term_win_nuke(t->scr, w, h);
+
+    /* Kill "requested" */
+    KILL(t->scr, term_win);
+
+    /* If needed */
+    if (t->mem) {
+        /* Nuke "memorized" */
+        term_win_nuke(t->mem, w, h);
+
+        /* Kill "memorized" */
+        KILL(t->mem, term_win);
+    }
+
+    /* If needed */
+    if (t->tmp) {
+        /* Nuke "temporary" */
+        term_win_nuke(t->tmp, w, h);
+
+        /* Kill "temporary" */
+        KILL(t->tmp, term_win);
+    }
+
+    /* Free some arrays */
+    C_KILL(t->x1, h, TERM_LEN);
+    C_KILL(t->x2, h, TERM_LEN);
+
+    /* Free the input queue */
+    C_KILL(t->key_queue, t->key_size, char);
+    return 0;
+}
+
+/*
  * A hook for "quit()".
  *
  * Close down, then fall back into "quit()".
  * A hook for "quit()".
  *
  * Close down, then fall back into "quit()".
index bcb641a..abee6f9 100644 (file)
@@ -332,6 +332,38 @@ HIT_POINT cold_dam(player_type *creature_ptr, HIT_POINT dam, concptr kb_str, int
     return get_damage;
 }
 
     return get_damage;
 }
 
+#ifdef JP
+/*
+ * Move to a location and, using an attr, add a string vertically
+ */
+static errr term_putstr_v(TERM_LEN x, TERM_LEN y, int n, byte a, concptr s)
+{
+    errr res;
+    int y0 = y;
+
+    for (int i = 0; i < n && s[i] != 0; i++) {
+        /* Move first */
+        if ((res = term_gotoxy(x, y0)) != 0)
+            return (res);
+
+        if (iskanji(s[i])) {
+            if ((res = term_addstr(2, a, &s[i])) != 0)
+                return (res);
+            i++;
+            y0++;
+            if (s[i] == 0)
+                break;
+        } else {
+            if ((res = term_addstr(1, a, &s[i])) != 0)
+                return (res);
+            y0++;
+        }
+    }
+
+    return 0;
+}
+#endif
+
 /*
  * Decreases players hit points and sets death flag if necessary
  *
 /*
  * Decreases players hit points and sets death flag if necessary
  *
index baa7b14..9781696 100644 (file)
@@ -352,7 +352,7 @@ const concptr ident_info[] =
 /*
  * The array of window pointers
  */
 /*
  * The array of window pointers
  */
-term *angband_term[8];
+term_type *angband_term[8];
 
 /*!
  * スクリーン表示色キャラクタ /
 
 /*!
  * スクリーン表示色キャラクタ /
index 6c22d0f..73a7194 100644 (file)
@@ -19,7 +19,7 @@ extern const concptr color_names[16];
 extern const concptr window_flag_desc[32];
 extern const concptr ident_info[];
 
 extern const concptr window_flag_desc[32];
 extern const concptr ident_info[];
 
-extern term *angband_term[8];
+extern term_type *angband_term[8];
 #define term_screen (angband_term[0])
 
 extern TERM_COLOR misc_to_attr[256];
 #define term_screen (angband_term[0])
 
 extern TERM_COLOR misc_to_attr[256];
index b70e779..7b3aac7 100644 (file)
@@ -29,7 +29,7 @@
 #endif
 
 /* The current "term" */
 #endif
 
 /* The current "term" */
-term *Term = NULL;
+term_type *Term = NULL;
 
 /*** Local routines ***/
 
 
 /*** Local routines ***/
 
@@ -416,7 +416,7 @@ void term_queue_line(TERM_LEN x, TERM_LEN y, int n, TERM_COLOR *a, char *c, TERM
  * a valid location, so the first "n" characters of "s" can all be added
  * starting at (x,y) without causing any illegal operations.
  */
  * a valid location, so the first "n" characters of "s" can all be added
  * starting at (x,y) without causing any illegal operations.
  */
-void term_queue_chars(TERM_LEN x, TERM_LEN y, int n, TERM_COLOR a, concptr s)
+static void term_queue_chars(TERM_LEN x, TERM_LEN y, int n, TERM_COLOR a, concptr s)
 {
     TERM_LEN x1 = -1, x2 = -1;
 
 {
     TERM_LEN x1 = -1, x2 = -1;
 
@@ -1501,38 +1501,6 @@ errr term_putstr(TERM_LEN x, TERM_LEN y, int n, TERM_COLOR a, concptr s)
     return 0;
 }
 
     return 0;
 }
 
-#ifdef JP
-/*
- * Move to a location and, using an attr, add a string vertically
- */
-errr term_putstr_v(TERM_LEN x, TERM_LEN y, int n, byte a, concptr s)
-{
-    errr res;
-    int y0 = y;
-
-    for (int i = 0; i < n && s[i] != 0; i++) {
-        /* Move first */
-        if ((res = term_gotoxy(x, y0)) != 0)
-            return (res);
-
-        if (iskanji(s[i])) {
-            if ((res = term_addstr(2, a, &s[i])) != 0)
-                return (res);
-            i++;
-            y0++;
-            if (s[i] == 0)
-                break;
-        } else {
-            if ((res = term_addstr(1, a, &s[i])) != 0)
-                return (res);
-            y0++;
-        }
-    }
-
-    return 0;
-}
-#endif
-
 /*
  * Place cursor at (x,y), and clear the next "n" chars
  */
 /*
  * Place cursor at (x,y), and clear the next "n" chars
  */
@@ -1837,28 +1805,6 @@ errr term_flush(void)
 }
 
 /*
 }
 
 /*
- * Add a keypress to the "queue"
- */
-errr term_keypress(int k)
-{
-    /* Refuse to enqueue non-keys */
-    if (!k)
-        return -1;
-
-    /* Store the char, advance the queue */
-    Term->key_queue[Term->key_head++] = (char)k;
-
-    /* Circular queue, handle wrap */
-    if (Term->key_head == Term->key_size)
-        Term->key_head = 0;
-
-    if (Term->key_head != Term->key_tail)
-        return 0;
-
-    return 1;
-}
-
-/*
  * Add a keypress to the FRONT of the "queue"
  */
 errr term_key_push(int k)
  * Add a keypress to the FRONT of the "queue"
  */
 errr term_key_push(int k)
@@ -2222,7 +2168,7 @@ errr term_resize(TERM_LEN w, TERM_LEN h)
  * To "create" a valid "term", one should do "term_init(t)", then
  * set the various flags and hooks, and then do "term_activate(t)".
  */
  * To "create" a valid "term", one should do "term_init(t)", then
  * set the various flags and hooks, and then do "term_activate(t)".
  */
-errr term_activate(term *t)
+errr term_activate(term_type *t)
 {
     /* already done */
     if (Term == t)
 {
     /* already done */
     if (Term == t)
@@ -2256,75 +2202,15 @@ errr term_activate(term *t)
 }
 
 /*
 }
 
 /*
- * Nuke a term
- */
-errr term_nuke(term *t)
-{
-    TERM_LEN w = t->wid;
-    TERM_LEN h = t->hgt;
-
-    /* Call the special "nuke" hook */
-    if (t->active_flag) {
-        /* Call the "nuke" hook */
-        if (t->nuke_hook)
-            (*t->nuke_hook)(t);
-
-        /* Remember */
-        t->active_flag = FALSE;
-
-        /* Assume not mapped */
-        t->mapped_flag = FALSE;
-    }
-
-    /* Nuke "displayed" */
-    term_win_nuke(t->old, w, h);
-
-    /* Kill "displayed" */
-    KILL(t->old, term_win);
-
-    /* Nuke "requested" */
-    term_win_nuke(t->scr, w, h);
-
-    /* Kill "requested" */
-    KILL(t->scr, term_win);
-
-    /* If needed */
-    if (t->mem) {
-        /* Nuke "memorized" */
-        term_win_nuke(t->mem, w, h);
-
-        /* Kill "memorized" */
-        KILL(t->mem, term_win);
-    }
-
-    /* If needed */
-    if (t->tmp) {
-        /* Nuke "temporary" */
-        term_win_nuke(t->tmp, w, h);
-
-        /* Kill "temporary" */
-        KILL(t->tmp, term_win);
-    }
-
-    /* Free some arrays */
-    C_KILL(t->x1, h, TERM_LEN);
-    C_KILL(t->x2, h, TERM_LEN);
-
-    /* Free the input queue */
-    C_KILL(t->key_queue, t->key_size, char);
-    return 0;
-}
-
-/*
  * Initialize a term, using a window of the given size.
  * Also prepare the "input queue" for "k" keypresses
  * By default, the cursor starts out "invisible"
  * By default, we "erase" using "black spaces"
  */
  * Initialize a term, using a window of the given size.
  * Also prepare the "input queue" for "k" keypresses
  * By default, the cursor starts out "invisible"
  * By default, we "erase" using "black spaces"
  */
-errr term_init(term *t, TERM_LEN w, TERM_LEN h, int k)
+errr term_init(term_type *t, TERM_LEN w, TERM_LEN h, int k)
 {
     /* Wipe it */
 {
     /* Wipe it */
-    (void)WIPE(t, term);
+    (void)WIPE(t, term_type);
 
     /* Prepare the input queue */
     t->key_head = t->key_tail = 0;
 
     /* Prepare the input queue */
     t->key_head = t->key_tail = 0;
index 42b1a3e..515b399 100644 (file)
@@ -37,7 +37,8 @@ typedef struct term_win {
 /*!
  * @brief term実装構造体 / An actual "term" structure
  */
 /*!
  * @brief term実装構造体 / An actual "term" structure
  */
-typedef struct term {
+typedef struct term_type term_type;
+typedef struct term_type {
        vptr user; //!< Extra "user" info (used by application)
        vptr data; //!< Extra "data" info (used by implementation)
 
        vptr user; //!< Extra "user" info (used by application)
        vptr data; //!< Extra "data" info (used by implementation)
 
@@ -81,8 +82,8 @@ typedef struct term {
        term_win *tmp; //!< Temporary screen image
        term_win *mem; //!< Memorized screen image
 
        term_win *tmp; //!< Temporary screen image
        term_win *mem; //!< Memorized screen image
 
-       void (*init_hook)(term *t); //!< Hook for init - ing the term
-       void (*nuke_hook)(term *t); //!< Hook for nuke - ing the term
+       void (*init_hook)(term_type *t); //!< Hook for init - ing the term
+       void (*nuke_hook)(term_type *t); //!< Hook for nuke - ing the term
 
        errr (*user_hook)(int n); //!< ユーザ設定項目実装部 / Hook for user actions
        errr (*xtra_hook)(int n, int v); //!< 拡張機能実装部 / Hook for extra actions
 
        errr (*user_hook)(int n); //!< ユーザ設定項目実装部 / Hook for user actions
        errr (*xtra_hook)(int n, int v); //!< 拡張機能実装部 / Hook for extra actions
@@ -92,7 +93,7 @@ typedef struct term {
        errr (*text_hook)(TERM_LEN x, TERM_LEN y, int n, TERM_COLOR a, concptr s); //!< テキスト描画実装部 / Hook for drawing a string of chars using an attr
        void (*resize_hook)(void); //!< 画面リサイズ実装部
        errr (*pict_hook)(TERM_LEN x, TERM_LEN y, int n, const TERM_COLOR *ap, concptr cp, const TERM_COLOR *tap, concptr tcp); //!< タイル描画実装部 / Hook for drawing a sequence of special attr / char pairs
        errr (*text_hook)(TERM_LEN x, TERM_LEN y, int n, TERM_COLOR a, concptr s); //!< テキスト描画実装部 / Hook for drawing a string of chars using an attr
        void (*resize_hook)(void); //!< 画面リサイズ実装部
        errr (*pict_hook)(TERM_LEN x, TERM_LEN y, int n, const TERM_COLOR *ap, concptr cp, const TERM_COLOR *tap, concptr tcp); //!< タイル描画実装部 / Hook for drawing a sequence of special attr / char pairs
-} term;
+} term_type;
 
 /**** Available Constants ****/
 
 
 /**** Available Constants ****/
 
@@ -133,7 +134,7 @@ typedef struct term {
 #define TERM_XTRA_MUSIC_MUTE 18
 
 /**** Available Variables ****/
 #define TERM_XTRA_MUSIC_MUTE 18
 
 /**** Available Variables ****/
-extern term *Term;
+extern term_type *Term;
 
 /**** Available Functions ****/
 extern errr term_user(int n);
 
 /**** Available Functions ****/
 extern errr term_user(int n);
@@ -144,8 +145,6 @@ extern void term_queue_bigchar(TERM_LEN x, TERM_LEN y, TERM_COLOR a, char c, TER
 
 extern void term_queue_line(TERM_LEN x, TERM_LEN y, int n, TERM_COLOR *a, char *c, TERM_COLOR *ta, char *tc);
 
 
 extern void term_queue_line(TERM_LEN x, TERM_LEN y, int n, TERM_COLOR *a, char *c, TERM_COLOR *ta, char *tc);
 
-extern void term_queue_chars(TERM_LEN x, TERM_LEN y, int n, TERM_COLOR a, concptr s);
-
 extern errr term_fresh(void);
 extern errr term_set_cursor(int v);
 extern errr term_gotoxy(TERM_LEN x, TERM_LEN y);
 extern errr term_fresh(void);
 extern errr term_set_cursor(int v);
 extern errr term_gotoxy(TERM_LEN x, TERM_LEN y);
@@ -155,9 +154,6 @@ extern errr term_add_bigch(TERM_COLOR a, char c);
 extern errr term_addstr(int n, TERM_COLOR a, concptr s);
 extern errr term_putch(TERM_LEN x, TERM_LEN y, TERM_COLOR a, char c);
 extern errr term_putstr(TERM_LEN x, TERM_LEN y, int n, TERM_COLOR a, concptr s);
 extern errr term_addstr(int n, TERM_COLOR a, concptr s);
 extern errr term_putch(TERM_LEN x, TERM_LEN y, TERM_COLOR a, char c);
 extern errr term_putstr(TERM_LEN x, TERM_LEN y, int n, TERM_COLOR a, concptr s);
-#ifdef JP
-extern errr term_putstr_v(TERM_LEN x, TERM_LEN y, int n, byte a, concptr s);
-#endif
 extern errr term_erase(TERM_LEN x, TERM_LEN y, int n);
 extern errr term_clear(void);
 extern errr term_redraw(void);
 extern errr term_erase(TERM_LEN x, TERM_LEN y, int n);
 extern errr term_clear(void);
 extern errr term_redraw(void);
@@ -168,7 +164,6 @@ extern errr term_locate(TERM_LEN *x, TERM_LEN *y);
 extern errr term_what(TERM_LEN x, TERM_LEN y, TERM_COLOR *a, char *c);
 
 extern errr term_flush(void);
 extern errr term_what(TERM_LEN x, TERM_LEN y, TERM_COLOR *a, char *c);
 
 extern errr term_flush(void);
-extern errr term_keypress(int k);
 extern errr term_key_push(int k);
 extern errr term_inkey(char *ch, bool wait, bool take);
 
 extern errr term_key_push(int k);
 extern errr term_inkey(char *ch, bool wait, bool take);
 
@@ -177,8 +172,7 @@ extern errr term_load(void);
 
 extern errr term_resize(TERM_LEN w, TERM_LEN h);
 
 
 extern errr term_resize(TERM_LEN w, TERM_LEN h);
 
-extern errr term_activate(term *t);
+extern errr term_activate(term_type *t);
 
 
-extern errr term_nuke(term *t);
-extern errr term_init(term *t, TERM_LEN w, TERM_LEN h, int k);
+extern errr term_init(term_type *t, TERM_LEN w, TERM_LEN h, int k);
 #endif
 #endif
index 07dd855..418bd67 100644 (file)
@@ -172,7 +172,7 @@ static void display_spell_list(player_type *caster_ptr)
 void fix_spell(player_type *player_ptr)
 {
     for (int j = 0; j < 8; j++) {
 void fix_spell(player_type *player_ptr)
 {
     for (int j = 0; j < 8; j++) {
-        term *old = Term;
+        term_type *old = Term;
         if (!angband_term[j])
             continue;
 
         if (!angband_term[j])
             continue;
 
index e8558ee..0a13299 100644 (file)
@@ -40,7 +40,7 @@
 void fix_inventory(player_type *player_ptr, tval_type item_tester_tval)
 {
     for (int j = 0; j < 8; j++) {
 void fix_inventory(player_type *player_ptr, tval_type item_tester_tval)
 {
     for (int j = 0; j < 8; j++) {
-        term *old = Term;
+        term_type *old = Term;
         if (!angband_term[j])
             continue;
 
         if (!angband_term[j])
             continue;
 
@@ -171,7 +171,7 @@ void print_monster_list(floor_type *floor_ptr, TERM_LEN x, TERM_LEN y, TERM_LEN
 void fix_monster_list(player_type *player_ptr)
 {
     for (int j = 0; j < 8; j++) {
 void fix_monster_list(player_type *player_ptr)
 {
     for (int j = 0; j < 8; j++) {
-        term *old = Term;
+        term_type *old = Term;
         if (!angband_term[j])
             continue;
         if (!(window_flag[j] & (PW_MONSTER_LIST)))
         if (!angband_term[j])
             continue;
         if (!(window_flag[j] & (PW_MONSTER_LIST)))
@@ -253,7 +253,7 @@ static void display_equipment(player_type *owner_ptr, tval_type tval)
 void fix_equip(player_type *player_ptr, tval_type item_tester_tval)
 {
     for (int j = 0; j < 8; j++) {
 void fix_equip(player_type *player_ptr, tval_type item_tester_tval)
 {
     for (int j = 0; j < 8; j++) {
-        term *old = Term;
+        term_type *old = Term;
         if (!angband_term[j])
             continue;
         if (!(window_flag[j] & (PW_EQUIP)))
         if (!angband_term[j])
             continue;
         if (!(window_flag[j] & (PW_EQUIP)))
@@ -275,7 +275,7 @@ void fix_equip(player_type *player_ptr, tval_type item_tester_tval)
 void fix_player(player_type *player_ptr)
 {
     for (int j = 0; j < 8; j++) {
 void fix_player(player_type *player_ptr)
 {
     for (int j = 0; j < 8; j++) {
-        term *old = Term;
+        term_type *old = Term;
         if (!angband_term[j])
             continue;
 
         if (!angband_term[j])
             continue;
 
@@ -299,7 +299,7 @@ void fix_player(player_type *player_ptr)
 void fix_message(void)
 {
     for (int j = 0; j < 8; j++) {
 void fix_message(void)
 {
     for (int j = 0; j < 8; j++) {
-        term *old = Term;
+        term_type *old = Term;
         if (!angband_term[j])
             continue;
 
         if (!angband_term[j])
             continue;
 
@@ -333,7 +333,7 @@ void fix_message(void)
 void fix_overhead(player_type *player_ptr)
 {
     for (int j = 0; j < 8; j++) {
 void fix_overhead(player_type *player_ptr)
 {
     for (int j = 0; j < 8; j++) {
-        term *old = Term;
+        term_type *old = Term;
         TERM_LEN wid, hgt;
         if (!angband_term[j])
             continue;
         TERM_LEN wid, hgt;
         if (!angband_term[j])
             continue;
@@ -395,7 +395,7 @@ static void display_dungeon(player_type *player_ptr)
 void fix_dungeon(player_type *player_ptr)
 {
     for (int j = 0; j < 8; j++) {
 void fix_dungeon(player_type *player_ptr)
 {
     for (int j = 0; j < 8; j++) {
-        term *old = Term;
+        term_type *old = Term;
         if (!angband_term[j])
             continue;
 
         if (!angband_term[j])
             continue;
 
@@ -418,7 +418,7 @@ void fix_dungeon(player_type *player_ptr)
 void fix_monster(player_type *player_ptr)
 {
     for (int j = 0; j < 8; j++) {
 void fix_monster(player_type *player_ptr)
 {
     for (int j = 0; j < 8; j++) {
-        term *old = Term;
+        term_type *old = Term;
         if (!angband_term[j])
             continue;
 
         if (!angband_term[j])
             continue;
 
@@ -443,7 +443,7 @@ void fix_monster(player_type *player_ptr)
 void fix_object(player_type *player_ptr)
 {
     for (int j = 0; j < 8; j++) {
 void fix_object(player_type *player_ptr)
 {
     for (int j = 0; j < 8; j++) {
-        term *old = Term;
+        term_type *old = Term;
         if (!angband_term[j])
             continue;
 
         if (!angband_term[j])
             continue;