From 1afe5916bb1a124a6b5d166333376704cc6b5416 Mon Sep 17 00:00:00 2001 From: Hourier Date: Mon, 13 Jan 2020 17:48:18 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#37353=20return=20=E3=81=AE?= =?utf8?q?=E7=9B=B4=E5=BE=8C=E3=81=AB=E3=81=82=E3=82=8B=E3=82=AB=E3=83=83?= =?utf8?q?=E3=82=B3=E3=82=92=E5=89=8A=E9=99=A4=20(-1=EF=BD=9E9=E3=81=AE?= =?utf8?q?=E3=81=BF)=20/=20Removed=20parenthesis=20right=20after=20'return?= =?utf8?q?'=20(only=20from=20-1=20to=209)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/bldg.c | 12 ++-- src/chuukei.c | 30 +++++----- src/cmd/cmd-dump.c | 10 ++-- src/combat/melee1.c | 4 +- src/dungeon-file.c | 148 ++++++++++++++++++++++++------------------------- src/files.c | 24 ++++---- src/geometry.c | 2 +- src/load.c | 10 ++-- src/main-win.c | 44 +++++++-------- src/monster2.c | 6 +- src/object-boost.c | 2 +- src/object1.c | 2 +- src/object2.c | 14 ++--- src/player-inventory.c | 8 +-- src/player-move.c | 12 ++-- src/racial.c | 2 +- src/report.c | 2 +- src/save.c | 2 +- src/scores.c | 14 ++--- src/store.c | 44 +++++++-------- src/util.c | 144 +++++++++++++++++++++++------------------------ src/wizard2.c | 8 +-- src/z-form.c | 8 +-- src/z-rand.c | 2 +- src/z-term.c | 126 ++++++++++++++++++++--------------------- src/z-virt.c | 4 +- 26 files changed, 342 insertions(+), 342 deletions(-) diff --git a/src/bldg.c b/src/bldg.c index 64b175512..fdabccfdb 100644 --- a/src/bldg.c +++ b/src/bldg.c @@ -2993,20 +2993,20 @@ static PRICE repair_broken_weapon_aux(player_type *player_ptr, PRICE bcost) OBJECT_IDX item; object_type *o_ptr; o_ptr = choose_object(player_ptr, &item, q, s, (USE_INVEN | USE_EQUIP), 0); - if (!o_ptr) return (0); + if (!o_ptr) return 0; /* It is worthless */ if (!object_is_ego(o_ptr) && !object_is_artifact(o_ptr)) { msg_format(_("それは直してもしょうがないぜ。", "It is worthless to repair.")); - return (0); + return 0; } /* They are too many */ if (o_ptr->number > 1) { msg_format(_("一度に複数を修復することはできません!", "They are too many to repair at once!")); - return (0); + return 0; } /* Display item name */ @@ -3023,11 +3023,11 @@ static PRICE repair_broken_weapon_aux(player_type *player_ptr, PRICE bcost) OBJECT_IDX mater; object_type *mo_ptr; mo_ptr = choose_object(player_ptr, &mater, q, s, (USE_INVEN | USE_EQUIP), 0); - if (!mo_ptr) return (0); + if (!mo_ptr) return 0; if (mater == item) { msg_print(_("クラインの壷じゃない!", "This is not a klein bottle!")); - return (0); + return 0; } /* Display item name */ @@ -3045,7 +3045,7 @@ static PRICE repair_broken_weapon_aux(player_type *player_ptr, PRICE bcost) object_desc(basenm, o_ptr, OD_NAME_ONLY); msg_format(_("%sを修復するだけのゴールドがありません!", "You do not have the gold to repair %s!"), basenm); msg_print(NULL); - return (0); + return 0; } player_ptr->total_weight -= o_ptr->weight; diff --git a/src/chuukei.c b/src/chuukei.c index d843f5f2d..b35deaf72 100644 --- a/src/chuukei.c +++ b/src/chuukei.c @@ -141,9 +141,9 @@ static errr init_buffer(void) ring.wptr = ring.rptr = ring.inlen = 0; fresh_queue.time[0] = 0; ring.buf = malloc(RINGBUF_SIZE); - if (ring.buf == NULL) return (-1); + if (ring.buf == NULL) return -1; - return (0); + return 0; } /* 現在の時間を100ms単位で取得する */ @@ -190,7 +190,7 @@ static errr insert_ringbuf(char *buf) close(sd); #endif - return (-1); + return -1; } /* バッファの終端までに収まる */ @@ -213,7 +213,7 @@ static errr insert_ringbuf(char *buf) ring.inlen += len; /* Success */ - return (0); + return 0; } #ifdef CHUUKEI @@ -308,7 +308,7 @@ static int read_chuukei_prf(concptr prf_name) path_build(buf, sizeof(buf), ANGBAND_DIR_XTRA, prf_name); fp = my_fopen(buf, "r"); - if (!fp) return (-1); + if (!fp) return -1; /* 初期化 */ server_port = -1; @@ -340,9 +340,9 @@ static int read_chuukei_prf(concptr prf_name) my_fclose(fp); /* prfファイルが完全でない */ - if (server_port == -1 || server_name[0] == 0) return (-1); + if (server_port == -1 || server_name[0] == 0) return -1; - return (0); + return 0; } int connect_chuukei_server(char *prf_name) @@ -360,20 +360,20 @@ int connect_chuukei_server(char *prf_name) if (read_chuukei_prf(prf_name) < 0) { printf("Wrong prf file\n"); - return (-1); + return -1; } if (init_buffer() < 0) { printf("Malloc error\n"); - return (-1); + return -1; } #ifdef WINDOWS if (WSAStartup(wVersionRequested, &wsaData)) { msg_print("Report: WSAStartup failed."); - return (-1); + return -1; } #endif @@ -389,7 +389,7 @@ int connect_chuukei_server(char *prf_name) if ((ask.sin_addr.s_addr=inet_addr(server_name)) == 0) { printf("Bad hostname\n"); - return (-1); + return -1; } } @@ -403,17 +403,17 @@ int connect_chuukei_server(char *prf_name) #endif { printf("Can't create socket\n"); - return (-1); + return -1; } if (connect(sd, (struct sockaddr *)&ask, sizeof(ask)) < 0) { close(sd); printf("Can't connect %s port %d\n", server_name, server_port); - return (-1); + return -1; } - return (0); + return 0; #else /* MACINTOSH */ OSStatus err; InetHostInfo response; @@ -425,7 +425,7 @@ int connect_chuukei_server(char *prf_name) if (read_chuukei_prf(prf_name) < 0){ printf("Wrong prf file\n"); - return (-1); + return -1; } init_buffer(); diff --git a/src/cmd/cmd-dump.c b/src/cmd/cmd-dump.c index 16e41f09c..5e1c8f92f 100644 --- a/src/cmd/cmd-dump.c +++ b/src/cmd/cmd-dump.c @@ -452,7 +452,7 @@ errr exe_write_diary(player_type *creature_ptr, int type, int num, concptr note) msg_format(_("%s を開くことができませんでした。プレイ記録を一時停止します。", "Failed to open %s. Play-Record is disabled temporarily."), buf); msg_format(NULL); disable_diary=TRUE; - return (-1); + return -1; } q_idx = quest_number(creature_ptr, creature_ptr->current_floor_ptr->dun_level); @@ -744,7 +744,7 @@ errr exe_write_diary(player_type *creature_ptr, int type, int num, concptr note) if (do_level) write_level = FALSE; - return (0); + return 0; } @@ -1398,7 +1398,7 @@ static errr macro_dump(concptr fname) FILE_TYPE(FILE_TYPE_TEXT); /* Append to the file */ - if (!open_auto_dump(buf, mark)) return (-1); + if (!open_auto_dump(buf, mark)) return -1; /* Start dumping */ auto_dump_printf(_("\n# 自動マクロセーブ\n\n", "\n# Automatic macro dump\n\n")); @@ -1423,7 +1423,7 @@ static errr macro_dump(concptr fname) } close_auto_dump(); - return (0); + return 0; } @@ -1575,7 +1575,7 @@ static errr keymap_dump(concptr fname) } close_auto_dump(); - return (0); + return 0; } diff --git a/src/combat/melee1.c b/src/combat/melee1.c index ec8e40eb6..b1eaae7a6 100644 --- a/src/combat/melee1.c +++ b/src/combat/melee1.c @@ -977,10 +977,10 @@ static int monster_critical(DICE_NUMBER dice, DICE_SID sides, HIT_POINT dam) { /* Must do at least 95% of perfect */ int total = dice * sides; - if (dam < total * 19 / 20) return (0); + if (dam < total * 19 / 20) return 0; /* Weak blows rarely work */ - if ((dam < 20) && (randint0(100) >= dam)) return (0); + if ((dam < 20) && (randint0(100) >= dam)) return 0; /* Perfect damage */ int max = 0; diff --git a/src/dungeon-file.c b/src/dungeon-file.c index 0fe170cf2..72274e1a6 100644 --- a/src/dungeon-file.c +++ b/src/dungeon-file.c @@ -1257,10 +1257,10 @@ errr parse_v_info(char *buf, header *head) i = atoi(buf + 2); /* Verify information */ - if (i <= error_idx) return (4); + if (i <= error_idx) return 4; /* Verify information */ - if (i >= head->info_num) return (2); + if (i >= head->info_num) return 2; /* Save the index */ error_idx = i; @@ -1269,11 +1269,11 @@ errr parse_v_info(char *buf, header *head) v_ptr = &v_info[i]; /* Store the name */ - if (!add_name(&v_ptr->name, head, s)) return (7); + if (!add_name(&v_ptr->name, head, s)) return 7; } /* There better be a current v_ptr */ - else if (!v_ptr) return (3); + else if (!v_ptr) return 3; /* Process 'D' for "Description" */ else if (buf[0] == 'D') @@ -1282,7 +1282,7 @@ errr parse_v_info(char *buf, header *head) s = buf + 2; /* Store the text */ - if (!add_text(&v_ptr->text, head, s, FALSE)) return (7); + if (!add_text(&v_ptr->text, head, s, FALSE)) return 7; } /* Process 'X' for "Extra info" (one line only) */ @@ -1301,7 +1301,7 @@ errr parse_v_info(char *buf, header *head) v_ptr->wid = (POSITION)wid; } - else return (6); + else return 6; /* Success */ return 0; @@ -1330,10 +1330,10 @@ errr parse_s_info(char *buf, header *head) i = atoi(buf + 2); /* Verify information */ - if (i <= error_idx) return (4); + if (i <= error_idx) return 4; /* Verify information */ - if (i >= head->info_num) return (2); + if (i >= head->info_num) return 2; /* Save the index */ error_idx = i; @@ -1343,7 +1343,7 @@ errr parse_s_info(char *buf, header *head) } /* There better be a current s_ptr */ - else if (!s_ptr) return (3); + else if (!s_ptr) return 3; /* Process 'W' for "Weapon exp" */ else if (buf[0] == 'W') @@ -1360,7 +1360,7 @@ errr parse_s_info(char *buf, header *head) &tval, &sval, &start, &max)) return 1; if (start < EXP_LEVEL_UNSKILLED || start > EXP_LEVEL_MASTER - || max < EXP_LEVEL_UNSKILLED || max > EXP_LEVEL_MASTER) return (8); + || max < EXP_LEVEL_UNSKILLED || max > EXP_LEVEL_MASTER) return 8; /* Save the values */ s_ptr->w_start[tval][sval] = exp_conv_table[start]; @@ -1377,7 +1377,7 @@ errr parse_s_info(char *buf, header *head) &num, &start, &max)) return 1; if (start < WEAPON_EXP_UNSKILLED || start > WEAPON_EXP_MASTER - || max < WEAPON_EXP_UNSKILLED || max > WEAPON_EXP_MASTER) return (8); + || max < WEAPON_EXP_UNSKILLED || max > WEAPON_EXP_MASTER) return 8; /* Save the values */ s_ptr->s_start[num] = (SUB_EXP)start; @@ -1385,7 +1385,7 @@ errr parse_s_info(char *buf, header *head) } - else return (6); + else return 6; /* Success */ return 0; @@ -1419,10 +1419,10 @@ errr parse_m_info(char *buf, header *head) i = atoi(buf + 2); /* Verify information */ - if (i <= error_idx) return (4); + if (i <= error_idx) return 4; /* Verify information */ - if (i >= head->info_num) return (2); + if (i >= head->info_num) return 2; /* Save the index */ error_idx = i; @@ -1432,7 +1432,7 @@ errr parse_m_info(char *buf, header *head) } /* There better be a current m_ptr */ - else if (!m_ptr) return (3); + else if (!m_ptr) return 3; /* Process 'I' for "Info" (one line only) */ else if (buf[0] == 'I') @@ -1456,7 +1456,7 @@ errr parse_m_info(char *buf, header *head) else if (streq(book, "MUSIC")) m_ptr->spell_book = TV_MUSIC_BOOK; else if (streq(book, "HISSATSU")) m_ptr->spell_book = TV_HISSATSU_BOOK; else if (streq(book, "NONE")) m_ptr->spell_book = 0; - else return (5); + else return 5; stat = s; @@ -1475,7 +1475,7 @@ errr parse_m_info(char *buf, header *head) else if (streq(stat, "DEX")) m_ptr->spell_stat = A_DEX; else if (streq(stat, "CON")) m_ptr->spell_stat = A_CON; else if (streq(stat, "CHR")) m_ptr->spell_stat = A_CHR; - else return (5); + else return 5; /* Scan for the values */ @@ -1514,7 +1514,7 @@ errr parse_m_info(char *buf, header *head) m_ptr->info[realm][magic_idx].sexp = (EXP)exp; magic_idx++; } - else return (6); + else return 6; return 0; } @@ -1622,10 +1622,10 @@ errr parse_f_info(char *buf, header *head) i = atoi(buf + 2); /* Verify information */ - if (i <= error_idx) return (4); + if (i <= error_idx) return 4; /* Verify information */ - if (i >= head->info_num) return (2); + if (i >= head->info_num) return 2; /* Save the index */ error_idx = i; @@ -1637,7 +1637,7 @@ errr parse_f_info(char *buf, header *head) if (s) { /* Store the tag */ - if (!add_tag(&f_ptr->tag, head, s)) return (7); + if (!add_tag(&f_ptr->tag, head, s)) return 7; } /* Default "mimic" */ @@ -1651,13 +1651,13 @@ errr parse_f_info(char *buf, header *head) } /* There better be a current f_ptr */ - else if (!f_ptr) return (3); + else if (!f_ptr) return 3; #ifdef JP else if (buf[0] == 'J') { /* Store the name */ - if (!add_name(&f_ptr->name, head, buf + 2)) return (7); + if (!add_name(&f_ptr->name, head, buf + 2)) return 7; } else if (buf[0] == 'E') @@ -1676,7 +1676,7 @@ errr parse_f_info(char *buf, header *head) s = buf + 2; /* Store the name */ - if (!add_name(&f_ptr->name, head, s)) return (7); + if (!add_name(&f_ptr->name, head, s)) return 7; } #endif @@ -1861,7 +1861,7 @@ errr parse_f_info(char *buf, header *head) f_ptr->state[i].result_tag = offset; } } - else return (6); + else return 6; return 0; } @@ -2039,10 +2039,10 @@ errr parse_k_info(char *buf, header *head) i = atoi(buf + 2); /* Verify information */ - if (i <= error_idx) return (4); + if (i <= error_idx) return 4; /* Verify information */ - if (i >= head->info_num) return (2); + if (i >= head->info_num) return 2; /* Save the index */ error_idx = i; @@ -2064,16 +2064,16 @@ errr parse_k_info(char *buf, header *head) *flavor++ = '\0'; /* Store the flavor */ - if (!add_name(&k_ptr->flavor_name, head, flavor)) return (7); + if (!add_name(&k_ptr->flavor_name, head, flavor)) return 7; } /* Store the name */ - if (!add_name(&k_ptr->name, head, s)) return (7); + if (!add_name(&k_ptr->name, head, s)) return 7; #endif } /* There better be a current k_ptr */ - else if (!k_ptr) return (3); + else if (!k_ptr) return 3; #ifdef JP @@ -2101,11 +2101,11 @@ errr parse_k_info(char *buf, header *head) *flavor++ = '\0'; /* Store the flavor */ - if (!add_name(&k_ptr->flavor_name, head, flavor)) return (7); + if (!add_name(&k_ptr->flavor_name, head, flavor)) return 7; } /* Store the name */ - if (!add_name(&k_ptr->name, head, s)) return (7); + if (!add_name(&k_ptr->name, head, s)) return 7; } #endif @@ -2125,7 +2125,7 @@ errr parse_k_info(char *buf, header *head) #endif /* Store the text */ - if (!add_text(&k_ptr->text, head, s, TRUE)) return (7); + if (!add_text(&k_ptr->text, head, s, TRUE)) return 7; } /* Process 'G' for "Graphics" (one line only) */ @@ -2238,7 +2238,7 @@ errr parse_k_info(char *buf, header *head) } else { - return (5); + return 5; } } @@ -2259,13 +2259,13 @@ errr parse_k_info(char *buf, header *head) } /* Parse this entry */ - if (0 != grab_one_kind_flag(k_ptr, s)) return (5); + if (0 != grab_one_kind_flag(k_ptr, s)) return 5; /* Start the next entry */ s = t; } } - else return (6); + else return 6; return 0; } @@ -2331,10 +2331,10 @@ errr parse_a_info(char *buf, header *head) i = atoi(buf + 2); /* Verify information */ - if (i < error_idx) return (4); + if (i < error_idx) return 4; /* Verify information */ - if (i >= head->info_num) return (2); + if (i >= head->info_num) return 2; /* Save the index */ error_idx = i; @@ -2349,12 +2349,12 @@ errr parse_a_info(char *buf, header *head) add_flag(a_ptr->flags, TR_IGNORE_COLD); #ifdef JP /* Store the name */ - if (!add_name(&a_ptr->name, head, s)) return (7); + if (!add_name(&a_ptr->name, head, s)) return 7; #endif } /* There better be a current a_ptr */ - else if (!a_ptr) return (3); + else if (!a_ptr) return 3; #ifdef JP @@ -2371,7 +2371,7 @@ errr parse_a_info(char *buf, header *head) s = buf + 2; /* Store the name */ - if (!add_name(&a_ptr->name, head, s)) return (7); + if (!add_name(&a_ptr->name, head, s)) return 7; } #endif @@ -2391,7 +2391,7 @@ errr parse_a_info(char *buf, header *head) #endif /* Store the text */ - if (!add_text(&a_ptr->text, head, s, TRUE)) return (7); + if (!add_text(&a_ptr->text, head, s, TRUE)) return 7; } @@ -2455,7 +2455,7 @@ errr parse_a_info(char *buf, header *head) } else { - return (5); + return 5; } } @@ -2476,13 +2476,13 @@ errr parse_a_info(char *buf, header *head) } /* Parse this entry */ - if (0 != grab_one_artifact_flag(a_ptr, s)) return (5); + if (0 != grab_one_artifact_flag(a_ptr, s)) return 5; /* Start the next entry */ s = t; } } - else return (6); + else return 6; return 0; } @@ -2554,10 +2554,10 @@ errr parse_e_info(char *buf, header *head) i = atoi(buf + 2); /* Verify information */ - if (i < error_idx) return (4); + if (i < error_idx) return 4; /* Verify information */ - if (i >= head->info_num) return (2); + if (i >= head->info_num) return 2; /* Save the index */ error_idx = i; @@ -2566,12 +2566,12 @@ errr parse_e_info(char *buf, header *head) e_ptr = &e_info[i]; #ifdef JP /* Store the name */ - if (!add_name(&e_ptr->name, head, s)) return (7); + if (!add_name(&e_ptr->name, head, s)) return 7; #endif } /* There better be a current e_ptr */ - else if (!e_ptr) return (3); + else if (!e_ptr) return 3; #ifdef JP @@ -2588,7 +2588,7 @@ errr parse_e_info(char *buf, header *head) s = buf + 2; /* Store the name */ - if (!add_name(&e_ptr->name, head, s)) return (7); + if (!add_name(&e_ptr->name, head, s)) return 7; } #endif #if 0 @@ -2600,7 +2600,7 @@ errr parse_e_info(char *buf, header *head) s = buf + 2; /* Store the text */ - if (!add_text(&e_ptr->text, head, s, TRUE)) return (7); + if (!add_text(&e_ptr->text, head, s, TRUE)) return 7; } #endif @@ -2662,7 +2662,7 @@ errr parse_e_info(char *buf, header *head) } else { - return (5); + return 5; } } @@ -2683,13 +2683,13 @@ errr parse_e_info(char *buf, header *head) } /* Parse this entry */ - if (0 != grab_one_ego_item_flag(e_ptr, s)) return (5); + if (0 != grab_one_ego_item_flag(e_ptr, s)) return 5; /* Start the next entry */ s = t; } } - else return (6); + else return 6; return 0; } @@ -2786,10 +2786,10 @@ errr parse_r_info(char *buf, header *head) i = atoi(buf + 2); /* Verify information */ - if (i < error_idx) return (4); + if (i < error_idx) return 4; /* Verify information */ - if (i >= head->info_num) return (2); + if (i >= head->info_num) return 2; /* Save the index */ error_idx = i; @@ -2798,12 +2798,12 @@ errr parse_r_info(char *buf, header *head) r_ptr = &r_info[i]; #ifdef JP /* Store the name */ - if (!add_name(&r_ptr->name, head, s)) return (7); + if (!add_name(&r_ptr->name, head, s)) return 7; #endif } /* There better be a current r_ptr */ - else if (!r_ptr) return (3); + else if (!r_ptr) return 3; #ifdef JP @@ -2815,7 +2815,7 @@ errr parse_r_info(char *buf, header *head) s = buf + 2; /* Store the name */ - if (!add_name(&r_ptr->E_name, head, s)) return (7); + if (!add_name(&r_ptr->E_name, head, s)) return 7; } #else else if (buf[0] == 'E') @@ -2824,7 +2824,7 @@ errr parse_r_info(char *buf, header *head) s = buf + 2; /* Store the name */ - if (!add_name(&r_ptr->name, head, s)) return (7); + if (!add_name(&r_ptr->name, head, s)) return 7; } #endif /* Process 'D' for "Description" */ @@ -2843,7 +2843,7 @@ errr parse_r_info(char *buf, header *head) #endif /* Store the text */ - if (!add_text(&r_ptr->text, head, s, TRUE)) return (7); + if (!add_text(&r_ptr->text, head, s, TRUE)) return 7; } /* Process 'G' for "Graphics" (one line only) */ @@ -2999,7 +2999,7 @@ errr parse_r_info(char *buf, header *head) } /* Parse this entry */ - if (0 != grab_one_basic_flag(r_ptr, s)) return (5); + if (0 != grab_one_basic_flag(r_ptr, s)) return 5; /* Start the next entry */ s = t; @@ -3034,7 +3034,7 @@ errr parse_r_info(char *buf, header *head) } /* Parse this entry */ - if (0 != grab_one_spell_flag(r_ptr, s)) return (5); + if (0 != grab_one_spell_flag(r_ptr, s)) return 5; /* Start the next entry */ s = t; @@ -3065,7 +3065,7 @@ errr parse_r_info(char *buf, header *head) if (3 != sscanf(buf + 2, "%d", &val)) return 1; r_ptr->arena_ratio = (PERCENTAGE)val; } - else return (6); + else return 6; return 0; } @@ -3179,10 +3179,10 @@ errr parse_d_info(char *buf, header *head) i = atoi(buf + 2); /* Verify information */ - if (i < error_idx) return (4); + if (i < error_idx) return 4; /* Verify information */ - if (i >= head->info_num) return (2); + if (i >= head->info_num) return 2; /* Save the index */ error_idx = i; @@ -3191,7 +3191,7 @@ errr parse_d_info(char *buf, header *head) d_ptr = &d_info[i]; #ifdef JP /* Store the name */ - if (!add_name(&d_ptr->name, head, s)) return (7); + if (!add_name(&d_ptr->name, head, s)) return 7; #endif } @@ -3204,7 +3204,7 @@ errr parse_d_info(char *buf, header *head) s = buf + 2; /* Store the name */ - if (!add_name(&d_ptr->name, head, s)) return (7); + if (!add_name(&d_ptr->name, head, s)) return 7; } #endif @@ -3224,7 +3224,7 @@ errr parse_d_info(char *buf, header *head) #endif /* Store the text */ - if (!add_text(&d_ptr->text, head, s, TRUE)) return (7); + if (!add_text(&d_ptr->text, head, s, TRUE)) return 7; } /* Process 'W' for "More Info" (one line only) */ @@ -3378,7 +3378,7 @@ errr parse_d_info(char *buf, header *head) } /* Parse this entry */ - if (0 != grab_one_dungeon_flag(d_ptr, s)) return (5); + if (0 != grab_one_dungeon_flag(d_ptr, s)) return 5; /* Start the next entry */ s = t; @@ -3416,7 +3416,7 @@ errr parse_d_info(char *buf, header *head) } /* Parse this entry */ - if (0 != grab_one_basic_monster_flag(d_ptr, s)) return (5); + if (0 != grab_one_basic_monster_flag(d_ptr, s)) return 5; /* Start the next entry */ s = t; @@ -3448,13 +3448,13 @@ errr parse_d_info(char *buf, header *head) } /* Parse this entry */ - if (0 != grab_one_spell_monster_flag(d_ptr, s)) return (5); + if (0 != grab_one_spell_monster_flag(d_ptr, s)) return 5; /* Start the next entry */ s = t; } } - else return (6); + else return 6; return 0; } @@ -4813,7 +4813,7 @@ errr process_dungeon_file(player_type *player_ptr, concptr name, int ymin, int x fp = my_fopen(buf, "r"); /* No such file */ - if (!fp) return (-1); + if (!fp) return -1; /* Process the file */ int num = -1; diff --git a/src/files.c b/src/files.c index ad6fc96b6..997491851 100644 --- a/src/files.c +++ b/src/files.c @@ -1116,7 +1116,7 @@ static errr process_pref_file_aux(player_type *creature_ptr, concptr name, int p fp = my_fopen(name, "r"); /* No such file */ - if (!fp) return (-1); + if (!fp) return -1; /* Process the file */ char buf[1024]; @@ -1292,19 +1292,19 @@ errr check_time(void) struct tm *tp; /* No restrictions */ - if (!check_time_flag) return (0); + if (!check_time_flag) return 0; /* Check for time violation */ c = time((time_t *)0); tp = localtime(&c); /* Violation */ - if (days[tp->tm_wday][tp->tm_hour + 4] != 'X') return (1); + if (days[tp->tm_wday][tp->tm_hour + 4] != 'X') return 1; #endif /* Success */ - return (0); + return 0; } @@ -1326,7 +1326,7 @@ errr check_time_init(void) fp = my_fopen(buf, "r"); /* No file, no restrictions */ - if (!fp) return (0); + if (!fp) return 0; /* Assume restrictions */ check_time_flag = TRUE; @@ -1354,7 +1354,7 @@ errr check_time_init(void) #endif /* Success */ - return (0); + return 0; } @@ -1407,7 +1407,7 @@ errr check_load(void) struct statstime st; /* Success if not checking */ - if (!check_load_value) return (0); + if (!check_load_value) return 0; /* Check the load */ if (0 == rstat("localhost", &st)) @@ -1416,13 +1416,13 @@ errr check_load(void) long val2 = (long)(check_load_value)* FSCALE; /* Check for violation */ - if (val1 >= val2) return (1); + if (val1 >= val2) return 1; } #endif /* Success */ - return (0); + return 0; } @@ -1449,7 +1449,7 @@ errr check_load_init(void) fp = my_fopen(buf, "r"); /* No file, no restrictions */ - if (!fp) return (0); + if (!fp) return 0; /* Default load */ check_load_value = 100; @@ -1482,7 +1482,7 @@ errr check_load_init(void) #endif /* Success */ - return (0); + return 0; } @@ -4913,7 +4913,7 @@ errr file_character(player_type *creature_ptr, concptr name) (void)inkey(); /* Error */ - return (-1); + return -1; } (void)make_character_dump(creature_ptr, fff); diff --git a/src/geometry.c b/src/geometry.c index 6dbb03c2b..4ab44b3b3 100644 --- a/src/geometry.c +++ b/src/geometry.c @@ -106,7 +106,7 @@ DIRECTION coords_to_dir(player_type *creature_ptr, POSITION y, POSITION x) dy = y - creature_ptr->y; dx = x - creature_ptr->x; - if (ABS(dx) > 1 || ABS(dy) > 1) return (0); + if (ABS(dx) > 1 || ABS(dy) > 1) return 0; return d[dx + 1][dy + 1]; } diff --git a/src/load.c b/src/load.c index ac6d9b0ab..1f45bf2f7 100644 --- a/src/load.c +++ b/src/load.c @@ -1463,7 +1463,7 @@ static errr rd_store(int town_number, int store_number) } /* Success */ - return (0); + return 0; } @@ -2485,7 +2485,7 @@ static errr rd_inventory(void) } /* Success */ - return (0); + return 0; } @@ -2960,7 +2960,7 @@ static errr rd_dungeon_old(player_type *creature_ptr) current_world_ptr->character_dungeon = TRUE; /* Success */ - return (0); + return 0; } @@ -3996,7 +3996,7 @@ static errr rd_savefile_new_aux(player_type *creature_ptr) #endif /* Success */ - return (0); + return 0; } /*! @@ -4015,7 +4015,7 @@ errr rd_savefile_new(void) /* Drop permissions */ safe_setuid_drop(); - if (!fff) return (-1); + if (!fff) return -1; /* Call the sub-function */ err = rd_savefile_new_aux(p_ptr); diff --git a/src/main-win.c b/src/main-win.c index 1e04f3980..745436b04 100644 --- a/src/main-win.c +++ b/src/main-win.c @@ -1990,7 +1990,7 @@ static errr term_force_font(term_data *td, concptr path) td->font_id = CreateFontIndirect(&(td->lf)); wid = td->lf.lfWidth; hgt = td->lf.lfHeight; - if (!td->font_id) return (1); + if (!td->font_id) return 1; #else /* Forget old font */ if (td->font_file) @@ -2023,7 +2023,7 @@ static errr term_force_font(term_data *td, concptr path) } /* No path given */ - if (!path) return (1); + if (!path) return 1; /* Local copy */ strcpy(buf, path); @@ -2032,13 +2032,13 @@ static errr term_force_font(term_data *td, concptr path) base = analyze_font(buf, &wid, &hgt); /* Verify suffix */ - if (!suffix(base, ".FON")) return (1); + if (!suffix(base, ".FON")) return 1; /* Verify file */ - if (!check_file(buf)) return (1); + if (!check_file(buf)) return 1; /* Load the new font */ - if (!AddFontResource(buf)) return (1); + if (!AddFontResource(buf)) return 1; /* Save new font name */ td->font_file = string_make(base); @@ -2077,7 +2077,7 @@ static errr term_force_font(term_data *td, concptr path) td->font_hgt = hgt; /* Success */ - return (0); + return 0; } @@ -2258,7 +2258,7 @@ static errr Term_user_win(int n) (void)n; /* Success */ - return (0); + return 0; } @@ -2415,7 +2415,7 @@ static errr Term_xtra_win_react(void) /* Success */ - return (0); + return 0; } @@ -2468,7 +2468,7 @@ static errr Term_xtra_win_flush(void) } /* Success */ - return (0); + return 0; } @@ -2515,7 +2515,7 @@ static errr Term_xtra_win_clear(void) static errr Term_xtra_win_noise(void) { MessageBeep(MB_ICONASTERISK); - return (0); + return 0; } @@ -2530,10 +2530,10 @@ static errr Term_xtra_win_sound(int v) #endif /* USE_SOUND */ /* Sound disabled */ - if (!use_sound) return (1); + if (!use_sound) return 1; /* Illegal sound */ - if ((v < 0) || (v >= SOUND_MAX)) return (1); + if ((v < 0) || (v >= SOUND_MAX)) return 1; #ifdef USE_SOUND @@ -2545,7 +2545,7 @@ static errr Term_xtra_win_sound(int v) } /* No sample */ - if (i == 0) return (1); + if (i == 0) return 1; /* Build the path */ path_build(buf, 1024, ANGBAND_DIR_XTRA_SOUND, sound_file[v][Rand_external(i)]); @@ -2564,7 +2564,7 @@ static errr Term_xtra_win_sound(int v) #else /* USE_SOUND */ - return (1); + return 1; #endif /* USE_SOUND */ } @@ -2586,10 +2586,10 @@ static errr Term_xtra_win_music(int n, int v) mciSendCommand(mop.wDeviceID, MCI_CLOSE, 0, 0); } - if(!use_music) return (1); + if(!use_music) return 1; /* Illegal sound */ - if(n == TERM_XTRA_MUSIC_BASIC && ((v < 0) || (v >= MUSIC_BASIC_MAX))) return (1); + if(n == TERM_XTRA_MUSIC_BASIC && ((v < 0) || (v >= MUSIC_BASIC_MAX))) return 1; else if(v < 0 || v >= 1000) return(1); /*!< TODO */ #ifdef USE_MUSIC @@ -2613,7 +2613,7 @@ static errr Term_xtra_win_music(int n, int v) /* No sample */ if (i == 0) { - return (1); + return 1; } switch(n) @@ -2634,7 +2634,7 @@ static errr Term_xtra_win_music(int n, int v) if(current_music_type == n && current_music_id == v) { - return (0); + return 0; } current_music_type = n; current_music_id = v; @@ -2648,13 +2648,13 @@ static errr Term_xtra_win_music(int n, int v) mciSendCommand(mop.wDeviceID, MCI_OPEN, MCI_OPEN_TYPE | MCI_OPEN_ELEMENT, (DWORD)&mop); mciSendCommand(mop.wDeviceID, MCI_SEEK, MCI_SEEK_TO_START, 0); mciSendCommand(mop.wDeviceID, MCI_PLAY, MCI_NOTIFY, (DWORD)&mop); - return (0); + return 0; #endif /* WIN32 */ #else /* USE_MUSIC */ - return (1); + return 1; #endif /* USE_MUSIC */ @@ -2694,7 +2694,7 @@ static int Term_xtra_win_delay(int v) #endif /* WIN32 */ /* Success */ - return (0); + return 0; } @@ -5820,7 +5820,7 @@ int FAR PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, DispatchMessage(&msg); } quit(NULL); - return (0); + return 0; } diff --git a/src/monster2.c b/src/monster2.c index 79330e937..c04100322 100644 --- a/src/monster2.c +++ b/src/monster2.c @@ -472,7 +472,7 @@ MONSTER_IDX m_pop(void) if (current_world_ptr->character_dungeon) msg_print(_("モンスターが多すぎる!", "Too many monsters!")); /* Try not to crash */ - return (0); + return 0; } @@ -1080,7 +1080,7 @@ errr get_mon_num_prep(monsterrace_hook_type monster_hook, } /* Success */ - return (0); + return 0; } @@ -1204,7 +1204,7 @@ MONRACE_IDX get_mon_num(DEPTH level) } /* No legal monsters */ - if (total <= 0) return (0); + if (total <= 0) return 0; /* Pick a monster */ value = randint0(total); diff --git a/src/object-boost.c b/src/object-boost.c index ca35b4ed5..487cac83b 100644 --- a/src/object-boost.c +++ b/src/object-boost.c @@ -80,7 +80,7 @@ int m_bonus(int max, DEPTH level) value = randnor(bonus, stand); /* Enforce the minimum value */ - if (value < 0) return (0); + if (value < 0) return 0; /* Enforce the maximum value */ if (value > max) return (max); diff --git a/src/object1.c b/src/object1.c index b36703622..ef571e3be 100644 --- a/src/object1.c +++ b/src/object1.c @@ -1403,7 +1403,7 @@ s16b wield_slot(player_type *owner_ptr, object_type *o_ptr) } /* No slot available */ - return (-1); + return -1; } /*! diff --git a/src/object2.c b/src/object2.c index 4e37facaf..48e2b7cdc 100644 --- a/src/object2.c +++ b/src/object2.c @@ -409,7 +409,7 @@ OBJECT_IDX get_obj_num(player_type *owner_ptr, DEPTH level, BIT_FLAGS mode) } /* No legal objects */ - if (total <= 0) return (0); + if (total <= 0) return 0; /* Pick an object */ @@ -1504,7 +1504,7 @@ bool object_similar(object_type *o_ptr, object_type *j_ptr) if (!max_num) return FALSE; /* Maximal "stacking" limit */ - if (total > max_num) return (0); + if (total > max_num) return 0; /* They match, so they must be similar */ @@ -1612,7 +1612,7 @@ KIND_OBJECT_IDX lookup_kind(OBJECT_TYPE_VALUE tval, OBJECT_SUBTYPE_VALUE sval) #endif - return (0); + return 0; } @@ -4235,7 +4235,7 @@ OBJECT_IDX drop_near(player_type *owner_ptr, object_type *j_ptr, PERCENTAGE chan if (current_world_ptr->wizard) msg_print(_("(破損)", "(breakage)")); /* Failure */ - return (0); + return 0; } @@ -4333,7 +4333,7 @@ OBJECT_IDX drop_near(player_type *owner_ptr, object_type *j_ptr, PERCENTAGE chan if (current_world_ptr->wizard) msg_print(_("(床スペースがない)", "(no floor space)")); /* Failure */ - return (0); + return 0; } @@ -4975,7 +4975,7 @@ s16b inven_carry(player_type *owner_ptr, object_type *o_ptr) } } - if (owner_ptr->inven_cnt > INVEN_PACK) return (-1); + if (owner_ptr->inven_cnt > INVEN_PACK) return -1; /* Find an empty slot */ for (j = 0; j <= INVEN_PACK; j++) @@ -5076,7 +5076,7 @@ INVENTORY_IDX inven_takeoff(player_type *owner_ptr, INVENTORY_IDX item, ITEM_NUM /* Get the item to take off */ o_ptr = &owner_ptr->inventory_list[item]; - if (amt <= 0) return (-1); + if (amt <= 0) return -1; /* Verify */ if (amt > o_ptr->number) amt = o_ptr->number; diff --git a/src/player-inventory.c b/src/player-inventory.c index c90a926db..d383539e1 100644 --- a/src/player-inventory.c +++ b/src/player-inventory.c @@ -39,12 +39,12 @@ static INVENTORY_IDX label_to_equip(player_type* owner_ptr, int c) INVENTORY_IDX i = (INVENTORY_IDX)(islower(c) ? A2I(c) : -1) + INVEN_RARM; /* Verify the index */ - if ((i < INVEN_RARM) || (i >= INVEN_TOTAL)) return (-1); + if ((i < INVEN_RARM) || (i >= INVEN_TOTAL)) return -1; if (select_ring_slot) return is_ring_slot(i) ? i : -1; /* Empty slots can never be chosen */ - if (!owner_ptr->inventory_list[i].k_idx) return (-1); + if (!owner_ptr->inventory_list[i].k_idx) return -1; return i; } @@ -63,10 +63,10 @@ static INVENTORY_IDX label_to_inven(player_type* owner_ptr, int c) INVENTORY_IDX i = (INVENTORY_IDX)(islower(c) ? A2I(c) : -1); /* Verify the index */ - if ((i < 0) || (i > INVEN_PACK)) return (-1); + if ((i < 0) || (i > INVEN_PACK)) return -1; /* Empty slots can never be chosen */ - if (!owner_ptr->inventory_list[i].k_idx) return (-1); + if (!owner_ptr->inventory_list[i].k_idx) return -1; return i; } diff --git a/src/player-move.c b/src/player-move.c index 024c94c81..59a5a1d39 100644 --- a/src/player-move.c +++ b/src/player-move.c @@ -1849,7 +1849,7 @@ static DIRECTION travel_test(player_type *creature_ptr, DIRECTION prev_dir) if (creature_ptr->blind || no_lite(creature_ptr)) { msg_print(_("目が見えない!", "You cannot see!")); - return (0); + return 0; } /* break run when leaving trap detected region */ @@ -1871,7 +1871,7 @@ static DIRECTION travel_test(player_type *creature_ptr, DIRECTION prev_dir) if (disturb_trap_detect) { /* Break Run */ - return (0); + return 0; } } } @@ -1898,7 +1898,7 @@ static DIRECTION travel_test(player_type *creature_ptr, DIRECTION prev_dir) monster_type *m_ptr = &floor_ptr->m_list[g_ptr->m_idx]; /* Visible monster */ - if (m_ptr->ml) return (0); + if (m_ptr->ml) return 0; } } @@ -1919,16 +1919,16 @@ static DIRECTION travel_test(player_type *creature_ptr, DIRECTION prev_dir) } } - if (!new_dir) return (0); + if (!new_dir) return 0; /* Access newly move grid */ g_ptr = &floor_ptr->grid_array[creature_ptr->y+ddy[new_dir]][creature_ptr->x+ddx[new_dir]]; /* Close door abort traveling */ - if (!easy_open && is_closed_door(g_ptr->feat)) return (0); + if (!easy_open && is_closed_door(g_ptr->feat)) return 0; /* Visible and unignorable trap abort tarveling */ - if (!g_ptr->mimic && !trap_can_be_ignored(creature_ptr, g_ptr->feat)) return (0); + if (!g_ptr->mimic && !trap_can_be_ignored(creature_ptr, g_ptr->feat)) return 0; /* Move new grid */ return new_dir; diff --git a/src/racial.c b/src/racial.c index 03b39c23f..dcaceadcc 100644 --- a/src/racial.c +++ b/src/racial.c @@ -261,7 +261,7 @@ static PERCENTAGE racial_chance(player_type *creature_ptr, power_desc_type *pd_p /* No chance for success */ if ((creature_ptr->lev < min_level) || creature_ptr->confused) { - return (0); + return 0; } if (difficulty == 0) return 100; diff --git a/src/report.c b/src/report.c index 95b62f413..6f02e4820 100644 --- a/src/report.c +++ b/src/report.c @@ -324,7 +324,7 @@ static errr make_dump(player_type *creature_ptr, BUF* dumpbuf) fd_kill(file_name); /* Success */ - return (0); + return 0; } diff --git a/src/save.c b/src/save.c index d80611d13..76b548757 100644 --- a/src/save.c +++ b/src/save.c @@ -450,7 +450,7 @@ static errr wr_randomizer(void) wr_u32b(Rand_state[i]); } - return (0); + return 0; } diff --git a/src/scores.c b/src/scores.c index ef4c81191..0592e1db4 100644 --- a/src/scores.c +++ b/src/scores.c @@ -78,10 +78,10 @@ static int highscore_write(high_score *score) static int highscore_where(high_score *score) { /* Paranoia -- it may not have opened */ - if (highscore_fd < 0) return (-1); + if (highscore_fd < 0) return -1; /* Go to the start of the highscore file */ - if (highscore_seek(0)) return (-1); + if (highscore_seek(0)) return -1; /* Read until we get to a higher score */ high_score the_score; @@ -107,13 +107,13 @@ static int highscore_where(high_score *score) static int highscore_add(high_score *score) { /* Paranoia -- it may not have opened */ - if (highscore_fd < 0) return (-1); + if (highscore_fd < 0) return -1; /* Determine where the score should go */ int slot = highscore_where(score); /* Hack -- Not on the list */ - if (slot < 0) return (-1); + if (slot < 0) return -1; /* Hack -- prepare to dump the new score */ high_score the_score = (*score); @@ -124,12 +124,12 @@ static int highscore_add(high_score *score) for (int i = slot; !done && (i < MAX_HISCORES); i++) { /* Read the old guy, note errors */ - if (highscore_seek(i)) return (-1); + if (highscore_seek(i)) return -1; if (highscore_read(&tmpscore)) done = TRUE; /* Back up and dump the score we were holding */ - if (highscore_seek(i)) return (-1); - if (highscore_write(&the_score)) return (-1); + if (highscore_seek(i)) return -1; + if (highscore_write(&the_score)) return -1; /* Hack -- Save the old score, for the next pass */ the_score = tmpscore; diff --git a/src/store.c b/src/store.c index bc98f4ad9..995f22a72 100644 --- a/src/store.c +++ b/src/store.c @@ -2447,47 +2447,47 @@ static bool store_object_similar(object_type *o_ptr, object_type *j_ptr) int i; /* Hack -- Identical items cannot be stacked */ - if (o_ptr == j_ptr) return (0); + if (o_ptr == j_ptr) return 0; /* Different objects cannot be stacked */ - if (o_ptr->k_idx != j_ptr->k_idx) return (0); + if (o_ptr->k_idx != j_ptr->k_idx) return 0; /* Different charges (etc) cannot be stacked, unless wands or rods. */ - if ((o_ptr->pval != j_ptr->pval) && (o_ptr->tval != TV_WAND) && (o_ptr->tval != TV_ROD)) return (0); + if ((o_ptr->pval != j_ptr->pval) && (o_ptr->tval != TV_WAND) && (o_ptr->tval != TV_ROD)) return 0; /* Require many identical values */ - if (o_ptr->to_h != j_ptr->to_h) return (0); - if (o_ptr->to_d != j_ptr->to_d) return (0); - if (o_ptr->to_a != j_ptr->to_a) return (0); + if (o_ptr->to_h != j_ptr->to_h) return 0; + if (o_ptr->to_d != j_ptr->to_d) return 0; + if (o_ptr->to_a != j_ptr->to_a) return 0; /* Require identical "ego-item" names */ - if (o_ptr->name2 != j_ptr->name2) return (0); + if (o_ptr->name2 != j_ptr->name2) return 0; /* Artifacts don't stack! */ - if (object_is_artifact(o_ptr) || object_is_artifact(j_ptr)) return (0); + if (object_is_artifact(o_ptr) || object_is_artifact(j_ptr)) return 0; /* Hack -- Identical art_flags! */ for (i = 0; i < TR_FLAG_SIZE; i++) - if (o_ptr->art_flags[i] != j_ptr->art_flags[i]) return (0); + if (o_ptr->art_flags[i] != j_ptr->art_flags[i]) return 0; /* Hack -- Never stack "powerful" items */ - if (o_ptr->xtra1 || j_ptr->xtra1) return (0); + if (o_ptr->xtra1 || j_ptr->xtra1) return 0; /* Hack -- Never stack recharging items */ - if (o_ptr->timeout || j_ptr->timeout) return (0); + if (o_ptr->timeout || j_ptr->timeout) return 0; /* Require many identical values */ - if (o_ptr->ac != j_ptr->ac) return (0); - if (o_ptr->dd != j_ptr->dd) return (0); - if (o_ptr->ds != j_ptr->ds) return (0); + if (o_ptr->ac != j_ptr->ac) return 0; + if (o_ptr->dd != j_ptr->dd) return 0; + if (o_ptr->ds != j_ptr->ds) return 0; /* Hack -- Never stack chests */ - if (o_ptr->tval == TV_CHEST) return (0); - if (o_ptr->tval == TV_STATUE) return (0); - if (o_ptr->tval == TV_CAPTURE) return (0); + if (o_ptr->tval == TV_CHEST) return 0; + if (o_ptr->tval == TV_STATUE) return 0; + if (o_ptr->tval == TV_CAPTURE) return 0; /* Require matching discounts */ - if (o_ptr->discount != j_ptr->discount) return (0); + if (o_ptr->discount != j_ptr->discount) return 0; /* They match, so they must be similar */ return TRUE; @@ -3079,12 +3079,12 @@ static int home_carry(object_type *o_ptr) /* No space? */ if ((cur_store_num != STORE_HOME) || (powerup_home == TRUE)) { if (st_ptr->stock_num >= st_ptr->stock_size) { - return (-1); + return -1; } } else{ if (st_ptr->stock_num >= ((st_ptr->stock_size) / 10)) { - return (-1); + return -1; } } @@ -3143,7 +3143,7 @@ static int store_carry(object_type *o_ptr) value = object_value(o_ptr); /* Cursed/Worthless items "disappear" when sold */ - if (value <= 0) return (-1); + if (value <= 0) return -1; /* All store items are fully *identified* */ o_ptr->ident |= IDENT_MENTAL; @@ -3172,7 +3172,7 @@ static int store_carry(object_type *o_ptr) } /* No space? */ - if (st_ptr->stock_num >= st_ptr->stock_size) return (-1); + if (st_ptr->stock_num >= st_ptr->stock_size) return -1; /* Check existing slots to see if we must "slide" */ diff --git a/src/util.c b/src/util.c index 2d8fdc6f1..aaaae3da9 100644 --- a/src/util.c +++ b/src/util.c @@ -159,9 +159,9 @@ int stricmp(concptr a, concptr b) { z1 = FORCEUPPER(*s1); z2 = FORCEUPPER(*s2); - if (z1 < z2) return (-1); - if (z1 > z2) return (1); - if (!z1) return (0); + if (z1 < z2) return -1; + if (z1 > z2) return 1; + if (!z1) return 0; } } @@ -319,13 +319,13 @@ errr path_parse(char *buf, int max, concptr file) buf[0] = '\0'; /* No file? */ - if (!file) return (-1); + if (!file) return -1; /* File needs no parsing */ if (file[0] != '~') { (void)strnfmt(buf, max, "%s", file); - return (0); + return 0; } /* Point at the user */ @@ -335,7 +335,7 @@ errr path_parse(char *buf, int max, concptr file) s = my_strstr(u, PATH_SEP); /* Hack -- no long user names */ - if (s && (s >= u + sizeof(user))) return (1); + if (s && (s >= u + sizeof(user))) return 1; /* Extract a user name */ if (s) @@ -354,14 +354,14 @@ errr path_parse(char *buf, int max, concptr file) else pw = getpwuid(getuid()); /* Nothing found? */ - if (!pw) return (1); + if (!pw) return 1; /* Make use of the info */ if (s) strnfmt(buf, max, "%s%s", pw->pw_dir, s); else strnfmt(buf, max, "%s", pw->pw_dir); /* Success */ - return (0); + return 0; } @@ -385,7 +385,7 @@ errr path_parse(char *buf, int max, concptr file) #endif /* MAC_MPW && CARBON */ /* Success */ - return (0); + return 0; } @@ -406,7 +406,7 @@ static errr path_temp(char *buf, int max) /* Temp file */ s = tmpnam(NULL); - if (!s) return (-1); + if (!s) return -1; /* Format to length */ #if !defined(WIN32) || (defined(_MSC_VER) && (_MSC_VER >= 1900)) @@ -416,7 +416,7 @@ static errr path_temp(char *buf, int max) #endif /* Success */ - return (0); + return 0; } #endif @@ -470,7 +470,7 @@ errr path_build(char *buf, int max, concptr path, concptr file) } /* Success */ - return (0); + return 0; } @@ -509,13 +509,13 @@ FILE *my_fopen(concptr file, concptr mode) errr my_fclose(FILE *fff) { /* Require a file */ - if (!fff) return (-1); + if (!fff) return -1; /* Close, check for error */ - if (fclose(fff) == EOF) return (1); + if (fclose(fff) == EOF) return 1; /* Success */ - return (0); + return 0; } @@ -594,7 +594,7 @@ errr my_fgets(FILE *fff, char *buf, huge n) buf[i] = '\0'; /* Success */ - return (0); + return 0; } /* Handle tabs */ @@ -639,14 +639,14 @@ errr my_fgets(FILE *fff, char *buf, huge n) buf[i] = '\0'; /* Success */ - return (0); + return 0; } /* Nothing */ buf[0] = '\0'; /* Failure */ - return (1); + return 1; } @@ -664,7 +664,7 @@ errr my_fputs(FILE *fff, concptr buf, huge n) (void)fprintf(fff, "%s\n", buf); /* Success */ - return (0); + return 0; } @@ -709,12 +709,12 @@ errr fd_kill(concptr file) char buf[1024]; /* Hack -- Try to parse the path */ - if (path_parse(buf, 1024, file)) return (-1); + if (path_parse(buf, 1024, file)) return -1; /* Remove */ (void)remove(buf); - return (0); + return 0; } @@ -727,15 +727,15 @@ errr fd_move(concptr file, concptr what) char aux[1024]; /* Hack -- Try to parse the path */ - if (path_parse(buf, 1024, file)) return (-1); + if (path_parse(buf, 1024, file)) return -1; /* Hack -- Try to parse the path */ - if (path_parse(aux, 1024, what)) return (-1); + if (path_parse(aux, 1024, what)) return -1; /* Rename */ (void)rename(buf, aux); - return (0); + return 0; } @@ -750,18 +750,18 @@ errr fd_copy(concptr file, concptr what) int src_fd, dst_fd; /* Hack -- Try to parse the path */ - if (path_parse(buf, 1024, file)) return (-1); + if (path_parse(buf, 1024, file)) return -1; /* Hack -- Try to parse the path */ - if (path_parse(aux, 1024, what)) return (-1); + if (path_parse(aux, 1024, what)) return -1; /* Open source file */ src_fd = fd_open(buf, O_RDONLY); - if (src_fd < 0) return (-1); + if (src_fd < 0) return -1; /* Open destination file */ dst_fd = fd_open(aux, O_WRONLY|O_TRUNC|O_CREAT); - if (dst_fd < 0) return (-1); + if (dst_fd < 0) return -1; /* Copy */ while ((read_num = read(src_fd, buf, 1024)) > 0) @@ -785,7 +785,7 @@ errr fd_copy(concptr file, concptr what) fd_close(src_fd); fd_close(dst_fd); - return (0); + return 0; } /* @@ -798,7 +798,7 @@ int fd_make(concptr file, BIT_FLAGS mode) char buf[1024]; /* Hack -- Try to parse the path */ - if (path_parse(buf, 1024, file)) return (-1); + if (path_parse(buf, 1024, file)) return -1; #if defined(MAC_MPW) || defined(MACH_O_CARBON) { @@ -828,7 +828,7 @@ int fd_open(concptr file, int flags) char buf[1024]; /* Hack -- Try to parse the path */ - if (path_parse(buf, 1024, file)) return (-1); + if (path_parse(buf, 1024, file)) return -1; /* Attempt to open the file */ return (open(buf, flags | O_BINARY, 0)); @@ -846,7 +846,7 @@ errr fd_lock(int fd, int what) what = what ? what : 0; /* Verify the fd */ - if (fd < 0) return (-1); + if (fd < 0) return -1; #ifdef SET_UID @@ -865,7 +865,7 @@ errr fd_lock(int fd, int what) else { /* Lock the score file */ - if (lockf(fd, F_LOCK, 0) != 0) return (1); + if (lockf(fd, F_LOCK, 0) != 0) return 1; } # endif @@ -885,7 +885,7 @@ errr fd_lock(int fd, int what) else { /* Lock the score file */ - if (flock(fd, LOCK_EX) != 0) return (1); + if (flock(fd, LOCK_EX) != 0) return 1; } # endif @@ -895,7 +895,7 @@ errr fd_lock(int fd, int what) #endif /* Success */ - return (0); + return 0; } @@ -907,16 +907,16 @@ errr fd_seek(int fd, huge n) huge p; /* Verify fd */ - if (fd < 0) return (-1); + if (fd < 0) return -1; /* Seek to the given position */ p = lseek(fd, n, SEEK_SET); /* Failure */ - if (p != n) return (1); + if (p != n) return 1; /* Success */ - return (0); + return 0; } @@ -929,7 +929,7 @@ errr fd_chop(int fd, huge n) n = n ? n : 0; /* Verify the fd */ - if (fd < 0) return (-1); + if (fd < 0) return -1; #if defined(ULTRIX) || defined(NeXT) /* Truncate */ @@ -937,7 +937,7 @@ errr fd_chop(int fd, huge n) #endif /* Success */ - return (0); + return 0; } @@ -947,7 +947,7 @@ errr fd_chop(int fd, huge n) errr fd_read(int fd, char *buf, huge n) { /* Verify the fd */ - if (fd < 0) return (-1); + if (fd < 0) return -1; #ifndef SET_UID @@ -955,7 +955,7 @@ errr fd_read(int fd, char *buf, huge n) while (n >= 16384) { /* Read a piece */ - if (read(fd, buf, 16384) != 16384) return (1); + if (read(fd, buf, 16384) != 16384) return 1; /* Shorten the task */ buf += 16384; @@ -967,10 +967,10 @@ errr fd_read(int fd, char *buf, huge n) #endif /* Read the final piece */ - if (read(fd, buf, n) != (int)n) return (1); + if (read(fd, buf, n) != (int)n) return 1; /* Success */ - return (0); + return 0; } @@ -980,7 +980,7 @@ errr fd_read(int fd, char *buf, huge n) errr fd_write(int fd, concptr buf, huge n) { /* Verify the fd */ - if (fd < 0) return (-1); + if (fd < 0) return -1; #ifndef SET_UID @@ -988,7 +988,7 @@ errr fd_write(int fd, concptr buf, huge n) while (n >= 16384) { /* Write a piece */ - if (write(fd, buf, 16384) != 16384) return (1); + if (write(fd, buf, 16384) != 16384) return 1; /* Shorten the task */ buf += 16384; @@ -1000,10 +1000,10 @@ errr fd_write(int fd, concptr buf, huge n) #endif /* Write the final piece */ - if (write(fd, buf, n) != (int)n) return (1); + if (write(fd, buf, n) != (int)n) return 1; /* Success */ - return (0); + return 0; } @@ -1013,12 +1013,12 @@ errr fd_write(int fd, concptr buf, huge n) errr fd_close(int fd) { /* Verify the fd */ - if (fd < 0) return (-1); + if (fd < 0) return -1; /* Close */ (void)close(fd); - return (0); + return 0; } @@ -1106,7 +1106,7 @@ static char hexify(uint i) static int deoct(char c) { if (isdigit(c)) return (D2I(c)); - return (0); + return 0; } /* @@ -1117,7 +1117,7 @@ static int dehex(char c) if (isdigit(c)) return (D2I(c)); if (islower(c)) return (A2I(c) + 10); if (isupper(c)) return (A2I(tolower(c)) + 10); - return (0); + return 0; } @@ -1131,9 +1131,9 @@ static int my_stricmp(concptr a, concptr b) { z1 = FORCEUPPER(*s1); z2 = FORCEUPPER(*s2); - if (z1 < z2) return (-1); - if (z1 > z2) return (1); - if (!z1) return (0); + if (z1 < z2) return -1; + if (z1 > z2) return 1; + if (!z1) return 0; } } @@ -1147,9 +1147,9 @@ static int my_strnicmp(concptr a, concptr b, int n) { z1 = FORCEUPPER(*s1); z2 = FORCEUPPER(*s2); - if (z1 < z2) return (-1); - if (z1 > z2) return (1); - if (!z1) return (0); + if (z1 < z2) return -1; + if (z1 > z2) return 1; + if (!z1) return 0; } return 0; } @@ -1561,7 +1561,7 @@ sint macro_find_exact(concptr pat) /* Nothing possible */ if (!macro__use[(byte)(pat[0])]) { - return (-1); + return -1; } /* Scan the macros */ @@ -1575,7 +1575,7 @@ sint macro_find_exact(concptr pat) } /* No matches */ - return (-1); + return -1; } @@ -1589,7 +1589,7 @@ static sint macro_find_check(concptr pat) /* Nothing possible */ if (!macro__use[(byte)(pat[0])]) { - return (-1); + return -1; } /* Scan the macros */ @@ -1603,7 +1603,7 @@ static sint macro_find_check(concptr pat) } /* Nothing */ - return (-1); + return -1; } @@ -1617,7 +1617,7 @@ static sint macro_find_maybe(concptr pat) /* Nothing possible */ if (!macro__use[(byte)(pat[0])]) { - return (-1); + return -1; } /* Scan the macros */ @@ -1634,7 +1634,7 @@ static sint macro_find_maybe(concptr pat) } /* Nothing */ - return (-1); + return -1; } @@ -1648,7 +1648,7 @@ static sint macro_find_ready(concptr pat) /* Nothing possible */ if (!macro__use[(byte)(pat[0])]) { - return (-1); + return -1; } /* Scan the macros */ @@ -1691,7 +1691,7 @@ errr macro_add(concptr pat, concptr act) /* Paranoia -- require data */ - if (!pat || !act) return (-1); + if (!pat || !act) return -1; /* Look for any existing macro */ @@ -1721,7 +1721,7 @@ errr macro_add(concptr pat, concptr act) macro__use[(byte)(pat[0])] = TRUE; /* Success */ - return (0); + return 0; } @@ -1999,7 +1999,7 @@ static char inkey_aux(void) while (p > 0) { /* Push the key, notice over-flow */ - if (Term_key_push(buf[--p])) return (0); + if (Term_key_push(buf[--p])) return 0; } /* Wait for (and remove) a pending key */ @@ -2020,7 +2020,7 @@ static char inkey_aux(void) while (p > n) { /* Push the key, notice over-flow */ - if (Term_key_push(buf[--p])) return (0); + if (Term_key_push(buf[--p])) return 0; } @@ -2028,7 +2028,7 @@ static char inkey_aux(void) parse_macro = TRUE; /* Push the "end of macro action" key */ - if (Term_key_push(30)) return (0); + if (Term_key_push(30)) return 0; /* Access the macro action */ @@ -2041,12 +2041,12 @@ static char inkey_aux(void) while (n > 0) { /* Push the key, notice over-flow */ - if (Term_key_push(act[--n])) return (0); + if (Term_key_push(act[--n])) return 0; } /* Hack -- Force "inkey()" to call us again */ - return (0); + return 0; } diff --git a/src/wizard2.c b/src/wizard2.c index 13dd3bfe4..f3f4db38b 100644 --- a/src/wizard2.c +++ b/src/wizard2.c @@ -748,7 +748,7 @@ static KIND_OBJECT_IDX wiz_create_itemtype(void) max_num = num; /* Choose! */ - if (!get_com("Get what type of object? ", &ch, FALSE)) return (0); + if (!get_com("Get what type of object? ", &ch, FALSE)) return 0; /* Analyze choice */ for (num = 0; num < max_num; num++) @@ -757,7 +757,7 @@ static KIND_OBJECT_IDX wiz_create_itemtype(void) } /* Bail out if choice is illegal */ - if ((num < 0) || (num >= max_num)) return (0); + if ((num < 0) || (num >= max_num)) return 0; /* Base object type chosen, fill in tval */ tval = tvals[num].tval; @@ -794,7 +794,7 @@ static KIND_OBJECT_IDX wiz_create_itemtype(void) max_num = num; /* Choose! */ - if (!get_com(format("What Kind of %s? ", tval_desc), &ch, FALSE)) return (0); + if (!get_com(format("What Kind of %s? ", tval_desc), &ch, FALSE)) return 0; /* Analyze choice */ for (num = 0; num < max_num; num++) @@ -803,7 +803,7 @@ static KIND_OBJECT_IDX wiz_create_itemtype(void) } /* Bail out if choice is "illegal" */ - if ((num < 0) || (num >= max_num)) return (0); + if ((num < 0) || (num >= max_num)) return 0; /* And return successful */ return (choice[num]); diff --git a/src/z-form.c b/src/z-form.c index db43884a4..8a624cfb2 100644 --- a/src/z-form.c +++ b/src/z-form.c @@ -351,7 +351,7 @@ uint vstrnfmt(char *buf, uint max, concptr fmt, va_list vp) buf[0] = '\0'; /* Return "error" */ - return (0); + return 0; } /* Error -- format sequence may be too long */ @@ -361,7 +361,7 @@ uint vstrnfmt(char *buf, uint max, concptr fmt, va_list vp) buf[0] = '\0'; /* Return "error" */ - return (0); + return 0; } /* Handle "alphabetic" chars */ @@ -384,7 +384,7 @@ uint vstrnfmt(char *buf, uint max, concptr fmt, va_list vp) buf[0] = '\0'; /* Return "error" */ - return (0); + return 0; } /* Handle normal end of format sequence */ @@ -588,7 +588,7 @@ uint vstrnfmt(char *buf, uint max, concptr fmt, va_list vp) buf[0] = '\0'; /* Return "error" */ - return (0); + return 0; } } diff --git a/src/z-rand.c b/src/z-rand.c index f160e549b..99b00268b 100644 --- a/src/z-rand.c +++ b/src/z-rand.c @@ -193,7 +193,7 @@ static s32b Rand_div_impl(s32b m, u32b* state) u32b ret; /* Hack -- simple case */ - if (m <= 1) return (0); + if (m <= 1) return 0; scaling = Rand_Xorshift_max / m; past = scaling * m; diff --git a/src/z-term.c b/src/z-term.c index 3222ef192..c5b6a42ab 100644 --- a/src/z-term.c +++ b/src/z-term.c @@ -317,7 +317,7 @@ static errr term_win_nuke(term_win *s, TERM_LEN w, TERM_LEN h) C_KILL(s->vtc, h * w, char); /* Success */ - return (0); + return 0; } @@ -356,7 +356,7 @@ static errr term_win_init(term_win *s, TERM_LEN w, TERM_LEN h) } /* Success */ - return (0); + return 0; } @@ -399,7 +399,7 @@ static errr term_win_copy(term_win *s, term_win *f, TERM_LEN w, TERM_LEN h) s->cv = f->cv; /* Success */ - return (0); + return 0; } @@ -413,7 +413,7 @@ static errr term_win_copy(term_win *s, term_win *f, TERM_LEN w, TERM_LEN h) errr Term_user(int n) { /* Verify the hook */ - if (!Term->user_hook) return (-1); + if (!Term->user_hook) return -1; /* Call the hook */ return ((*Term->user_hook)(n)); @@ -425,7 +425,7 @@ errr Term_user(int n) errr Term_xtra(int n, int v) { /* Verify the hook */ - if (!Term->xtra_hook) return (-1); + if (!Term->xtra_hook) return -1; /* Call the hook */ return ((*Term->xtra_hook)(n, v)); @@ -445,7 +445,7 @@ static errr Term_curs_hack(TERM_LEN x, TERM_LEN y) (void)x; (void)y; - return (-1); + return -1; } /* @@ -466,7 +466,7 @@ static errr Term_wipe_hack(TERM_LEN x, TERM_LEN y, int n) (void)y; (void)n; - return (-1); + return -1; } /* @@ -481,7 +481,7 @@ static errr Term_text_hack(TERM_LEN x, TERM_LEN y, int n, TERM_COLOR a, concptr (void)a; (void)cp; - return (-1); + return -1; } /* @@ -498,7 +498,7 @@ static errr Term_pict_hack(TERM_LEN x, TERM_LEN y, int n, const TERM_COLOR *ap, (void)tap; (void)tcp; - return (-1); + return -1; } @@ -1499,10 +1499,10 @@ errr Term_fresh(void) term_win *scr = Term->scr; /* Before initialize (Advice from Mr.shimitei)*/ - if (!old || !scr) return (1); + if (!old || !scr) return 1; /* Do nothing unless "mapped" */ - if (!Term->mapped_flag) return (1); + if (!Term->mapped_flag) return 1; /* Trivial Refresh */ @@ -1514,7 +1514,7 @@ errr Term_fresh(void) !(Term->total_erase)) { /* Nothing */ - return (1); + return 1; } @@ -1773,7 +1773,7 @@ errr Term_fresh(void) /* Success */ - return (0); + return 0; } @@ -1787,13 +1787,13 @@ errr Term_fresh(void) errr Term_set_cursor(int v) { /* Already done */ - if (Term->scr->cv == v) return (1); + if (Term->scr->cv == v) return 1; /* Change */ Term->scr->cv = (bool_hack)v; /* Success */ - return (0); + return 0; } @@ -1808,8 +1808,8 @@ errr Term_gotoxy(TERM_LEN x, TERM_LEN y) int h = Term->hgt; /* Verify */ - if ((x < 0) || (x >= w)) return (-1); - if ((y < 0) || (y >= h)) return (-1); + if ((x < 0) || (x >= w)) return -1; + if ((y < 0) || (y >= h)) return -1; /* Remember the cursor */ Term->scr->cx = (byte_hack)x; @@ -1819,7 +1819,7 @@ errr Term_gotoxy(TERM_LEN x, TERM_LEN y) Term->scr->cu = 0; /* Success */ - return (0); + return 0; } @@ -1833,8 +1833,8 @@ errr Term_draw(TERM_LEN x, TERM_LEN y, TERM_COLOR a, char c) int w = Term->wid; int h = Term->hgt; - if ((x < 0) || (x >= w)) return (-1); - if ((y < 0) || (y >= h)) return (-1); + if ((x < 0) || (x >= w)) return -1; + if ((y < 0) || (y >= h)) return -1; /* Paranoia -- illegal char */ if (!c) return (-2); @@ -1843,7 +1843,7 @@ errr Term_draw(TERM_LEN x, TERM_LEN y, TERM_COLOR a, char c) Term_queue_char(x, y, a, c, 0, 0); /* Success */ - return (0); + return 0; } @@ -1868,7 +1868,7 @@ errr Term_addch(TERM_COLOR a, char c) TERM_LEN w = Term->wid; /* Handle "unusable" cursor */ - if (Term->scr->cu) return (-1); + if (Term->scr->cu) return -1; /* Paranoia -- no illegal chars */ if (!c) return (-2); @@ -1880,13 +1880,13 @@ errr Term_addch(TERM_COLOR a, char c) Term->scr->cx++; /* Success */ - if (Term->scr->cx < w) return (0); + if (Term->scr->cx < w) return 0; /* Note "Useless" cursor */ Term->scr->cu = 1; /* Note "Useless" cursor */ - return (1); + return 1; } @@ -1903,7 +1903,7 @@ errr Term_add_bigch(TERM_COLOR a, char c) if (!use_bigtile) return Term_addch(a, c); /* Handle "unusable" cursor */ - if (Term->scr->cu) return (-1); + if (Term->scr->cu) return -1; /* Paranoia -- no illegal chars */ if (!c) return (-2); @@ -1915,13 +1915,13 @@ errr Term_add_bigch(TERM_COLOR a, char c) Term->scr->cx += 2; /* Success */ - if (Term->scr->cx < Term->wid) return (0); + if (Term->scr->cx < Term->wid) return 0; /* Note "Useless" cursor */ Term->scr->cu = 1; /* Note "Useless" cursor */ - return (1); + return 1; } @@ -1951,7 +1951,7 @@ errr Term_addstr(int n, TERM_COLOR a, concptr s) errr res = 0; /* Handle "unusable" cursor */ - if (Term->scr->cu) return (-1); + if (Term->scr->cu) return -1; /* Obtain maximal length */ k = (n < 0) ? (w + 1) : n; @@ -1990,7 +1990,7 @@ errr Term_putch(TERM_LEN x, TERM_LEN y, TERM_COLOR a, char c) if ((res = Term_addch(a, c)) != 0) return (res); /* Success */ - return (0); + return 0; } @@ -2008,7 +2008,7 @@ errr Term_putstr(TERM_LEN x, TERM_LEN y, int n, TERM_COLOR a, concptr s) if ((res = Term_addstr(n, a, s)) != 0) return (res); /* Success */ - return (0); + return 0; } #ifdef JP @@ -2040,7 +2040,7 @@ errr Term_putstr_v(TERM_LEN x, TERM_LEN y, int n, byte a, concptr s) } /* Success */ - return (0); + return 0; } #endif @@ -2067,7 +2067,7 @@ errr Term_erase(TERM_LEN x, TERM_LEN y, int n) char *scr_tcc; /* Place cursor */ - if (Term_gotoxy(x, y)) return (-1); + if (Term_gotoxy(x, y)) return -1; /* Force legal size */ if (x + n > w) n = w - x; @@ -2141,7 +2141,7 @@ errr Term_erase(TERM_LEN x, TERM_LEN y, int n) } /* Success */ - return (0); + return 0; } @@ -2198,7 +2198,7 @@ errr Term_clear(void) Term->total_erase = TRUE; /* Success */ - return (0); + return 0; } @@ -2217,7 +2217,7 @@ errr Term_redraw(void) Term_fresh(); /* Success */ - return (0); + return 0; } @@ -2287,7 +2287,7 @@ errr Term_redraw_section(TERM_LEN x1, TERM_LEN y1, TERM_LEN x2, TERM_LEN y2) Term_fresh(); /* Success */ - return (0); + return 0; } @@ -2304,7 +2304,7 @@ errr Term_get_cursor(int *v) (*v) = Term->scr->cv; /* Success */ - return (0); + return 0; } @@ -2318,7 +2318,7 @@ errr Term_get_size(TERM_LEN *w, TERM_LEN *h) (*h) = Term->hgt; /* Success */ - return (0); + return 0; } @@ -2332,10 +2332,10 @@ errr Term_locate(TERM_LEN *x, TERM_LEN *y) (*y) = Term->scr->cy; /* Warn about "useless" cursor */ - if (Term->scr->cu) return (1); + if (Term->scr->cu) return 1; /* Success */ - return (0); + return 0; } @@ -2349,15 +2349,15 @@ errr Term_what(TERM_LEN x, TERM_LEN y, TERM_COLOR *a, char *c) TERM_LEN w = Term->wid; TERM_LEN h = Term->hgt; - if ((x < 0) || (x >= w)) return (-1); - if ((y < 0) || (y >= h)) return (-1); + if ((x < 0) || (x >= w)) return -1; + if ((y < 0) || (y >= h)) return -1; /* Direct access */ (*a) = Term->scr->a[y][x]; (*c) = Term->scr->c[y][x]; /* Success */ - return (0); + return 0; } @@ -2377,7 +2377,7 @@ errr Term_flush(void) Term->key_head = Term->key_tail = 0; /* Success */ - return (0); + return 0; } @@ -2388,7 +2388,7 @@ errr Term_flush(void) errr Term_keypress(int k) { /* Hack -- Refuse to enqueue non-keys */ - if (!k) return (-1); + if (!k) return -1; /* Store the char, advance the queue */ Term->key_queue[Term->key_head++] = (char)k; @@ -2397,7 +2397,7 @@ errr Term_keypress(int k) if (Term->key_head == Term->key_size) Term->key_head = 0; /* Success (unless overflow) */ - if (Term->key_head != Term->key_tail) return (0); + if (Term->key_head != Term->key_tail) return 0; #if 0 /* Hack -- Forget the oldest key */ @@ -2405,7 +2405,7 @@ errr Term_keypress(int k) #endif /* Problem */ - return (1); + return 1; } @@ -2415,7 +2415,7 @@ errr Term_keypress(int k) errr Term_key_push(int k) { /* Hack -- Refuse to enqueue non-keys */ - if (!k) return (-1); + if (!k) return -1; /* Hack -- Overflow may induce circular queue */ if (Term->key_tail == 0) Term->key_tail = Term->key_size; @@ -2424,10 +2424,10 @@ errr Term_key_push(int k) Term->key_queue[--Term->key_tail] = (char)k; /* Success (unless overflow) */ - if (Term->key_head != Term->key_tail) return (0); + if (Term->key_head != Term->key_tail) return 0; /* Problem */ - return (1); + return 1; } @@ -2483,7 +2483,7 @@ errr Term_inkey(char *ch, bool wait, bool take) } /* No keys are ready */ - if (Term->key_head == Term->key_tail) return (1); + if (Term->key_head == Term->key_tail) return 1; /* Extract the next keypress */ (*ch) = Term->key_queue[Term->key_tail]; @@ -2492,7 +2492,7 @@ errr Term_inkey(char *ch, bool wait, bool take) if (take && (++Term->key_tail == Term->key_size)) Term->key_tail = 0; /* Success */ - return (0); + return 0; } @@ -2524,7 +2524,7 @@ errr Term_save(void) term_win_copy(Term->mem, Term->scr, w, h); /* Success */ - return (0); + return 0; } @@ -2566,7 +2566,7 @@ errr Term_load(void) Term->y2 = h - 1; /* Success */ - return (0); + return 0; } @@ -2611,7 +2611,7 @@ errr Term_exchange(void) Term->y2 = h - 1; /* Success */ - return (0); + return 0; } @@ -2634,15 +2634,15 @@ errr Term_resize(TERM_LEN w, TERM_LEN h) term_win *hold_tmp; /* Resizing is forbidden */ - if (Term->fixed_shape) return (-1); + if (Term->fixed_shape) return -1; /* Ignore illegal changes */ - if ((w < 1) || (h < 1)) return (-1); + if ((w < 1) || (h < 1)) return -1; /* Ignore non-changes */ if ((Term->wid == w) && (Term->hgt == h) && (arg_bigtile == use_bigtile)) - return (1); + return 1; use_bigtile = arg_bigtile; @@ -2792,7 +2792,7 @@ errr Term_resize(TERM_LEN w, TERM_LEN h) } /* Success */ - return (0); + return 0; } @@ -2809,7 +2809,7 @@ errr Term_resize(TERM_LEN w, TERM_LEN h) errr Term_activate(term *t) { /* Hack -- already done */ - if (Term == t) return (1); + if (Term == t) return 1; /* Deactivate the old Term */ if (Term) Term_xtra(TERM_XTRA_LEVEL, 0); @@ -2834,7 +2834,7 @@ errr Term_activate(term *t) if (Term) Term_xtra(TERM_XTRA_LEVEL, 1); /* Success */ - return (0); + return 0; } @@ -2902,7 +2902,7 @@ errr term_nuke(term *t) C_KILL(t->key_queue, t->key_size, char); /* Success */ - return (0); + return 0; } @@ -2984,7 +2984,7 @@ errr term_init(term *t, TERM_LEN w, TERM_LEN h, int k) /* Success */ - return (0); + return 0; } diff --git a/src/z-virt.c b/src/z-virt.c index 0858bdb3c..bd1559f8b 100644 --- a/src/z-virt.c +++ b/src/z-virt.c @@ -166,7 +166,7 @@ errr string_free(concptr str) huge len = 0; /* Succeed on non-strings */ - if (!str) return (0); + if (!str) return 0; /* Count the number of chars in 'str' plus the terminator */ while (str[len++]) /* loop */; @@ -175,7 +175,7 @@ errr string_free(concptr str) (void)rnfree((vptr)(str), len); /* Success */ - return (0); + return 0; } -- 2.11.0