OSDN Git Service

Get rid of all gcc(-Wall) warnings
authorhabu <habu@0568b783-4c39-0410-ac80-bf13821ea2a2>
Tue, 26 Feb 2013 07:58:14 +0000 (07:58 +0000)
committerhabu <habu@0568b783-4c39-0410-ac80-bf13821ea2a2>
Tue, 26 Feb 2013 07:58:14 +0000 (07:58 +0000)
22 files changed:
src/autopick.c
src/birth.c
src/bldg.c
src/cave.c
src/chuukei.c
src/cmd1.c
src/cmd3.c
src/cmd4.c
src/cmd6.c
src/do-spell.c
src/files.c
src/floors.c
src/generate.c
src/load.c
src/monster2.c
src/object1.c
src/object2.c
src/save.c
src/snipe.c
src/store.c
src/xtra1.c
src/xtra2.c

index 1a7904f..cedf34c 100644 (file)
@@ -829,10 +829,10 @@ static void add_autopick_list(autopick_type *entry)
                C_MAKE(autopick_list, max_max_autopick, autopick_type);
 
                /* Copy from old list to new list */
-               C_COPY(autopick_list, old_autopick_list, old_max_max_autopick, autopick_type);
+               (void)C_COPY(autopick_list, old_autopick_list, old_max_max_autopick, autopick_type);
 
                /* Kill old list */
-               C_FREE(old_autopick_list, old_max_max_autopick, autopick_type);
+               C_KILL(old_autopick_list, old_max_max_autopick, autopick_type);
        }
 
        /* Add one line */
@@ -1614,7 +1614,7 @@ static void auto_destroy_item(object_type *o_ptr, int autopick_idx)
        }
 
        /* Record name of destroyed item */
-       COPY(&autopick_last_destroyed_object, o_ptr, object_type);
+       (void)COPY(&autopick_last_destroyed_object, o_ptr, object_type);
 
        /* Destroy Later */
        o_ptr->marked |= OM_AUTODESTROY;
@@ -2989,7 +2989,7 @@ static void free_text_lines(cptr *lines_list)
                string_free(lines_list[lines]);
 
        /* free list of pointers */
-       C_FREE((char **)lines_list, MAX_LINES, char *);
+       C_KILL(lines_list, MAX_LINES, cptr);
 }
 
 
@@ -4640,7 +4640,7 @@ static void draw_text_editor(text_body_type *tb)
                        else state &= ~LSTAT_BYPASS;
 
                        /* Cannot use string_free() because the string was "destroyed" */
-                       C_FREE(s_keep, s_len + 1, char);
+                       C_KILL(s_keep, s_len + 1, char);
 
                        /* Re-update this line's state */
                        tb->states[y] = state | LSTAT_EXPRESSION;
index d06329e..908312a 100644 (file)
@@ -2585,7 +2585,7 @@ static void load_prev_data(bool swap)
        /*** Save the previous data ***/
        if (swap)
        {
-               COPY(&previous_char, &temp, birther);
+               (void)COPY(&previous_char, &temp, birther);
        }
 }
 
