From bf377b066af0930e7c14bead6494424ba90b30f9 Mon Sep 17 00:00:00 2001 From: Habu Date: Wed, 17 Mar 2021 19:35:54 +0900 Subject: [PATCH] =?utf8?q?[refactor]=20gcc=E3=81=AE=E8=AD=A6=E5=91=8A?= =?utf8?q?=E5=AF=BE=E7=AD=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit -Wsign-compare、-Wunused-parameter、-Wunused-functionに 対する対策を入れる。 --- src/cmd-building/cmd-inn.cpp | 2 ++ src/io/uid-checker.cpp | 2 ++ src/maid-x11.cpp | 4 ++-- src/player/player-status.cpp | 2 +- src/window/display-sub-windows.cpp | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/cmd-building/cmd-inn.cpp b/src/cmd-building/cmd-inn.cpp index af9101435..3ad857520 100644 --- a/src/cmd-building/cmd-inn.cpp +++ b/src/cmd-building/cmd-inn.cpp @@ -49,6 +49,7 @@ static bool is_healthy_stay(player_type *customer_ptr) } +#ifdef JP static bool is_player_undead(player_type *customer_ptr) { bool is_player_undead = is_specific_player_race(customer_ptr, RACE_SKELETON) || @@ -57,6 +58,7 @@ static bool is_player_undead(player_type *customer_ptr) is_specific_player_race(customer_ptr, RACE_SPECTRE); return is_player_undead; } +#endif /*! diff --git a/src/io/uid-checker.cpp b/src/io/uid-checker.cpp index f0b775feb..5dc48e67b 100644 --- a/src/io/uid-checker.cpp +++ b/src/io/uid-checker.cpp @@ -50,6 +50,8 @@ void safe_setuid_grab(player_type *player_ptr) quit(_("setgid(): 正しく許可が取れません!", "setgid(): cannot set permissions correctly!")); } #else + (void)player_ptr; + if (setreuid(geteuid(), getuid()) != 0) { quit(_("setreuid(): 正しく許可が取れません!", "setreuid(): cannot set permissions correctly!")); } diff --git a/src/maid-x11.cpp b/src/maid-x11.cpp index 0251972d5..c5ec734d7 100644 --- a/src/maid-x11.cpp +++ b/src/maid-x11.cpp @@ -318,11 +318,11 @@ static XImage *ReadBMP(Display *dpy, char *Name) return (NULL); } - for (y = 0; y < infoheader.biHeight; y++) + for (y = 0; y < static_cast(infoheader.biHeight); y++) { int y2 = infoheader.biHeight - y - 1; - for (x = 0; x < infoheader.biWidth; x++) + for (x = 0; x < static_cast(infoheader.biWidth); x++) { int ch = getc(f); diff --git a/src/player/player-status.cpp b/src/player/player-status.cpp index 48dec0c09..c1c315bd8 100644 --- a/src/player/player-status.cpp +++ b/src/player/player-status.cpp @@ -1951,7 +1951,7 @@ s16b calc_double_weapon_penalty(player_type *creature_ptr, INVENTORY_IDX slot) penalty = penalty / 2 - 5; } - for (int i = FLAG_CAUSE_INVEN_MAIN_HAND; i < FLAG_CAUSE_MAX; i <<= 1) + for (unsigned int i = FLAG_CAUSE_INVEN_MAIN_HAND; i < FLAG_CAUSE_MAX; i <<= 1) if (penalty > 0 && any_bits(creature_ptr->easy_2weapon, i)) penalty /= 2; diff --git a/src/window/display-sub-windows.cpp b/src/window/display-sub-windows.cpp index 51330d479..2bea763a5 100644 --- a/src/window/display-sub-windows.cpp +++ b/src/window/display-sub-windows.cpp @@ -129,7 +129,7 @@ void print_monster_list(floor_type *floor_ptr, const std::vector &m TERM_LEN line = y; monster_type *last_mons = NULL; int n_same = 0; - int i; + size_t i; for (i = 0; i < monster_list.size(); i++) { auto m_ptr = &floor_ptr->m_list[monster_list[i]]; if (is_pet(m_ptr)) -- 2.11.0