OSDN Git Service

#37287 #37353 (2.2.0.89) 型の置換を継続中。 / Ongoing type replacement.
authorDeskull <desull@users.sourceforge.jp>
Wed, 20 Dec 2017 13:13:09 +0000 (22:13 +0900)
committerDeskull <desull@users.sourceforge.jp>
Wed, 20 Dec 2017 13:13:09 +0000 (22:13 +0900)
src/util.c
src/xtra2.c

index 72e2072..5b65235 100644 (file)
@@ -3805,10 +3805,11 @@ bool get_com(cptr prompt, char *command, bool z_escape)
  */
 QUANTITY get_quantity(cptr prompt, QUANTITY max)
 {
-       bool res;
+       bool res, result;
        QUANTITY amt;
        char tmp[80];
        char buf[80];
+       COMMAND_CODE code;
 
 
        /* Use "command_arg" */
@@ -3830,7 +3831,9 @@ QUANTITY get_quantity(cptr prompt, QUANTITY max)
 #ifdef ALLOW_REPEAT /* TNB */
 
        /* Get the item index */
-       if ((max != 1) && repeat_pull(&amt))
+       result = repeat_pull(&code);
+       amt = (QUANTITY)code;
+       if ((max != 1) && result)
        {
                /* Enforce the maximum */
                if (amt > max) amt = max;
@@ -3892,7 +3895,7 @@ QUANTITY get_quantity(cptr prompt, QUANTITY max)
 
 #ifdef ALLOW_REPEAT /* TNB */
 
-       if (amt) repeat_push(amt);
+       if (amt) repeat_push((COMMAND_CODE)amt);
 
 #endif /* ALLOW_REPEAT -- TNB */
 
index 5c3b678..c0332fe 100644 (file)
@@ -4091,6 +4091,7 @@ bool get_aim_dir(DIRECTION *dp)
        DIRECTION dir;
        char    command;
        cptr    p;
+       COMMAND_CODE code;
 
        /* Initialize */
        (*dp) = 0;
@@ -4103,17 +4104,18 @@ bool get_aim_dir(DIRECTION *dp)
 
 #ifdef ALLOW_REPEAT /* TNB */
 
-       if (repeat_pull(dp))
+       if (repeat_pull(&code))
        {
                /* Confusion? */
 
                /* Verify */
-               if (!(*dp == 5 && !target_okay()))
+               if (!(code == 5 && !target_okay()))
                {
 /*                     return (TRUE); */
-                       dir = *dp;
+                       dir = (DIRECTION)code;
                }
        }
+       *dp = (DIRECTION)code;
 
 #endif /* ALLOW_REPEAT -- TNB */
 
@@ -4208,7 +4210,7 @@ bool get_aim_dir(DIRECTION *dp)
 #ifdef ALLOW_REPEAT /* TNB */
 
 /*     repeat_push(dir); */
-       repeat_push(command_dir);
+       repeat_push((COMMAND_CODE)command_dir);
 
 #endif /* ALLOW_REPEAT -- TNB */
 
@@ -4238,6 +4240,7 @@ bool get_rep_dir(DIRECTION *dp, bool under)
 {
        DIRECTION dir;
        cptr prompt;
+       COMMAND_CODE code;
 
        /* Initialize */
        (*dp) = 0;
@@ -4247,11 +4250,12 @@ bool get_rep_dir(DIRECTION *dp, bool under)
 
 #ifdef ALLOW_REPEAT /* TNB */
 
-       if (repeat_pull(dp))
+       if (repeat_pull(&code))
        {
-               dir = *dp;
+               dir = (DIRECTION)code;
 /*             return (TRUE); */
        }
+       *dp = (DIRECTION)code;
 
 #endif /* ALLOW_REPEAT -- TNB */
 
@@ -4363,7 +4367,7 @@ bool get_rep_dir(DIRECTION *dp, bool under)
 #ifdef ALLOW_REPEAT /* TNB */
 
 /*     repeat_push(dir); */
-       repeat_push(command_dir);
+       repeat_push((COMMAND_CODE)command_dir);
 
 #endif /* ALLOW_REPEAT -- TNB */
 
@@ -4375,6 +4379,7 @@ bool get_rep_dir(DIRECTION *dp, bool under)
 bool get_rep_dir2(DIRECTION *dp)
 {
        DIRECTION dir;
+       COMMAND_CODE code;
 
        /* Initialize */
        (*dp) = 0;
@@ -4384,11 +4389,12 @@ bool get_rep_dir2(DIRECTION *dp)
 
 #ifdef ALLOW_REPEAT /* TNB */
 
-       if (repeat_pull(dp))
+       if (repeat_pull(&code))
        {
-               dir = *dp;
+               dir = (DIRECTION)code;
 /*             return (TRUE); */
        }
+       *dp = (DIRECTION)code;
 
 #endif /* ALLOW_REPEAT -- TNB */
 
@@ -4440,7 +4446,7 @@ bool get_rep_dir2(DIRECTION *dp)
 #ifdef ALLOW_REPEAT /* TNB */
 
 /*     repeat_push(dir); */
-       repeat_push(command_dir);
+       repeat_push((COMMAND_CODE)command_dir);
 
 #endif /* ALLOW_REPEAT -- TNB */