• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revision506efad7da07b585530a6b0a81b82bb6436d7b14 (tree)
Time2019-02-20 12:31:26
AuthorDeskull <deskull@user...>
CommiterDeskull

Log Message

[Refactor] #37353 dd_* の型の置換。 / Type replacement dd_*.

Change Summary

Incremental Difference

--- a/src/cmd4.c
+++ b/src/cmd4.c
@@ -6168,7 +6168,7 @@ static void browser_cursor(char ch, int *column, IDX *grp_cur, int grp_cnt,
61686168 int old_grp = grp;
61696169
61706170 /* Move up or down */
6171- grp += ddy[d];
6171+ grp += (IDX)ddy[d];
61726172
61736173 /* Verify */
61746174 if (grp >= grp_cnt) grp = grp_cnt - 1;
@@ -6180,7 +6180,7 @@ static void browser_cursor(char ch, int *column, IDX *grp_cur, int grp_cnt,
61806180 else
61816181 {
61826182 /* Move up or down */
6183- list += ddy[d];
6183+ list += (IDX)ddy[d];
61846184
61856185 /* Verify */
61866186 if (list >= list_cnt) list = list_cnt - 1;
@@ -6380,8 +6380,8 @@ static bool visual_mode_command(char ch, bool *visual_list_ptr,
63806380 if ((a == 0x7f) && (ddy[d] > 0)) d = 0;
63816381 if ((c == 0xff) && (ddx[d] > 0)) d = 0;
63826382
6383- a += ddy[d];
6384- c += ddx[d];
6383+ a += (TERM_COLOR)ddy[d];
6384+ c += (SYMBOL_CODE)ddx[d];
63856385
63866386 /* Force correct code for both ASCII character and tile */
63876387 if (c & 0x80) a |= 0x80;
--- a/src/externs.h
+++ b/src/externs.h
@@ -34,14 +34,14 @@ extern int max_max_autopick;
3434 extern autopick_type *autopick_list;
3535
3636 /* tables.c */
37-extern const s16b ddd[9];
38-extern const s16b ddx[10];
39-extern const s16b ddy[10];
40-extern const s16b ddx_ddd[9];
41-extern const s16b ddy_ddd[9];
42-extern const s16b cdd[8];
43-extern const s16b ddx_cdd[8];
44-extern const s16b ddy_cdd[8];
37+extern const POSITION ddd[9];
38+extern const POSITION ddx[10];
39+extern const POSITION ddy[10];
40+extern const POSITION ddx_ddd[9];
41+extern const POSITION ddy_ddd[9];
42+extern const POSITION cdd[8];
43+extern const POSITION ddx_cdd[8];
44+extern const POSITION ddy_cdd[8];
4545 extern const char hexsym[16];
4646 extern const char listsym[];
4747 extern const concptr color_char;
--- a/src/tables.c
+++ b/src/tables.c
@@ -17,50 +17,50 @@
1717 /*!
1818 * キーパッドの方向を南から反時計回り順に列挙 / Global array for looping through the "keypad directions"
1919 */
20-const s16b ddd[9] =
20+const POSITION ddd[9] =
2121 { 2, 8, 6, 4, 3, 1, 9, 7, 5 };
2222
2323 /*!
2424 * dddで定義した順にベクトルのX軸成分を定義 / Global arrays for converting "keypad direction" into offsets
2525 */
26-const s16b ddx[10] =
26+const POSITION ddx[10] =
2727 { 0, -1, 0, 1, -1, 0, 1, -1, 0, 1 };
2828
2929 /*!
3030 * dddで定義した順にベクトルのY軸成分を定義 / Global arrays for converting "keypad direction" into offsets
3131 */
32-const s16b ddy[10] =
32+const POSITION ddy[10] =
3333 { 0, 1, 1, 1, 0, 0, 0, -1, -1, -1 };
3434
3535 /*!
3636 * ddd越しにベクトルのX軸成分を定義 / Global arrays for optimizing "ddx[ddd[i]]" and "ddy[ddd[i]]"
3737 */
38-const s16b ddx_ddd[9] =
38+const POSITION ddx_ddd[9] =
3939 { 0, 0, 1, -1, 1, -1, 1, -1, 0 };
4040
4141 /*!
4242 * ddd越しにベクトルのY軸成分を定義 / Global arrays for optimizing "ddx[ddd[i]]" and "ddy[ddd[i]]"
4343 */
44-const s16b ddy_ddd[9] =
44+const POSITION ddy_ddd[9] =
4545 { 1, -1, 0, 0, 1, 1, -1, -1, 0 };
4646
4747
4848 /*!
4949 * キーパッドの円環状方向配列 / Circular keypad direction array
5050 */
51-const s16b cdd[8] =
51+const POSITION cdd[8] =
5252 { 2, 3, 6, 9, 8, 7, 4, 1 };
5353
5454 /*!
5555 * cdd越しにベクトルのX軸成分を定義 / Global arrays for optimizing "ddx[cdd[i]]" and "ddy[cdd[i]]"
5656 */
57-const s16b ddx_cdd[8] =
57+const POSITION ddx_cdd[8] =
5858 { 0, 1, 1, 1, 0, -1, -1, -1 };
5959
6060 /*!
6161 * cdd越しにベクトルのY軸成分を定義 / Global arrays for optimizing "ddx[cdd[i]]" and "ddy[cdd[i]]"
6262 */
63-const s16b ddy_cdd[8] =
63+const POSITION ddy_cdd[8] =
6464 { 1, 1, 0, -1, -1, -1, 0, 1 };
6565
6666
Show on old repository browser