OSDN Git Service

[Fix] #41061 clangで報告された以下2種の警告に対応. / Two troublesome warnings from clang.
authordeskull <deskull@users.sourceforge.jp>
Wed, 6 Jan 2021 23:24:14 +0000 (08:24 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Wed, 6 Jan 2021 23:24:14 +0000 (08:24 +0900)
 * wild.c の is_winner の判定処理が常に TRUE になる。
 * within_char_util() の引数型が u16b のため同関数中で負数を扱う判定が常に TRUE になる。

src/floor/wild.c
src/target/target-describer.c

index 87fc4f1..0611c4f 100644 (file)
@@ -353,7 +353,7 @@ static void generate_area(player_type *player_ptr, POSITION y, POSITION x, bool
     }
 
     bool is_winner = wilderness[y][x].entrance > 0;
-    is_winner &= !wilderness[y][x].town != 0;
+    is_winner &= (!wilderness[y][x].town != 0);
     bool is_wild_winner = (d_info[wilderness[y][x].entrance].flags1 & DF1_WINNER) == 0;
     is_winner &= ((current_world_ptr->total_winner != 0) || is_wild_winner);
     if (!is_winner)
index 4d08dfd..3dfaf9a 100644 (file)
@@ -259,7 +259,7 @@ static u16b describe_monster_item(player_type *subject_ptr, eg_type *eg_ptr)
     return CONTINUOUS_DESCRIPTION;
 }
 
-static bool within_char_util(u16b input) { return (input > -127) && (input < 128); }
+static bool within_char_util(s16b input) { return (input > -127) && (input < 128); }
 
 static s16b describe_grid(player_type *subject_ptr, eg_type *eg_ptr)
 {