OSDN Git Service

#37287 #37353 (2.2.0.89) 型の置換を継続中。 / Ongoing type replacement.
authorDeskull <desull@users.sourceforge.jp>
Fri, 27 Oct 2017 08:09:12 +0000 (17:09 +0900)
committerDeskull <desull@users.sourceforge.jp>
Fri, 27 Oct 2017 08:09:12 +0000 (17:09 +0900)
src/cmd4.c
src/dungeon.c
src/externs.h
src/object1.c
src/spells1.c
src/util.c

index 09b18f6..5975865 100644 (file)
@@ -8059,11 +8059,11 @@ static void do_cmd_knowledge_quests_current(FILE *fff)
                                                {
 #ifdef JP
                                                        sprintf(note," - %d 体の%sを倒す。(あと %d 体)",
-                                                               quest[i].max_num, name, quest[i].max_num - quest[i].cur_num);
+                                                               (int)quest[i].max_num, name, (int)(quest[i].max_num - quest[i].cur_num));
 #else
                                                        plural_aux(name);
                                                        sprintf(note," - kill %d %s, have killed %d.",
-                                                               quest[i].max_num, name, quest[i].cur_num);
+                                                               (int)quest[i].max_num, name, (int)quest[i].cur_num);
 #endif
                                                }
                                                else
@@ -8091,10 +8091,10 @@ static void do_cmd_knowledge_quests_current(FILE *fff)
                                        case QUEST_TYPE_KILL_NUMBER:
 #ifdef JP
                                                sprintf(note," - %d 体のモンスターを倒す。(あと %d 体)",
-                                                       quest[i].max_num, quest[i].max_num - quest[i].cur_num);
+                                                       (int)quest[i].max_num, (int)(quest[i].max_num - quest[i].cur_num));
 #else
                                                sprintf(note," - Kill %d monsters, have killed %d.",
-                                                       quest[i].max_num, quest[i].cur_num);
+                                                       (int)quest[i].max_num, (int)quest[i].cur_num);
 #endif
                                                break;
 
index a8df69c..cf500e7 100644 (file)
@@ -6017,7 +6017,8 @@ void extract_option_vars(void)
  */
 void determine_bounty_uniques(void)
 {
-       int          i, j, tmp;
+       int i, j;
+       MONRACE_IDX tmp;
        monster_race *r_ptr;
 
        get_mon_num_prep(NULL, NULL);
index 9fa1965..524b881 100644 (file)
@@ -1091,11 +1091,11 @@ extern bool save_floor(saved_floor_type *sf_ptr, u32b mode);
 
 /* spells1.c */
 extern bool in_disintegration_range(POSITION y1, POSITION x1, POSITION y2, POSITION x2);
-extern void breath_shape(u16b *path_g, int dist, int *pgrids, POSITION *gx, POSITION *gy, POSITION *gm, int *pgm_rad, POSITION rad, POSITION y1, POSITION x1, POSITION y2, POSITION x2, int typ);
+extern void breath_shape(u16b *path_g, int dist, int *pgrids, POSITION *gx, POSITION *gy, POSITION *gm, POSITION *pgm_rad, POSITION rad, POSITION y1, POSITION x1, POSITION y2, POSITION x2, int typ);
 extern int take_hit(int damage_type, HIT_POINT damage, cptr kb_str, int monspell);
 extern u16b bolt_pict(POSITION y, POSITION x, POSITION ny, POSITION nx, int typ);
 extern sint project_path(u16b *gp, POSITION range, POSITION y1, POSITION x1, POSITION y2, POSITION x2, int flg);
-extern int dist_to_line(int y, int x, int y1, int x1, int y2, int x2);
+extern POSITION dist_to_line(POSITION y, POSITION x, POSITION y1, POSITION x1, POSITION y2, POSITION x2);
 extern bool project(MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, HIT_POINT dam, int typ, int flg, int monspell);
 extern int project_length;
 extern bool binding_field(HIT_POINT dam);
@@ -1684,7 +1684,7 @@ extern bool do_cmd_disarm_aux(int y, int x, int dir);
 
 /* object1.c */
 extern int scan_floor(int *items, int y, int x, int mode);
-extern int show_floor(int target_item, int y, int x, int *min_width);
+extern COMMAND_CODE show_floor(int target_item, int y, int x, int *min_width);
 extern bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, int mode);
 extern void py_pickup_floor(bool pickup);
 
