• R/O
  • SSH
  • HTTPS

xangband: Commit


Commit MetaInfo

Révision1872 (tree)
l'heure2013-03-12 20:34:31
Auteurhabu

Message de Log

Get rid of all gcc warnings

Change Summary

Modification

--- TinyAngband/trunk/src/rooms.c (revision 1871)
+++ TinyAngband/trunk/src/rooms.c (revision 1872)
@@ -3240,6 +3240,7 @@
32403240 #endif /* ALLOW_CAVERNS_AND_LAKES */
32413241
32423242
3243+#if 0
32433244 /*
32443245 * Routine used by the random vault creators to add a door to a location
32453246 * Note that range checking has to be done in the calling routine.
@@ -3293,8 +3294,10 @@
32933294 cave[y + 1][x].feat = FEAT_WALL_SOLID;
32943295 }
32953296 }
3297+#endif
32963298
32973299
3300+#if 0
32983301 /*
32993302 * Routine that fills the empty areas of a room with treasure and monsters.
33003303 */
@@ -3427,6 +3430,7 @@
34273430 }
34283431 }
34293432 }
3433+#endif
34303434
34313435 #if 0
34323436 /*
@@ -3958,6 +3962,7 @@
39583962 }
39593963 #endif
39603964
3965+#if 0
39613966 /*
39623967 * Build a town/ castle by using a recursive algorithm.
39633968 * Basically divide each region to create smaller regions.
@@ -4125,6 +4130,7 @@
41254130 }
41264131 }
41274132 }
4133+#endif
41284134
41294135 #if 0
41304136 /* Build a castle */
@@ -5148,11 +5154,11 @@
51485154
51495155 /* Generate new room */
51505156 generate_room(y1 + town_hgt / 3, x1 + town_wid / 3,
5151- y1 + town_hgt * 2 / 3, x < x1 + town_wid * 2 / 3, FALSE);
5157+ y1 + town_hgt * 2 / 3, x1 + town_wid * 2 / 3, FALSE);
51525158
51535159 /* Start with floors (center only) */
51545160 generate_fill(y1 + town_hgt / 3, x1 + town_wid / 3,
5155- y1 + town_hgt * 2 / 3, x < x1 + town_wid * 2 / 3, FEAT_FLOOR);
5161+ y1 + town_hgt * 2 / 3, x1 + town_wid * 2 / 3, FEAT_FLOOR);
51565162
51575163 /* Build stores */
51585164 build_stores(y1, x1, stores, n);
--- TinyAngband/trunk/src/birth.c (revision 1871)
+++ TinyAngband/trunk/src/birth.c (revision 1872)
@@ -1189,10 +1189,7 @@
11891189 if (p_ptr->realm2 == i+1)
11901190 cs = n;
11911191 #endif
1192- if (n < 26)
1193- sym[n] = I2A(n);
1194- else
1195- sym[n] = ('A' + n - 26);
1192+ sym[n] = I2A(n);
11961193 sprintf(buf, "%c%c %s", sym[n], p2, realm_names[i+1]);
11971194 put_str(buf, 12 + (n/5), 2 + 15 * (n%5));
11981195 picks[n++] = i+1;
@@ -1446,7 +1443,7 @@
14461443 /*** Save the previous data ***/
14471444 if (swap)
14481445 {
1449- COPY(&previous_char, &temp, birther);
1446+ (void)COPY(&previous_char, &temp, birther);
14501447 }
14511448 }
14521449
--- TinyAngband/trunk/src/util.c (revision 1871)
+++ TinyAngband/trunk/src/util.c (revision 1872)
@@ -2425,7 +2425,7 @@
24252425 }
24262426
24272427 /* Limit the multiplier to 1000 */
2428- if (buf && streq(buf, str) && (j < 1000))
2428+ if (streq(buf, str) && (j < 1000))
24292429 {
24302430 j++;
24312431
@@ -4641,14 +4641,9 @@
46414641 {
46424642 tag_type temp;
46434643
4644- temp.tag = a->tag;
4645- temp.pointer = a->pointer;
4646-
4647- a->tag = b->tag;
4648- a->pointer = b->pointer;
4649-
4650- b->tag = temp.tag;
4651- b->pointer = temp.pointer;
4644+ temp = *a;
4645+ *a = *b;
4646+ *b = temp;
46524647 }
46534648
46544649
--- TinyAngband/trunk/src/obj_kind.c (revision 1871)
+++ TinyAngband/trunk/src/obj_kind.c (revision 1872)
@@ -91,7 +91,7 @@
9191 max_k_idx++;
9292
9393 /* Copy the new object_kind */
94- COPY(&k_info[max_k_idx-1], k_info_entry, object_kind);
94+ (void)COPY(&k_info[max_k_idx-1], k_info_entry, object_kind);
9595
9696 /* Success */
9797 return (&k_info[max_k_idx-1]);
--- TinyAngband/trunk/src/object1.c (revision 1871)
+++ TinyAngband/trunk/src/object1.c (revision 1872)
@@ -5331,7 +5331,7 @@
53315331 char o_name[MAX_NLEN];
53325332 object_type *o_ptr;
53335333
5334- int floor_num = 0, floor_list[23], floor_o_idx = 0;
5334+ int floor_num = 0, floor_o_idx = 0;
53355335
53365336 int can_pickup = 0;
53375337
@@ -5394,9 +5394,6 @@
53945394 can_pickup++;
53955395 }
53965396
5397- /* Remember this object index */
5398- floor_list[floor_num] = this_o_idx;
5399-
54005397 /* Count non-gold objects */
54015398 floor_num++;
54025399 if (floor_num == 23) break;
--- TinyAngband/trunk/src/cmd4.c (revision 1871)
+++ TinyAngband/trunk/src/cmd4.c (revision 1872)
@@ -6984,8 +6984,8 @@
69846984 byte *cur_attr_ptr;
69856985 char *cur_char_ptr;
69866986
6987- C_WIPE(attr_old, F_LIT_MAX, byte);
6988- C_WIPE(char_old, F_LIT_MAX, byte);
6987+ (void)C_WIPE(attr_old, F_LIT_MAX, byte);
6988+ (void)C_WIPE(char_old, F_LIT_MAX, byte);
69896989
69906990 /* Get size */
69916991 Term_get_size(&wid, &hgt);
--- TinyAngband/trunk/src/xtra2.c (revision 1871)
+++ TinyAngband/trunk/src/xtra2.c (revision 1872)
@@ -256,7 +256,6 @@
256256 */
257257 static int get_coin_type(int r_idx)
258258 {
259- monster_race *r_ptr = &r_info[r_idx];
260259 #if 0
261260 /* Analyze "coin" monsters */
262261 if (r_ptr->d_char == '$')
--- TinyAngband/trunk/src/files.c (revision 1871)
+++ TinyAngband/trunk/src/files.c (revision 1872)
@@ -6538,10 +6538,9 @@
65386538 */
65396539 static void handle_signal_abort(int sig)
65406540 {
6541- int wid, hgt, rows;
6541+ int wid, hgt;
65426542
65436543 Term_get_size(&wid, &hgt);
6544- rows = hgt - 4;
65456544
65466545 /* Disable handler */
65476546 (void)signal(sig, SIG_IGN);
--- TinyAngband/trunk/src/monster1.c (revision 1871)
+++ TinyAngband/trunk/src/monster1.c (revision 1872)
@@ -2143,7 +2143,7 @@
21432143 if ((cheat_know) && (remem == 0))
21442144 {
21452145 /* Hack -- restore memory */
2146- COPY(r_ptr, &save_mem, monster_race);
2146+ (void)COPY(r_ptr, &save_mem, monster_race);
21472147 }
21482148 }
21492149
--- TinyAngband/trunk/src/spells1.c (revision 1871)
+++ TinyAngband/trunk/src/spells1.c (revision 1872)
@@ -5343,6 +5343,8 @@
53435343 }
53445344 }
53455345
5346+ /* Unused value (suppress warning) */
5347+ (void)get_damage;
53465348
53475349 /* Disturb */
53485350 disturb(1, 0);
--- TinyAngband/trunk/src/init2.c (revision 1871)
+++ TinyAngband/trunk/src/init2.c (revision 1872)
@@ -1407,7 +1407,7 @@
14071407 for (i = 1; i < max_r_idx; i++)
14081408 {
14091409 elements[i].tag = r_info[i].level;
1410- elements[i].pointer = (void*)i;
1410+ elements[i].index = i;
14111411 }
14121412
14131413 tag_sort(elements, max_r_idx);
@@ -1424,7 +1424,7 @@
14241424 for (i = 1; i < max_r_idx; i++)
14251425 {
14261426 /* Get the i'th race */
1427- r_ptr = &r_info[(int)elements[i].pointer];
1427+ r_ptr = &r_info[elements[i].index];
14281428
14291429 /* Count valid pairs */
14301430 if (r_ptr->rarity)
@@ -1438,7 +1438,7 @@
14381438 p = (100 / r_ptr->rarity);
14391439
14401440 /* Load the entry */
1441- alloc_race_table[i].index = (int)elements[i].pointer;
1441+ alloc_race_table[i].index = elements[i].index;
14421442 alloc_race_table[i].level = x;
14431443 alloc_race_table[i].prob1 = p;
14441444 alloc_race_table[i].prob2 = p;
--- TinyAngband/trunk/src/types.h (revision 1871)
+++ TinyAngband/trunk/src/types.h (revision 1872)
@@ -1288,7 +1288,7 @@
12881288 struct tag_type
12891289 {
12901290 int tag;
1291- void *pointer;
1291+ int index;
12921292 };
12931293
12941294 typedef bool (*monster_hook_type)(int r_idx);
--- TinyAngband/trunk/src/cave.c (revision 1871)
+++ TinyAngband/trunk/src/cave.c (revision 1872)
@@ -1942,33 +1942,33 @@
19421942 for (y = 0; y < (hgt + 2); y++)
19431943 {
19441944 /* Free one row each array */
1945- C_FREE(ma[y], (wid + 2), byte);
1946- C_FREE(mc[y], (wid + 2), char);
1947- C_FREE(mp[y], (wid + 2), byte);
1948- C_FREE(match_autopick_yx[y], (wid + 2), int);
1949- C_FREE(object_autopick_yx[y], (wid + 2), object_type **);
1945+ C_KILL(ma[y], (wid + 2), byte);
1946+ C_KILL(mc[y], (wid + 2), char);
1947+ C_KILL(mp[y], (wid + 2), byte);
1948+ C_KILL(match_autopick_yx[y], (wid + 2), int);
1949+ C_KILL(object_autopick_yx[y], (wid + 2), object_type *);
19501950 }
19511951
19521952 /* Free each line map */
1953- C_FREE(ma, (hgt + 2), byte_ptr);
1954- C_FREE(mc, (hgt + 2), char_ptr);
1955- C_FREE(mp, (hgt + 2), byte_ptr);
1956- C_FREE(match_autopick_yx, (hgt + 2), sint_ptr);
1957- C_FREE(object_autopick_yx, (hgt + 2), object_type **);
1953+ C_KILL(ma, (hgt + 2), byte_ptr);
1954+ C_KILL(mc, (hgt + 2), char_ptr);
1955+ C_KILL(mp, (hgt + 2), byte_ptr);
1956+ C_KILL(match_autopick_yx, (hgt + 2), sint_ptr);
1957+ C_KILL(object_autopick_yx, (hgt + 2), object_type **);
19581958
19591959 /* Free each line map */
19601960 for (y = 0; y < (cur_hgt + 2); y++)
19611961 {
19621962 /* Free one row each array */
1963- C_FREE(bigma[y], (cur_wid + 2), byte);
1964- C_FREE(bigmc[y], (cur_wid + 2), char);
1965- C_FREE(bigmp[y], (cur_wid + 2), byte);
1963+ C_KILL(bigma[y], (cur_wid + 2), byte);
1964+ C_KILL(bigmc[y], (cur_wid + 2), char);
1965+ C_KILL(bigmp[y], (cur_wid + 2), byte);
19661966 }
19671967
19681968 /* Free each line map */
1969- C_FREE(bigma, (cur_hgt + 2), byte_ptr);
1970- C_FREE(bigmc, (cur_hgt + 2), char_ptr);
1971- C_FREE(bigmp, (cur_hgt + 2), byte_ptr);
1969+ C_KILL(bigma, (cur_hgt + 2), byte_ptr);
1970+ C_KILL(bigmc, (cur_hgt + 2), char_ptr);
1971+ C_KILL(bigmp, (cur_hgt + 2), byte_ptr);
19721972 }
19731973
19741974
--- TinyAngband/trunk/src/load.c (revision 1871)
+++ TinyAngband/trunk/src/load.c (revision 1872)
@@ -80,6 +80,7 @@
8080 static byte *obj_mem;
8181
8282
83+#if 0
8384 /*
8485 * This function determines if the version of the savefile
8586 * currently being read is older than version "x.y.z".
@@ -102,6 +103,7 @@
102103 /* Identical versions */
103104 return (FALSE);
104105 }
106+#endif
105107
106108
107109 /*
@@ -1979,7 +1981,7 @@
19791981 }
19801982
19811983 /* Free array for object memories */
1982- C_FREE(obj_mem, tmp_k_idx, byte);
1984+ C_KILL(obj_mem, tmp_k_idx, byte);
19831985
19841986
19851987 /* Read the pet command settings */
--- TinyAngband/trunk/src/cmd1.c (revision 1871)
+++ TinyAngband/trunk/src/cmd1.c (revision 1872)
@@ -2820,7 +2820,7 @@
28202820 lite_spot(oy, ox);
28212821
28222822 /* Sound */
2823- /* sound(SOUND_WALK); /* Why disabled ? */
2823+ /* sound(SOUND_WALK); */ /* Why disabled ? */
28242824
28252825 /* Check for new panel (redraw map) */
28262826 verify_panel();
--- TinyAngband/trunk/src/object2.c (revision 1871)
+++ TinyAngband/trunk/src/object2.c (revision 1872)
@@ -1785,7 +1785,7 @@
17851785 void object_copy(const object_type *o_ptr, object_type *j_ptr)
17861786 {
17871787 /* Copy the structure */
1788- COPY(o_ptr, j_ptr, object_type);
1788+ (void)COPY(o_ptr, j_ptr, object_type);
17891789 }
17901790
17911791
--- TinyAngband/trunk/src/xtra1.c (revision 1871)
+++ TinyAngband/trunk/src/xtra1.c (revision 1872)
@@ -3650,7 +3650,6 @@
36503650 /* Specified weapons give extra bonuses when doing two handed combat. */
36513651 if (is_two_handed())
36523652 {
3653- object_type *o1_ptr = &inventory[INVEN_WIELD];
36543653 object_type *o2_ptr = &inventory[INVEN_ARM];
36553654
36563655 if ((o2_ptr->tval == TV_SWORD) && (o2_ptr->sval == SV_MAIN_GAUCHE))
--- TinyAngband/trunk/src/main-gcu.c (revision 1871)
+++ TinyAngband/trunk/src/main-gcu.c (revision 1872)
@@ -737,8 +737,7 @@
737737
738738 /* Make a noise */
739739 case TERM_XTRA_NOISE:
740- (void)write(1, "\007", 1);
741- return (0);
740+ return write(1, "\007", 1) != 1;
742741
743742 /* Flush the Curses buffer */
744743 case TERM_XTRA_FRESH:
--- TinyAngband/trunk/src/monster2.c (revision 1871)
+++ TinyAngband/trunk/src/monster2.c (revision 1872)
@@ -290,7 +290,7 @@
290290 if (p_ptr->health_who == i1) health_track(i2);
291291
292292 /* Structure copy */
293- COPY(&m_list[i2], &m_list[i1], monster_type);
293+ (void)COPY(&m_list[i2], &m_list[i1], monster_type);
294294
295295 /* Wipe the hole */
296296 (void) WIPE(&m_list[i1], monster_type);
--- TinyAngband/trunk/src/autopick.c (revision 1871)
+++ TinyAngband/trunk/src/autopick.c (revision 1872)
@@ -1042,10 +1042,10 @@
10421042 C_MAKE(autopick_list, max_max_autopick, autopick_type);
10431043
10441044 /* Copy from old list to new list */
1045- C_COPY(autopick_list, old_autopick_list, old_max_max_autopick, autopick_type);
1045+ (void)C_COPY(autopick_list, old_autopick_list, old_max_max_autopick, autopick_type);
10461046
10471047 /* Kill old list */
1048- C_FREE(old_autopick_list, old_max_max_autopick, autopick_type);
1048+ C_KILL(old_autopick_list, old_max_max_autopick, autopick_type);
10491049 }
10501050
10511051 /* Add one line */
@@ -1778,7 +1778,7 @@
17781778 }
17791779
17801780 /* Record name of destroyed item */
1781- COPY(&autopick_last_destroyed_object, o_ptr, object_type);
1781+ (void)COPY(&autopick_last_destroyed_object, o_ptr, object_type);
17821782
17831783 /* Destroy Later */
17841784 o_ptr->marked |= OM_AUTODESTROY;
@@ -3170,7 +3170,7 @@
31703170 string_free(lines_list[lines]);
31713171
31723172 /* free list of pointers */
3173- C_FREE((char **)lines_list, MAX_LINES, char *);
3173+ C_KILL(lines_list, MAX_LINES, cptr);
31743174 }
31753175
31763176
@@ -4826,7 +4826,7 @@
48264826 else state &= ~LSTAT_BYPASS;
48274827
48284828 /* Cannot use string_free() because the string was "destroyed" */
4829- C_FREE(s_keep, s_len + 1, char);
4829+ C_KILL(s_keep, s_len + 1, char);
48304830
48314831 /* Re-update this line's state */
48324832 tb->states[y] = state | LSTAT_EXPRESSION;
--- TinyAngband/trunk/src/init1.c (revision 1871)
+++ TinyAngband/trunk/src/init1.c (revision 1872)
@@ -331,7 +331,7 @@
331331 "DARKNESS",
332332 "TRAPS",
333333 "FORGET",
334- "XXX", /* "ANIM_DEAD", /* ToDo: Implement ANIM_DEAD */
334+ "XXX", /* "ANIM_DEAD", */ /* ToDo: Implement ANIM_DEAD */
335335 "S_KIN",
336336 "XXX", /* "S_CYBER", */
337337 "S_MONSTER",
--- TinyAngband/trunk/src/racial.c (revision 1871)
+++ TinyAngband/trunk/src/racial.c (revision 1872)
@@ -433,7 +433,7 @@
433433
434434 /* Confusion. */
435435 if (bash_quality + p_ptr->lev > randint1(200 + r_ptr->level * 4) &&
436- (!r_ptr->flags3 & (RF3_NO_CONF)))
436+ !(r_ptr->flags3 & (RF3_NO_CONF)))
437437 {
438438 #ifdef JP
439439 msg_format("%^sは混乱したようだ。", m_name);
Afficher sur ancien navigateur de dépôt.