OSDN Git Service

[Refactor] #37353 型の置換と警告修正。 / Type replacement and fix warning.
authorDeskull <deskull@users.sourceforge.jp>
Thu, 3 Jan 2019 02:16:31 +0000 (11:16 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Thu, 3 Jan 2019 02:16:31 +0000 (11:16 +0900)
src/birth.c
src/load.c
src/save.c
src/types.h

index 2d54c07..8794f98 100644 (file)
@@ -2847,7 +2847,7 @@ static bool get_player_class(void)
  */
 static bool get_player_seikaku(void)
 {
-       CHARACTER_IDX k;
+       int k;
        int n, os, cs;
        char c;
        char sym[MAX_SEIKAKU];
@@ -3031,7 +3031,7 @@ static bool get_player_seikaku(void)
        }
 
        /* Set seikaku */
-       p_ptr->pseikaku = k;
+       p_ptr->pseikaku = (CHARACTER_IDX)k;
        ap_ptr = &seikaku_info[p_ptr->pseikaku];
 #ifdef JP
        strcpy(tmp, ap_ptr->title);
@@ -3043,7 +3043,6 @@ static bool get_player_seikaku(void)
 #endif
        strcat(tmp,p_ptr->name);
 
-       /* Display */
        c_put_str(TERM_L_BLUE, tmp, 1, 34);
 
        return TRUE;
index 37889d6..f9af9ec 100644 (file)
@@ -1836,7 +1836,8 @@ static void rd_extra(void)
        }
        else
        {
-               rd_byte(&p_ptr->start_race);
+               rd_byte(&tmp8u);
+               p_ptr->start_race = (RACE_IDX)tmp8u;
                rd_s32b(&tmp32s);
                p_ptr->old_race1 = (BIT_FLAGS)tmp32s;
                rd_s32b(&tmp32s);
index d50c841..129b6de 100644 (file)
@@ -599,9 +599,7 @@ static void wr_extra(void)
        byte tmp8u;
 
        wr_string(p_ptr->name);
-
        wr_string(p_ptr->died_from);
-
        wr_string(p_ptr->last_message ? p_ptr->last_message : "");
 
        save_quick_start();
@@ -649,7 +647,7 @@ static void wr_extra(void)
        for (i = 0; i < 108; i++) wr_s32b(p_ptr->magic_num1[i]);
        for (i = 0; i < 108; i++) wr_byte(p_ptr->magic_num2[i]);
 
-       wr_byte(p_ptr->start_race);
+       wr_byte((byte_hack)p_ptr->start_race);
        wr_s32b(p_ptr->old_race1);
        wr_s32b(p_ptr->old_race2);
        wr_s16b(p_ptr->old_realm);
index 5207683..0bded9f 100644 (file)
@@ -964,19 +964,19 @@ struct player_type
        POSITION oldpy;         /* Previous player location -KMW- */
        POSITION oldpx;         /* Previous player location -KMW- */
 
-       CHARACTER_IDX psex;                     /* Sex index */
-       CHARACTER_IDX prace;                    /* Race index */
-       CHARACTER_IDX pclass;           /* Class index */
-       CHARACTER_IDX pseikaku;         /* Seikaku index */
-       REALM_IDX realm1;        /* First magic realm */
-       REALM_IDX realm2;        /* Second magic realm */
-       CHARACTER_IDX oops;                     /* Unused */
-
-       DICE_SID hitdie;                /* Hit dice (sides) */
-       u16b expfact;       /* Experience factor
-                            * Note: was byte, causing overflow for Amberite
-                            * characters (such as Amberite Paladins)
-                            */
+       byte psex;      /* Sex index */
+       RACE_IDX prace;         /* Race index */
+       CLASS_IDX pclass;       /* Class index */
+       CHARACTER_IDX pseikaku; /* Seikaku index */
+       REALM_IDX realm1;               /* First magic realm */
+       REALM_IDX realm2;               /* Second magic realm */
+       CHARACTER_IDX oops;             /* Unused */
+
+       DICE_SID hitdie;        /* Hit dice (sides) */
+       u16b expfact;   /* Experience factor
+                                       * Note: was byte, causing overflow for Amberite
+                                       * characters (such as Amberite Paladins)
+                                       */
 
        s16b age;                       /* Characters age */
        s16b ht;                        /* Height */
@@ -1137,7 +1137,7 @@ struct player_type
        byte knowledge;           /* Knowledge about yourself */
        BIT_FLAGS visit;               /* Visited towns */
 
-       byte start_race;          /* Race at birth */
+       RACE_IDX start_race;          /* Race at birth */
        BIT_FLAGS old_race1;           /* Record of race changes */
        BIT_FLAGS old_race2;           /* Record of race changes */
        s16b old_realm;           /* Record of realm changes */