From 9e39f3f130adf821d9b22fa497ca17766cffa155 Mon Sep 17 00:00:00 2001 From: Deskull Date: Mon, 10 Dec 2018 18:41:24 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#37353=20=E5=9E=8B=E3=81=AE?= =?utf8?q?=E7=BD=AE=E6=8F=9B=E3=80=82=20/=20Type=20replacement.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/autopick.c | 24 ++++++++++++------------ src/main-win.c | 2 +- src/save.c | 11 +++-------- src/spells3.c | 10 +++++----- src/util.c | 2 -- 5 files changed, 21 insertions(+), 28 deletions(-) diff --git a/src/autopick.c b/src/autopick.c index 0b2360a92..f45c94915 100644 --- a/src/autopick.c +++ b/src/autopick.c @@ -19,27 +19,27 @@ /* * Macros for Keywords */ -#define FLG_ALL 0 -#define FLG_UNAWARE 1 -#define FLG_UNIDENTIFIED 2 -#define FLG_IDENTIFIED 3 -#define FLG_STAR_IDENTIFIED 4 -#define FLG_COLLECTING 5 -#define FLG_ARTIFACT 6 +#define FLG_ALL 0 +#define FLG_UNAWARE 1 +#define FLG_UNIDENTIFIED 2 +#define FLG_IDENTIFIED 3 +#define FLG_STAR_IDENTIFIED 4 +#define FLG_COLLECTING 5 +#define FLG_ARTIFACT 6 #define FLG_EGO 7 #define FLG_GOOD 10 -#define FLG_NAMELESS 11 +#define FLG_NAMELESS 11 #define FLG_AVERAGE 12 -#define FLG_WORTHLESS 13 +#define FLG_WORTHLESS 13 #define FLG_RARE 14 #define FLG_COMMON 15 #define FLG_BOOSTED 16 -#define FLG_MORE_DICE 17 -#define FLG_MORE_BONUS 18 +#define FLG_MORE_DICE 17 +#define FLG_MORE_BONUS 18 #define FLG_WANTED 19 #define FLG_UNIQUE 20 #define FLG_HUMAN 21 -#define FLG_UNREADABLE 22 +#define FLG_UNREADABLE 22 #define FLG_REALM1 23 #define FLG_REALM2 24 #define FLG_FIRST 25 diff --git a/src/main-win.c b/src/main-win.c index a604d671d..099722bd3 100644 --- a/src/main-win.c +++ b/src/main-win.c @@ -5594,7 +5594,7 @@ int FAR PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, HDC hdc; MSG msg; - setlocale( LC_ALL, "ja_JP" ); + setlocale(LC_ALL, "ja_JP.utf8"); /* Unused */ (void)nCmdShow; diff --git a/src/save.c b/src/save.c index ce028f1b6..2fb2438e4 100644 --- a/src/save.c +++ b/src/save.c @@ -1559,21 +1559,16 @@ static bool wr_savefile_new(void) */ static bool save_player_aux(char *name) { - bool ok = FALSE; - - int fd = -1; - - int mode = 0644; - + bool ok = FALSE; + int fd = -1; + int mode = 0644; /* No file yet */ fff = NULL; - /* File type is "SAVE" */ FILE_TYPE(FILE_TYPE_SAVE); - /* Grab permissions */ safe_setuid_grab(); diff --git a/src/spells3.c b/src/spells3.c index b57db376d..96c5a756c 100644 --- a/src/spells3.c +++ b/src/spells3.c @@ -515,10 +515,10 @@ void teleport_player_to(POSITION ny, POSITION nx, BIT_FLAGS mode) void teleport_away_followable(MONSTER_IDX m_idx) { monster_type *m_ptr = &m_list[m_idx]; - int oldfy = m_ptr->fy; - int oldfx = m_ptr->fx; - bool old_ml = m_ptr->ml; - int old_cdis = m_ptr->cdis; + POSITION oldfy = m_ptr->fy; + POSITION oldfx = m_ptr->fx; + bool old_ml = m_ptr->ml; + POSITION old_cdis = m_ptr->cdis; teleport_away(m_idx, MAX_SIGHT * 2 + 5, 0L); @@ -531,7 +531,7 @@ void teleport_away_followable(MONSTER_IDX m_idx) { BIT_FLAGS flgs[TR_FLAG_SIZE]; object_type *o_ptr; - int i; + INVENTORY_IDX i; for (i = INVEN_RARM; i < INVEN_TOTAL; i++) { diff --git a/src/util.c b/src/util.c index e1972e37f..9dce76a09 100644 --- a/src/util.c +++ b/src/util.c @@ -663,7 +663,6 @@ errr fd_copy(cptr file, cptr what) return (0); } - /* * Hack -- attempt to open a file descriptor (create file) * This function should fail if the file already exists @@ -691,7 +690,6 @@ int fd_make(cptr file, BIT_FLAGS mode) return (open(buf, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, mode)); #endif - } -- 2.11.0