OSDN Git Service

#37287 #37353 (2.2.0.89) 型の置換を継続中。 / Ongoing type replacement.
authorDeskull <desull@users.sourceforge.jp>
Sun, 24 Sep 2017 00:59:22 +0000 (09:59 +0900)
committerDeskull <desull@users.sourceforge.jp>
Sun, 24 Sep 2017 00:59:22 +0000 (09:59 +0900)
src/externs.h
src/grid.c
src/load.c
src/object2.c
src/save.c
src/spells1.c
src/spells3.c
src/types.h

index 72bbfd3..6a4271f 100644 (file)
@@ -1090,11 +1090,11 @@ extern void remove_loc(void);
 extern bool save_floor(saved_floor_type *sf_ptr, u32b mode);
 
 /* spells1.c */
-extern bool in_disintegration_range(int y1, int x1, int y2, int x2);
+extern bool in_disintegration_range(POSITION y1, POSITION x1, POSITION y2, POSITION x2);
 extern void breath_shape(u16b *path_g, int dist, int *pgrids, byte *gx, byte *gy, byte *gm, int *pgm_rad, int rad, int y1, int x1, int y2, int x2, int typ);
 extern int take_hit(int damage_type, int damage, cptr kb_str, int monspell);
-extern u16b bolt_pict(int y, int x, int ny, int nx, int typ);
-extern sint project_path(u16b *gp, int range, int y1, int x1, int y2, int x2, int flg);
+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 bool project(int who, int rad, int y, int x, HIT_POINT dam, int typ, int flg, int monspell);
 extern int project_length;
@@ -1251,7 +1251,7 @@ extern bool identify_fully(bool only_equip);
 extern bool recharge(int num);
 extern bool bless_weapon(void);
 extern bool pulish_shield(void);
-extern bool potion_smash_effect(int who, int y, int x, int k_idx);
+extern bool potion_smash_effect(int who, POSITION y, POSITION x, int k_idx);
 extern void display_spell_list(void);
 extern s16b experience_of_spell(int spell, int realm);
 extern int mod_need_mana(int need_mana, int spell, int realm);
