OSDN Git Service

[Refactor] #37353 コメント整理。 / Refactor comments.
[hengband/hengband.git] / src / z-term.c
index 87dfa80..76a167e 100644 (file)
@@ -444,7 +444,6 @@ static errr Term_curs_hack(TERM_LEN x, TERM_LEN y)
        (void)x;
        (void)y;
 
-       /* Oops */
        return (-1);
 }
 
@@ -466,14 +465,13 @@ static errr Term_wipe_hack(TERM_LEN x, TERM_LEN y, int n)
        (void)y;
        (void)n;
 
-       /* Oops */
        return (-1);
 }
 
 /*
  * Hack -- fake hook for "Term_text()" (see above)
  */
-static errr Term_text_hack(TERM_LEN x, TERM_LEN y, int n, TERM_COLOR a, cptr cp)
+static errr Term_text_hack(TERM_LEN x, TERM_LEN y, int n, TERM_COLOR a, concptr cp)
 {
        /* Unused */
        (void)x;
@@ -482,14 +480,13 @@ static errr Term_text_hack(TERM_LEN x, TERM_LEN y, int n, TERM_COLOR a, cptr cp)
        (void)a;
        (void)cp;
 
-       /* Oops */
        return (-1);
 }
 
 /*
  * Hack -- fake hook for "Term_pict()" (see above)
  */
-static errr Term_pict_hack(TERM_LEN x, TERM_LEN y, int n, const TERM_COLOR *ap, cptr cp, const TERM_COLOR *tap, cptr tcp)
+static errr Term_pict_hack(TERM_LEN x, TERM_LEN y, int n, const TERM_COLOR *ap, concptr cp, const TERM_COLOR *tap, concptr tcp)
 {
        /* Unused */
        (void)x;
@@ -500,7 +497,6 @@ static errr Term_pict_hack(TERM_LEN x, TERM_LEN y, int n, const TERM_COLOR *ap,
        (void)tap;
        (void)tcp;
 
-       /* Oops */
        return (-1);
 }
 
@@ -711,7 +707,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.
  */
-void Term_queue_chars(TERM_LEN x, TERM_LEN y, int n, TERM_COLOR a, cptr s)
+void Term_queue_chars(TERM_LEN x, TERM_LEN y, int n, TERM_COLOR a, concptr s)
 {
        TERM_LEN x1 = -1, x2 = -1;
 
@@ -1472,7 +1468,7 @@ static void Term_fresh_row_text(TERM_LEN y, TERM_LEN x1, TERM_LEN x2)
  * On systems with a "soft" cursor, we must explicitly erase the cursor
  * before flushing the output, if needed, to prevent a "jumpy" refresh.
  * The actual method for this is horrible, but there is very little that
- * we can do to simplify it efficiently.  XXX XXX XXX
+ * we can do to simplify it efficiently.  
  *
  * On systems with a "hard" cursor, we will "hide" the cursor before
  * flushing the output, if needed, to avoid a "flickery" refresh.  It
@@ -1948,7 +1944,7 @@ errr Term_add_bigch(TERM_COLOR a, char c)
  * positive value, future calls to either function will
  * return negative ones.
  */
-errr Term_addstr(int n, TERM_COLOR a, cptr s)
+errr Term_addstr(int n, TERM_COLOR a, concptr s)
 {
        int k;
        TERM_LEN w = Term->wid;
@@ -2001,7 +1997,7 @@ errr Term_putch(TERM_LEN x, TERM_LEN y, TERM_COLOR a, char c)
 /*
  * Move to a location and, using an attr, add a string
  */
-errr Term_putstr(TERM_LEN x, TERM_LEN y, int n, TERM_COLOR a, cptr s)
+errr Term_putstr(TERM_LEN x, TERM_LEN y, int n, TERM_COLOR a, concptr s)
 {
        errr res;
 
@@ -2019,7 +2015,7 @@ errr Term_putstr(TERM_LEN x, TERM_LEN y, int n, TERM_COLOR a, cptr s)
 /*
  * 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, cptr s)
+errr Term_putstr_v(TERM_LEN x, TERM_LEN y, int n, byte a, concptr s)
 {
        errr res;
        int i;
@@ -2329,7 +2325,7 @@ errr Term_get_size(TERM_LEN *w, TERM_LEN *h)
 /*
  * Extract the current cursor location
  */
-errr Term_locate(int *x, int *y)
+errr Term_locate(TERM_LEN *x, TERM_LEN *y)
 {
        /* Access the cursor */
        (*x) = Term->scr->cx;
@@ -2431,11 +2427,6 @@ errr Term_key_push(int k)
        /* Success (unless overflow) */
        if (Term->key_head != Term->key_tail) return (0);
 
-#if 0
-       /* Hack -- Forget the oldest key */
-       if (++Term->key_tail == Term->key_size) Term->key_tail = 0;
-#endif
-
        /* Problem */
        return (1);
 }
@@ -2517,8 +2508,8 @@ errr Term_inkey(char *ch, bool wait, bool take)
  */
 errr Term_save(void)
 {
-       int w = Term->wid;
-       int h = Term->hgt;
+       TERM_LEN w = Term->wid;
+       TERM_LEN h = Term->hgt;
 
        /* Create */
        if (!Term->mem)
@@ -2587,8 +2578,8 @@ errr Term_exchange(void)
 {
        TERM_LEN y;
 
-       int w = Term->wid;
-       int h = Term->hgt;
+       TERM_LEN w = Term->wid;
+       TERM_LEN h = Term->hgt;
 
        term_win *exchanger;
 
@@ -2777,8 +2768,8 @@ errr Term_resize(TERM_LEN w, TERM_LEN h)
        }
 
        /* Save new size */
-       Term->wid = (byte_hack)w;
-       Term->hgt = (byte_hack)h;
+       Term->wid = w;
+       Term->hgt = h;
 
        /* Force "total erase" */
        Term->total_erase = TRUE;
@@ -2854,8 +2845,8 @@ errr Term_activate(term *t)
  */
 errr term_nuke(term *t)
 {
-       int w = t->wid;
-       int h = t->hgt;
+       TERM_LEN w = t->wid;
+       TERM_LEN h = t->hgt;
 
 
        /* Hack -- Call the special "nuke" hook */
@@ -2922,7 +2913,7 @@ errr term_nuke(term *t)
  * By default, the cursor starts out "invisible"
  * By default, we "erase" using "black spaces"
  */
-errr term_init(term *t, int w, int h, int k)
+errr term_init(term *t, TERM_LEN w, TERM_LEN h, int k)
 {
        TERM_LEN y;
 
@@ -2942,8 +2933,8 @@ errr term_init(term *t, int w, int h, int k)
 
 
        /* Save the size */
-       t->wid = (byte_hack)w;
-       t->hgt = (byte_hack)h;
+       t->wid = w;
+       t->hgt = h;
 
        /* Allocate change arrays */
        C_MAKE(t->x1, h, TERM_LEN);