OSDN Git Service

[Refactor] #37287 #37353 型の置換。 / Type replacement.
authorDeskull <deskull@users.sourceforge.jp>
Wed, 14 Nov 2018 15:56:50 +0000 (00:56 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Wed, 14 Nov 2018 15:56:50 +0000 (00:56 +0900)
src/z-term.c
src/z-term.h

index 032cbde..87dfa80 100644 (file)
@@ -2629,14 +2629,14 @@ errr Term_exchange(void)
 /*
  * React to a new physical window size.
  */
-errr Term_resize(int w, int h)
+errr Term_resize(TERM_LEN w, TERM_LEN h)
 {
        int i;
 
-       int wid, hgt;
+       TERM_LEN wid, hgt;
 
-       byte *hold_x1;
-       byte *hold_x2;
+       TERM_LEN *hold_x1;
+       TERM_LEN *hold_x2;
 
        term_win *hold_old;
        term_win *hold_scr;
@@ -2677,8 +2677,8 @@ errr Term_resize(int w, int h)
        hold_tmp = Term->tmp;
 
        /* Create new scanners */
-       C_MAKE(Term->x1, h, byte);
-       C_MAKE(Term->x2, h, byte);
+       C_MAKE(Term->x1, h, TERM_LEN);
+       C_MAKE(Term->x2, h, TERM_LEN);
 
        /* Create new window */
        MAKE(Term->old, term_win);
@@ -2725,8 +2725,8 @@ errr Term_resize(int w, int h)
        }
 
        /* Free some arrays */
-       C_KILL(hold_x1, Term->hgt, byte);
-       C_KILL(hold_x2, Term->hgt, byte);
+       C_KILL(hold_x1, Term->hgt, TERM_LEN);
+       C_KILL(hold_x2, Term->hgt, TERM_LEN);
 
        /* Nuke */
        term_win_nuke(hold_old, Term->wid, Term->hgt);
@@ -2905,8 +2905,8 @@ errr term_nuke(term *t)
        }
 
        /* Free some arrays */
-       C_KILL(t->x1, h, byte);
-       C_KILL(t->x2, h, byte);
+       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);
@@ -2946,8 +2946,8 @@ errr term_init(term *t, int w, int h, int k)
        t->hgt = (byte_hack)h;
 
        /* Allocate change arrays */
-       C_MAKE(t->x1, h, byte);
-       C_MAKE(t->x2, h, byte);
+       C_MAKE(t->x1, h, TERM_LEN);
+       C_MAKE(t->x2, h, TERM_LEN);
 
 
        /* Allocate "displayed" */
index 33eee40..f9c30a6 100644 (file)
 
 #include "h-basic.h"
 
-
-/*
- * A term_win is a "window" for a Term
- *
- *     - Cursor Useless/Visible codes
- *     - Cursor Location (see "Useless")
- *
- *     - Array[h] -- Access to the attribute array
- *     - Array[h] -- Access to the character array
- *
- *     - Array[h*w] -- Attribute array
- *     - Array[h*w] -- Character array
- *
- * Note that the attr/char pair at (x,y) is a[y][x]/c[y][x]
- * and that the row of attr/chars at (0,y) is a[y]/c[y]
- */
-
 typedef struct term_win term_win;
-
-struct term_win
+ /*!
+ * @brief A term_win is a "window" for a Term
+ */
+ struct term_win
 {
-       bool cu, cv;
-       byte cx, cy;
+       bool cu, cv; //!< Cursor Useless / Visible codes
+       byte cx, cy; //!< Cursor Location (see "Useless")
 
-       TERM_COLOR **a;
-       char **c;
+       TERM_COLOR **a; //!< Array[h*w] -- Attribute array 
+       char **c; //!< Array[h*w] -- Character array
 
-       TERM_COLOR *va;
-       char *vc;
+       TERM_COLOR *va; //!< Array[h] -- Access to the attribute array
+       char *vc; //!< Array[h] -- Access to the character array
 
-       TERM_COLOR **ta;
-       char **tc;
+       TERM_COLOR **ta; //!< Note that the attr pair at(x, y) is a[y][x]
+       char **tc; //!< Note that the char pair at(x, y) is c[y][x]
 
-       TERM_COLOR *vta;
-       char *vtc;
+       TERM_COLOR *vta; //!< Note that the row of attr at(0, y) is a[y]
+       char *vtc;  //!< Note that the row of chars at(0, y) is c[y]
 };