index 93cb610..3382fd5 100644 (file)
@@ -1119,7 +1119,7 @@ static void short_seg_hack(int x1, int y1, int x2, int y2, int type, int count,
  */
 bool build_tunnel2(POSITION x1, POSITION y1, POSITION x2, POSITION y2, int type, int cutoff)
 {
-       int x3, y3, dx, dy; // TODO: いずれpositon型に変える
+       POSITION x3, y3, dx, dy;
        int changex, changey;
        int length;
        int i;
index feaa555..ea3fee0 100644 (file)
@@ -1852,8 +1852,11 @@ static void rd_extra(void)
        rd_byte(&p_ptr->exit_bldg);
        rd_byte(&tmp8u);
 
-       rd_s16b(&p_ptr->oldpx);
-       rd_s16b(&p_ptr->oldpy);
+       rd_s16b(&tmp16s);
+       p_ptr->oldpx = (POSITION)tmp16s;
+       rd_s16b(&tmp16s);
+       p_ptr->oldpy = (POSITION)tmp16s;
+
        if (z_older_than(10, 3, 13) && !dun_level && !p_ptr->inside_arena) {p_ptr->oldpy = 33;p_ptr->oldpx = 131;}
 
        /* Was p_ptr->rewards[MAX_BACT] */
index 478683b..415352b 100644 (file)
@@ -7722,8 +7722,9 @@ static void drain_essence(void)
        int old_ds, old_dd, old_to_h, old_to_d, old_ac, old_to_a, old_pval, old_name2, old_timeout;
        u32b old_flgs[TR_FLAG_SIZE], new_flgs[TR_FLAG_SIZE];
        object_type *o_ptr;
-       cptr            q, s;
-       byte iy, ix, marked, number;
+       cptr q, s;
+       POSITION iy, ix;
+       byte_hack marked, number;
        s16b next_o_idx, weight;
 
        for (i = 0; i < sizeof(drain_value) / sizeof(int); i++)
index e1987de..3effe20 100644 (file)
@@ -165,8 +165,8 @@ static void wr_item(object_type *o_ptr)
        wr_s16b(o_ptr->k_idx);
 
        /* Location */
-       wr_byte(o_ptr->iy);
-       wr_byte(o_ptr->ix);
+       wr_byte((byte_hack)o_ptr->iy);
+       wr_byte((byte_hack)o_ptr->ix);
 
        if (flags & SAVE_ITEM_PVAL) wr_s16b(o_ptr->pval);
 
@@ -248,8 +248,8 @@ static void wr_monster(monster_type *m_ptr)
 
        /*** Write only un-obvious elements ***/
        wr_s16b(m_ptr->r_idx);
-       wr_byte(m_ptr->fy);
-       wr_byte(m_ptr->fx);
+       wr_byte((byte_hack)m_ptr->fy);
+       wr_byte((byte_hack)m_ptr->fx);
        wr_s16b(m_ptr->hp);
        wr_s16b(m_ptr->maxhp);
        wr_s16b(m_ptr->max_maxhp);
@@ -692,8 +692,8 @@ static void wr_extra(void)
        wr_byte(p_ptr->exit_bldg);
        wr_byte(0); /* Unused */
 
-       wr_s16b(p_ptr->oldpx);
-       wr_s16b(p_ptr->oldpy);
+       wr_s16b((s16b)p_ptr->oldpx);
+       wr_s16b((s16b)p_ptr->oldpy);
 
        /* Was number of p_ptr->rewards[] */
        wr_s16b(0);
index 3fbfd5a..79e382e 100644 (file)
@@ -208,7 +208,7 @@ static byte spell_color(int type)
  * If the distance is not "one", we (may) return "*".
  * </pre>
  */
-u16b bolt_pict(int y, int x, int ny, int nx, int typ)
+u16b bolt_pict(POSITION y, POSITION x, POSITION ny, POSITION nx, int typ)
 {
        int base;
 
@@ -298,7 +298,7 @@ u16b bolt_pict(int y, int x, int ny, int nx, int typ)
  * by "update_view_los()", and very different from the one used by "los()".
  * </pre>
  */
-sint project_path(u16b *gp, int range, int y1, int x1, int y2, int x2, int flg)
+sint project_path(u16b *gp, POSITION range, POSITION y1, POSITION x1, POSITION y2, POSITION x2, int flg)
 {
        int y, x;
 
@@ -5173,7 +5173,7 @@ static bool project_m(int who, int r, int y, int x, HIT_POINT dam, int typ, int
  * We return "TRUE" if any "obvious" effects were observed.  XXX XXX Actually,
  * we just assume that the effects were obvious, for historical reasons.
  */
-static bool project_p(int who, cptr who_name, int r, int y, int x, int dam, int typ, int flg, int monspell)
+static bool project_p(int who, cptr who_name, int r, POSITION y, POSITION x, int dam, int typ, int flg, int monspell)
 {
        int k = 0;
        int rlev = 0;
@@ -5216,15 +5216,15 @@ static bool project_p(int who, cptr who_name, int r, int y, int x, int dam, int
 
        if ((p_ptr->reflect || ((p_ptr->special_defense & KATA_FUUJIN) && !p_ptr->blind)) && (flg & PROJECT_REFLECTABLE) && !one_in_(10))
        {
-               byte t_y, t_x;
+               POSITION t_y, t_x;
                int max_attempts = 10;
 
-        if (blind) 
-            msg_print(_("何かが跳ね返った!", "Something bounces!"));
+               if (blind) 
+                       msg_print(_("何かが跳ね返った!", "Something bounces!"));
                else if (p_ptr->special_defense & KATA_FUUJIN) 
-            msg_print(_("風の如く武器を振るって弾き返した!", "The attack bounces!"));
+                       msg_print(_("風の如く武器を振るって弾き返した!", "The attack bounces!"));
                else 
-            msg_print(_("攻撃が跳ね返った!", "The attack bounces!"));
+                       msg_print(_("攻撃が跳ね返った!", "The attack bounces!"));
 
 
                /* Choose 'new' target */
@@ -6318,28 +6318,28 @@ int dist_to_line(int y, int x, int y1, int x1, int y2, int x2)
  * Modified version of los() for calculation of disintegration balls.
  * Disintegration effects are stopped by permanent walls.
  */
-bool in_disintegration_range(int y1, int x1, int y2, int x2)
+bool in_disintegration_range(POSITION y1, POSITION x1, POSITION y2, POSITION x2)
 {
        /* Delta */
-       int dx, dy;
+       POSITION dx, dy;
 
        /* Absolute */
-       int ax, ay;
+       POSITION ax, ay;
 
        /* Signs */
-       int sx, sy;
+       POSITION sx, sy;
 
        /* Fractions */
-       int qx, qy;
+       POSITION qx, qy;
 
        /* Scanners */
-       int tx, ty;
+       POSITION tx, ty;
 
        /* Scale factors */
-       int f1, f2;
+       POSITION f1, f2;
 
        /* Slope, or 1/Slope, of LOS */
-       int m;
+       POSITION m;
 
 
        /* Extract the offset */
index c7d1b31..98add3f 100644 (file)
@@ -2726,8 +2726,8 @@ bool mundane_spell(bool only_equip)
        /* Oops */
        msg_print(_("まばゆい閃光が走った!", "There is a bright flash of light!"));
        {
-               byte iy = o_ptr->iy;                 /* Y-position on map, or zero */
-               byte ix = o_ptr->ix;                 /* X-position on map, or zero */
+               POSITION iy = o_ptr->iy;                 /* Y-position on map, or zero */
+               POSITION ix = o_ptr->ix;                 /* X-position on map, or zero */
                s16b next_o_idx = o_ptr->next_o_idx; /* Next object in stack (if any) */
                byte marked = o_ptr->marked;         /* Object is marked */
                s16b weight = o_ptr->number * o_ptr->weight;
@@ -3477,7 +3477,7 @@ msg_format("%sは輝いた!", o_name);
  *    o_ptr --- pointer to the potion object.
  * </pre>
  */
-bool potion_smash_effect(int who, int y, int x, int k_idx)
+bool potion_smash_effect(int who, POSITION y, POSITION x, int k_idx)
 {
        int     radius = 2;
        int     dt = 0;
index 6cbe24a..4110c4b 100644 (file)
@@ -956,8 +956,8 @@ typedef struct player_type player_type;
 
 struct player_type
 {
-       s16b oldpy;             /* Previous player location -KMW- */
-       s16b oldpx;             /* Previous player location -KMW- */
+       POSITION oldpy;         /* Previous player location -KMW- */
+       POSITION oldpx;         /* Previous player location -KMW- */
 
        CHARACTER_IDX psex;                     /* Sex index */
        CHARACTER_IDX prace;                    /* Race index */