index b091758..d64a03d 100644 (file)
@@ -2144,7 +2144,8 @@ static void prepare_label_string_floor(char *label, int floor_list[], int floor_
  */
 COMMAND_CODE show_inven(int target_item)
 {
-       int             i, j, k, l, z = 0;
+       COMMAND_CODE i;
+       int j, k, l, z = 0;
        int             col, cur_col, len;
        object_type     *o_ptr;
        char            o_name[MAX_NLEN];
@@ -2152,8 +2153,8 @@ COMMAND_CODE show_inven(int target_item)
        int             out_index[23];
        byte            out_color[23];
        char            out_desc[23][MAX_NLEN];
-       int             target_item_label = 0;
-       int             wid, hgt;
+       COMMAND_CODE target_item_label = 0;
+       TERM_POSITION wid, hgt;
        char            inven_label[52 + 1];
 
        /* Starting column */
@@ -2310,7 +2311,8 @@ COMMAND_CODE show_inven(int target_item)
  */
 COMMAND_CODE show_equip(int target_item)
 {
-       int             i, j, k, l;
+       COMMAND_CODE i;
+       int j, k, l;
        int             col, cur_col, len;
        object_type     *o_ptr;
        char            tmp_val[80];
@@ -2318,8 +2320,8 @@ COMMAND_CODE show_equip(int target_item)
        int             out_index[23];
        byte            out_color[23];
        char            out_desc[23][MAX_NLEN];
-       int             target_item_label = 0;
-       int             wid, hgt;
+       COMMAND_CODE target_item_label = 0;
+       TERM_POSITION wid, hgt;
        char            equip_label[52 + 1];
 
        /* Starting column */
@@ -3624,10 +3626,10 @@ int scan_floor(int *items, int y, int x, int mode)
  * @param y 走査するフロアのY座標
  * @param x 走査するフロアのX座標
  * @param min_width 表示の長さ
- * @return 選択したアイテムのID
+ * @return 選択したアイテムの添え字
  * @details
  */
-int show_floor(int target_item, int y, int x, int *min_width)
+COMMAND_CODE show_floor(int target_item, int y, int x, int *min_width)
 {
        int i, j, k, l;
        int col, len;
@@ -3641,7 +3643,7 @@ int show_floor(int target_item, int y, int x, int *min_width)
        int out_index[23];
        byte out_color[23];
        char out_desc[23][MAX_NLEN];
-       int target_item_label = 0;
+       COMMAND_CODE target_item_label = 0;
 
        int floor_list[23], floor_num;
        int wid, hgt;
@@ -4988,11 +4990,11 @@ bool get_item_floor(COMMAND_CODE *cp, cptr pmt, cptr str, int mode)
  */
 static bool py_pickup_floor_aux(void)
 {
-       s16b this_o_idx;
+       OBJECT_IDX this_o_idx;
 
        cptr q, s;
 
-       int item;
+       OBJECT_IDX item;
 
        /* Restrict the choices */
        item_tester_hook = inven_carry_okay;
index 737f34c..ecb26b2 100644 (file)
@@ -6288,27 +6288,27 @@ static bool project_p(int who, cptr who_name, int r, POSITION y, POSITION x, HIT
 /*
  * Find the distance from (x, y) to a line.
  */
-int dist_to_line(int y, int x, int y1, int x1, int y2, int x2)
+POSITION dist_to_line(POSITION y, POSITION x, POSITION y1, POSITION x1, POSITION y2, POSITION x2)
 {
        /* Vector from (x, y) to (x1, y1) */
-       int py = y1 - y;
-       int px = x1 - x;
+       POSITION py = y1 - y;
+       POSITION px = x1 - x;
 
        /* Normal vector */
-       int ny = x2 - x1;
-       int nx = y1 - y2;
+       POSITION ny = x2 - x1;
+       POSITION nx = y1 - y2;
 
-   /* Length of N */
-       int pd = distance(y1, x1, y, x);
-       int nd = distance(y1, x1, y2, x2);
+       /* Length of N */
+       POSITION pd = distance(y1, x1, y, x);
+       POSITION nd = distance(y1, x1, y2, x2);
 
        if (pd > nd) return distance(y, x, y2, x2);
 
        /* Component of P on N */
        nd = ((nd) ? ((py * ny + px * nx) / nd) : 0);
 
-   /* Absolute value */
-   return((nd >= 0) ? nd : 0 - nd);
+       /* Absolute value */
+       return((nd >= 0) ? nd : 0 - nd);
 }
 
 
@@ -6544,7 +6544,7 @@ bool in_disintegration_range(POSITION y1, POSITION x1, POSITION y2, POSITION x2)
 /*
  * breath shape
  */
-void breath_shape(u16b *path_g, int dist, int *pgrids, POSITION *gx, POSITION *gy, POSITION *gm, int *pgm_rad, POSITION rad, POSITION y1, POSITION x1, POSITION y2, POSITION x2, int typ)
+void breath_shape(u16b *path_g, int dist, int *pgrids, POSITION *gx, POSITION *gy, POSITION *gm, POSITION *pgm_rad, POSITION rad, POSITION y1, POSITION x1, POSITION y2, POSITION x2, int typ)
 {
        POSITION by = y1;
        POSITION bx = x1;
index d4d48d7..77758d6 100644 (file)
@@ -1197,8 +1197,8 @@ void text_to_ascii(char *buf, cptr str)
                        /* Hex-mode XXX */
                        if (*str == 'x')
                        {
-                               *s = 16 * dehex(*++str);
-                               *s++ += dehex(*++str);
+                               *s = 16 * (char)dehex(*++str);
+                               *s++ += (char)dehex(*++str);
                        }
 
                        /* Hack -- simple way to specify "backslash" */
@@ -1252,29 +1252,29 @@ void text_to_ascii(char *buf, cptr str)
                        /* Octal-mode */
                        else if (*str == '0')
                        {
-                               *s = 8 * deoct(*++str);
-                               *s++ += deoct(*++str);
+                               *s = 8 * (char)deoct(*++str);
+                               *s++ += (char)deoct(*++str);
                        }
 
                        /* Octal-mode */
                        else if (*str == '1')
                        {
-                               *s = 64 + 8 * deoct(*++str);
-                               *s++ += deoct(*++str);
+                               *s = 64 + 8 * (char)deoct(*++str);
+                               *s++ += (char)deoct(*++str);
                        }
 
                        /* Octal-mode */
                        else if (*str == '2')
                        {
-                               *s = 64 * 2 + 8 * deoct(*++str);
-                               *s++ += deoct(*++str);
+                               *s = 64 * 2 + 8 * (char)deoct(*++str);
+                               *s++ += (char)deoct(*++str);
                        }
 
                        /* Octal-mode */
                        else if (*str == '3')
                        {
-                               *s = 64 * 3 + 8 * deoct(*++str);
-                               *s++ += deoct(*++str);
+                               *s = 64 * 3 + 8 * (char)deoct(*++str);
+                               *s++ += (char)deoct(*++str);
                        }
 
                        /* Skip the final char */