@@ -4753,7 +4753,7 @@ static bool get_player_seikaku(void)
 static bool get_stat_limits(void)
 {
        int i, j, m, cs, os;
-       int mval[6], cval[6];
+       int cval[6];
        char c;
        char buf[80], cur[80];
        char inp[80];
@@ -4789,9 +4789,6 @@ static bool get_stat_limits(void)
                /* Obtain the "maximal" stat */
                m = adjust_stat(17, j);
 
-               /* Save the maximum */
-               mval[i] = m;
-
                /* Above 18 */
                if (m > 18)
                {
index ad879a7..3e3e47d 100644 (file)
@@ -3204,7 +3204,6 @@ static void compare_weapon_aux2(int r, int c, int mindam, int maxdam, cptr attr,
  */
 static void compare_weapon_aux1(object_type *o_ptr, int col, int r)
 {
-       int mult = 60;
        u32b flgs[TR_FLAG_SIZE];
        int blow = p_ptr->num_blow[0];
        bool force = FALSE;
@@ -4150,7 +4149,6 @@ static bool item_tester_hook_broken_weapon(object_type *o_ptr)
 static void give_one_ability_of_object(object_type *to_ptr, object_type *from_ptr)
 {
        int i, n = 0;
-       int idx = 0;
        int cand[TR_FLAG_MAX];
        u32b to_flgs[TR_FLAG_SIZE];
        u32b from_flgs[TR_FLAG_SIZE];
@@ -4207,7 +4205,7 @@ static int repair_broken_weapon_aux(int bcost)
        int item, mater;
        object_type *o_ptr, *mo_ptr; /* broken weapon and material weapon */
        object_kind *k_ptr;
-       int i, k_idx, tr_idx, dd_bonus, ds_bonus;
+       int i, k_idx, dd_bonus, ds_bonus;
        char basenm[MAX_NLEN];
        cptr q, s; /* For get_item prompt */
        int row = 7;
index 5cc3058..2939187 100644 (file)
@@ -2135,33 +2135,33 @@ void display_map(int *cy, int *cx)
        for (y = 0; y < (hgt + 2); y++)
        {
                /* Free one row each array */
-               C_FREE(ma[y], (wid + 2), byte);
-               C_FREE(mc[y], (wid + 2), char);
-               C_FREE(mp[y], (wid + 2), byte);
-               C_FREE(match_autopick_yx[y], (wid + 2), int);
-               C_FREE(object_autopick_yx[y], (wid + 2), object_type **);
+               C_KILL(ma[y], (wid + 2), byte);
+               C_KILL(mc[y], (wid + 2), char);
+               C_KILL(mp[y], (wid + 2), byte);
+               C_KILL(match_autopick_yx[y], (wid + 2), int);
+               C_KILL(object_autopick_yx[y], (wid + 2), object_type *);
        }
 
        /* Free each line map */
-       C_FREE(ma, (hgt + 2), byte_ptr);
-       C_FREE(mc, (hgt + 2), char_ptr);
-       C_FREE(mp, (hgt + 2), byte_ptr);
-       C_FREE(match_autopick_yx, (hgt + 2), sint_ptr);
-       C_FREE(object_autopick_yx, (hgt + 2), object_type **);
+       C_KILL(ma, (hgt + 2), byte_ptr);
+       C_KILL(mc, (hgt + 2), char_ptr);
+       C_KILL(mp, (hgt + 2), byte_ptr);
+       C_KILL(match_autopick_yx, (hgt + 2), sint_ptr);
+       C_KILL(object_autopick_yx, (hgt + 2), object_type **);
 
        /* Free each line map */
        for (y = 0; y < (cur_hgt + 2); y++)
        {
                /* Free one row each array */
-               C_FREE(bigma[y], (cur_wid + 2), byte);
-               C_FREE(bigmc[y], (cur_wid + 2), char);
-               C_FREE(bigmp[y], (cur_wid + 2), byte);
+               C_KILL(bigma[y], (cur_wid + 2), byte);
+               C_KILL(bigmc[y], (cur_wid + 2), char);
+               C_KILL(bigmp[y], (cur_wid + 2), byte);
        }
 
        /* Free each line map */
-       C_FREE(bigma, (cur_hgt + 2), byte_ptr);
-       C_FREE(bigmc, (cur_hgt + 2), char_ptr);
-       C_FREE(bigmp, (cur_hgt + 2), byte_ptr);
+       C_KILL(bigma, (cur_hgt + 2), byte_ptr);
+       C_KILL(bigmc, (cur_hgt + 2), char_ptr);
+       C_KILL(bigmp, (cur_hgt + 2), byte_ptr);
 }
 
 
index fdbd00d..2890f97 100644 (file)
 #define DEFAULT_DELAY 50
 #define RECVBUF_SIZE 1024
 
-static int sd; /* ¥½¥±¥Ã¥È¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ */
 static long epoch_time;  /* ¥Ð¥Ã¥Õ¥¡³«»Ï»þ¹ï */
-static long time_diff;   /* ¥×¥ì¥¤Â¦¤È¤Î»þ´Ö¤Î¤º¤ì(¤³¤ì¤ò¸«¤Ê¤¬¤é¥Ç¥£¥ì¥¤¤òÄ´À°¤·¤Æ¤¤¤¯) */
 static int browse_delay; /* É½¼¨¤¹¤ë¤Þ¤Ç¤Î»þ´Ö(100msñ°Ì)(¤³¤Î´Ö¤Ë¥é¥°¤òµÛ¼ý¤¹¤ë) */
 #ifdef CHUUKEI
+static int sd; /* ¥½¥±¥Ã¥È¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ */
+static long time_diff;   /* ¥×¥ì¥¤Â¦¤È¤Î»þ´Ö¤Î¤º¤ì(¤³¤ì¤ò¸«¤Ê¤¬¤é¥Ç¥£¥ì¥¤¤òÄ´À°¤·¤Æ¤¤¤¯) */
 static int server_port;
 static char server_name[MAX_HOSTNAME];
 #endif
index ae05fa4..49362cd 100644 (file)
@@ -494,7 +494,7 @@ void search(void)
  */
 void py_pickup_aux(int o_idx)
 {
-       int slot, i;
+       int slot;
 
 #ifdef JP
 /*
index 48b94a5..721d4a0 100644 (file)
@@ -206,7 +206,7 @@ bool select_ring_slot = FALSE;
  */
 void do_cmd_wield(void)
 {
-       int i, item, slot;
+       int item, slot;
 
        object_type forge;
        object_type *q_ptr;
index 3431bcc..896c2f9 100644 (file)
@@ -8635,8 +8635,8 @@ static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, int d
        byte char_old[F_LIT_MAX];
        byte *cur_attr_ptr, *cur_char_ptr;
 
-       C_WIPE(attr_old, F_LIT_MAX, byte);
-       C_WIPE(char_old, F_LIT_MAX, byte);
+       (void)C_WIPE(attr_old, F_LIT_MAX, byte);
+       (void)C_WIPE(char_old, F_LIT_MAX, byte);
 
        /* Get size */
        Term_get_size(&wid, &hgt);
index 33e9e39..6405293 100644 (file)
@@ -1580,7 +1580,6 @@ static void do_cmd_read_scroll_aux(int item, bool known)
 {
        int         k, used_up, ident, lev;
        object_type *o_ptr;
-       char        Rumor[1024];
 
 
        /* Get the item (in the pack) */
@@ -3998,7 +3997,7 @@ static bool ang_sort_comp_pet(vptr u, vptr v, int a, int b)
  */
 static void do_cmd_activate_aux(int item)
 {
-       int         k, dir, lev, chance, fail;
+       int         dir, lev, chance, fail;
        object_type *o_ptr;
        bool success;
 
index 44945e6..ceb204f 100644 (file)
@@ -11427,7 +11427,6 @@ static cptr do_hex_spell(int spell, int mode)
        bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
        bool info = (mode == SPELL_INFO) ? TRUE : FALSE;
        bool cast = (mode == SPELL_CAST) ? TRUE : FALSE;
-       bool fail = (mode == SPELL_FAIL) ? TRUE : FALSE;
        bool cont = (mode == SPELL_CONT) ? TRUE : FALSE;
        bool stop = (mode == SPELL_STOP) ? TRUE : FALSE;
 
index 478cdc1..a277561 100644 (file)
@@ -4016,7 +4016,7 @@ void display_player(int mode)
  */
 static void dump_aux_display_player(FILE *fff)
 {
-       int x, y, i;
+       int x, y;
        byte a;
        char c;
        char            buf[1024];
index 67bb685..681d915 100644 (file)
@@ -371,7 +371,7 @@ static void preserve_pet(void)
                else
                {
                        /* Preserve the mount */
-                       COPY(&party_mon[0], m_ptr, monster_type);
+                       (void)COPY(&party_mon[0], m_ptr, monster_type);
 
                        /* Delete from this floor */
                        delete_monster_idx(p_ptr->riding);
@@ -422,7 +422,7 @@ static void preserve_pet(void)
                                }
                        }
 
-                       COPY(&party_mon[num], &m_list[i], monster_type);
+                       (void)COPY(&party_mon[num], &m_list[i], monster_type);
 
                        num++;
 
@@ -615,7 +615,7 @@ static void place_pet(void)
        }
 
        /* For accuracy of precalc_cur_num_of_pet() */
-       C_WIPE(party_mon, MAX_PARTY_MON, monster_type);
+       (void)C_WIPE(party_mon, MAX_PARTY_MON, monster_type);
 }
 
 
index bf75742..0f6b93d 100644 (file)
@@ -1467,14 +1467,14 @@ void clear_cave(void)
        int x, y, i;
 
        /* Very simplified version of wipe_o_list() */
-       C_WIPE(o_list, o_max, object_type);
+       (void)C_WIPE(o_list, o_max, object_type);
        o_max = 1;
        o_cnt = 0;
 
        /* Very simplified version of wipe_m_list() */
        for (i = 1; i < max_r_idx; i++)
                r_info[i].cur_num = 0;
-       C_WIPE(m_list, m_max, monster_type);
+       (void)C_WIPE(m_list, m_max, monster_type);
        m_max = 1;
        m_cnt = 0;
        for (i = 0; i < MAX_MTIMED; i++) mproc_max[i] = 0;
index 0080d54..4124876 100644 (file)
@@ -2900,7 +2900,7 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
        }
 
        /* Free the "template" array */
-       C_FREE(template, limit, cave_template_type);
+       C_KILL(template, limit, cave_template_type);
 
 
        /*** Objects ***/
@@ -3496,7 +3496,7 @@ note(format("
                /* Quest 18 was removed */
                if (h_older_than(1, 7, 0, 6))
                {
-                       WIPE(&quest[OLD_QUEST_WATER_CAVE], quest_type);
+                       (void)WIPE(&quest[OLD_QUEST_WATER_CAVE], quest_type);
                        quest[OLD_QUEST_WATER_CAVE].status = QUEST_STATUS_UNTAKEN;
                }
 
index fb10aa9..6070226 100644 (file)
@@ -369,7 +369,7 @@ static void compact_monsters_aux(int i1, int i2)
        }
 
        /* Structure copy */
-       COPY(&m_list[i2], &m_list[i1], monster_type);
+       (void)COPY(&m_list[i2], &m_list[i1], monster_type);
 
        /* Wipe the hole */
        (void)WIPE(&m_list[i1], monster_type);
index 246d499..78fea6e 100644 (file)
@@ -5968,7 +5968,7 @@ void py_pickup_floor(bool pickup)
        char o_name[MAX_NLEN];
        object_type *o_ptr;
 
-       int floor_num = 0, floor_list[23], floor_o_idx = 0;
+       int floor_num = 0, floor_o_idx = 0;
 
        int can_pickup = 0;
 
@@ -6031,10 +6031,6 @@ void py_pickup_floor(bool pickup)
                        can_pickup++;
                }
 
-               /* Remember this object index */
-               if (floor_num < 23)
-                       floor_list[floor_num] = this_o_idx;
-
                /* Count non-gold objects */
                floor_num++;
 
index 60cf987..d49ccf7 100644 (file)
@@ -1828,7 +1828,7 @@ void object_wipe(object_type *o_ptr)
 void object_copy(object_type *o_ptr, object_type *j_ptr)
 {
        /* Copy the structure */
-       COPY(o_ptr, j_ptr, object_type);
+       (void)COPY(o_ptr, j_ptr, object_type);
 }
 
 
index 83adadb..998fabb 100644 (file)
@@ -948,8 +948,8 @@ static void wr_saved_floor(saved_floor_type *sf_ptr)
 
                                /* Re-allocate the "template" array */
                                C_MAKE(template, max_num_temp + 255, cave_template_type);
-                               C_COPY(template, old_template, max_num_temp, cave_template_type);
-                               C_FREE(old_template, max_num_temp, cave_template_type);
+                               (void)C_COPY(template, old_template, max_num_temp, cave_template_type);
+                               C_KILL(old_template, max_num_temp, cave_template_type);
                                max_num_temp += 255;
                        }
 
@@ -1058,7 +1058,7 @@ static void wr_saved_floor(saved_floor_type *sf_ptr)
 
 
        /* Free the "template" array */
-       C_FREE(template, max_num_temp, cave_template_type);
+       C_KILL(template, max_num_temp, cave_template_type);
 
 
        /*** Dump objects ***/
index 271330f..398b16e 100644 (file)
@@ -500,7 +500,6 @@ int tot_dam_aux_snipe (int mult, monster_type *m_ptr)
  */
 static bool cast_sniper_spell(int spell)
 {
-       bool flag = FALSE;
        object_type *o_ptr = &inventory[INVEN_BOW];
 
        if (o_ptr->tval != TV_BOW)
@@ -558,9 +557,6 @@ static bool cast_sniper_spell(int spell)
 void do_cmd_snipe(void)
 {
        int             n = 0;
-       int             plev = p_ptr->lev;
-       int             old_chp = p_ptr->chp;
-       snipe_power     spell;
        bool            cast;
 
 
@@ -600,8 +596,6 @@ void do_cmd_snipe(void)
        /* get power */
        if (!get_snipe_power(&n, FALSE)) return;
 
-       spell = snipe_powers[n];
-
        sound(SOUND_SHOOT);
 
        /* Cast the spell */
index 5cac2ea..b0e6138 100644 (file)
@@ -306,8 +306,6 @@ static cptr comment_6[MAX_COMMENT_6] =
  */
 static void say_comment_1(void)
 {
-       char rumour[1024];
-
 #ifdef JP
        /* ¥Ö¥é¥Ã¥¯¥Þ¡¼¥±¥Ã¥È¤Î¤È¤­¤ÏÊ̤Υá¥Ã¥»¡¼¥¸¤ò½Ð¤¹ */
        if ( cur_store_num == STORE_BLACK ) {
index 00ae499..f402d6d 100644 (file)
@@ -1858,11 +1858,11 @@ void print_monster_list(int x, int y, int max_lines){
                if(is_pet(m_ptr))continue;//pet
                if(!m_ptr->r_idx)continue;//dead?
                {
+                       /*
                        int r_idx = m_ptr->ap_r_idx;
                        monster_race* r_ptr = &r_info[r_idx];
                        cptr name = (r_name + r_ptr->name);
                        cptr ename = (r_name + r_ptr->name);
-                       /*
                        //¥ß¥ß¥Ã¥¯Îà¤ä¡Ö¤½¤ì¡×Åù¤Ï¡¢°ìÍ÷¤Ë½Ð¤Æ¤Ï¤¤¤±¤Ê¤¤
                        if(r_ptr->flags1&RF1_CHAR_CLEAR)continue;
                        if((r_ptr->flags1&RF1_NEVER_MOVE)&&(r_ptr->flags2&RF2_CHAR_MULTI))continue;
index 64f7a09..bbe40be 100644 (file)
@@ -1746,7 +1746,7 @@ bool mon_take_hit(int m_idx, int dam, bool *fear, cptr note)
        int         i;
        int         expdam;
 
-       COPY(&exp_mon, m_ptr, monster_type);
+       (void)COPY(&exp_mon, m_ptr, monster_type);
        if (!(r_ptr->flags7 & RF7_KILL_EXP))
        {
                expdam = (m_ptr->hp > dam) ? dam : m_ptr->hp;