OSDN Git Service

[Refactor] #37353 型の置換による警告修正。 / Fix warning with type replacement.
authorDeskull <deskull@users.sourceforge.jp>
Thu, 3 Jan 2019 01:55:47 +0000 (10:55 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Thu, 3 Jan 2019 01:56:46 +0000 (10:56 +0900)
src/load.c
src/save.c

index 0be7fb4..37889d6 100644 (file)
@@ -1661,9 +1661,12 @@ static void load_quick_start(void)
        }
 
        rd_byte(&previous_char.psex);
-       rd_byte(&previous_char.prace);
-       rd_byte(&previous_char.pclass);
-       rd_byte(&previous_char.pseikaku);
+       rd_byte(&tmp8u);
+       previous_char.prace = (RACE_IDX)tmp8u;
+       rd_byte(&tmp8u);
+       previous_char.pclass = (CLASS_IDX)tmp8u;
+       rd_byte(&tmp8u);
+       previous_char.pseikaku = (CHARACTER_IDX)tmp8u;
        rd_byte(&tmp8u);
        previous_char.realm1 = (REALM_IDX)tmp8u;
        rd_byte(&tmp8u);
@@ -1731,9 +1734,12 @@ static void rd_extra(void)
        }
 
        /* Class/Race/Seikaku/Gender/Spells */
-       rd_byte(&p_ptr->prace);
-       rd_byte(&p_ptr->pclass);
-       rd_byte(&p_ptr->pseikaku);
+       rd_byte(&tmp8u);
+       p_ptr->prace = (RACE_IDX)tmp8u;
+       rd_byte(&tmp8u);
+       p_ptr->pclass = (CLASS_IDX)tmp8u;
+       rd_byte(&tmp8u);
+       p_ptr->pseikaku = (CHARACTER_IDX)tmp8u;
        rd_byte(&p_ptr->psex);
        rd_byte(&tmp8u);
        p_ptr->realm1 = (REALM_IDX)tmp8u;
index 79744b8..d50c841 100644 (file)
@@ -556,9 +556,9 @@ static void save_quick_start(void)
        int i;
 
        wr_byte(previous_char.psex);
-       wr_byte(previous_char.prace);
-       wr_byte(previous_char.pclass);
-       wr_byte(previous_char.pseikaku);
+       wr_byte((byte_hack)previous_char.prace);
+       wr_byte((byte_hack)previous_char.pclass);
+       wr_byte((byte_hack)previous_char.pseikaku);
        wr_byte((byte_hack)previous_char.realm1);
        wr_byte((byte_hack)previous_char.realm2);
 
@@ -612,10 +612,10 @@ static void wr_extra(void)
        }
 
        /* Race/Class/Gender/Spells */
-       wr_byte(p_ptr->prace);
-       wr_byte(p_ptr->pclass);
-       wr_byte(p_ptr->pseikaku);
-       wr_byte(p_ptr->psex);
+       wr_byte((byte_hack)p_ptr->prace);
+       wr_byte((byte_hack)p_ptr->pclass);
+       wr_byte((byte_hack)p_ptr->pseikaku);
+       wr_byte((byte_hack)p_ptr->psex);
        wr_byte((byte_hack)p_ptr->realm1);
        wr_byte((byte_hack)p_ptr->realm2);
        wr_byte(0);