diff options
author | Bardur Arantsson <bardur@scientician.net> | 2013-03-27 10:07:14 +0100 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2013-09-27 14:46:42 +0200 |
commit | 67dd3b38ff1311dbd3a37895f6bf0e81b0341bbf (patch) | |
tree | 002117e314058a77d28f9060a9b632a177a152d8 /src | |
parent | c8a1e6c1bb7bf1da89ccbe985173ec13b123b64a (diff) |
Eliminate pointless pointless fake_{name,text}_size globals
Diffstat (limited to 'src')
-rw-r--r-- | src/externs.h | 2 | ||||
-rw-r--r-- | src/init1.c | 80 | ||||
-rw-r--r-- | src/init2.c | 151 |
3 files changed, 76 insertions, 157 deletions
diff --git a/src/externs.h b/src/externs.h index 99792082..20f094dd 100644 --- a/src/externs.h +++ b/src/externs.h @@ -929,8 +929,6 @@ extern void init_angband(void); extern errr init_buildings(void); extern s16b error_idx; extern s16b error_line; -extern u32b fake_name_size; -extern u32b fake_text_size; /* joke.c */ extern bool_ gen_joke_monsters(void *data, void *in, void *out); diff --git a/src/init1.c b/src/init1.c index cc589bde..076ca70e 100644 --- a/src/init1.c +++ b/src/init1.c @@ -1934,7 +1934,7 @@ errr init_player_info_txt(FILE *fp, char *buf) rp_ptr = &race_info[i]; /* Hack -- Verify space */ - if (rp_head->name_size + strlen(s) + 8 > fake_name_size) return (7); + if (rp_head->name_size + strlen(s) + 8 > FAKE_NAME_SIZE) return (7); /* Advance and Save the name index */ if (!rp_ptr->title) rp_ptr->title = ++rp_head->name_size; @@ -1963,7 +1963,7 @@ errr init_player_info_txt(FILE *fp, char *buf) s = buf + 4; /* Hack -- Verify space */ - if (rp_head->text_size + strlen(s) + 8 > fake_text_size) return (7); + if (rp_head->text_size + strlen(s) + 8 > FAKE_TEXT_SIZE) return (7); /* Advance and Save the text index */ if (!rp_ptr->desc) @@ -2308,7 +2308,7 @@ errr init_player_info_txt(FILE *fp, char *buf) rmp_ptr = &race_mod_info[i]; /* Hack -- Verify space */ - if (rmp_head->name_size + strlen(s) + 8 > fake_name_size) return (7); + if (rmp_head->name_size + strlen(s) + 8 > FAKE_NAME_SIZE) return (7); /* Advance and Save the name index */ if (!rmp_ptr->title) rmp_ptr->title = ++rmp_head->name_size; @@ -2340,7 +2340,7 @@ errr init_player_info_txt(FILE *fp, char *buf) else rmp_ptr->place = FALSE; /* Hack -- Verify space */ - if (rmp_head->text_size + strlen(s) + 8 > fake_text_size) return (7); + if (rmp_head->text_size + strlen(s) + 8 > FAKE_TEXT_SIZE) return (7); /* Advance and Save the text index */ if (!rmp_ptr->desc) @@ -2722,7 +2722,7 @@ errr init_player_info_txt(FILE *fp, char *buf) c_ptr = &class_info[i]; /* Hack -- Verify space */ - if (c_head->name_size + strlen(s) + 8 > fake_name_size) return (7); + if (c_head->name_size + strlen(s) + 8 > FAKE_NAME_SIZE) return (7); /* Advance and Save the name index */ if (!c_ptr->title) c_ptr->title = ++c_head->name_size; @@ -2756,7 +2756,7 @@ errr init_player_info_txt(FILE *fp, char *buf) s = buf + 6; /* Hack -- Verify space */ - if (c_head->text_size + strlen(s) + 8 > fake_text_size) return (7); + if (c_head->text_size + strlen(s) + 8 > FAKE_TEXT_SIZE) return (7); switch (buf[4]) { @@ -3133,7 +3133,7 @@ errr init_player_info_txt(FILE *fp, char *buf) s_ptr = &c_ptr->spec[spec_idx]; /* Hack -- Verify space */ - if (c_head->name_size + strlen(s) + 8 > fake_name_size) return (7); + if (c_head->name_size + strlen(s) + 8 > FAKE_NAME_SIZE) return (7); /* Advance and Save the name index */ if (!s_ptr->title) s_ptr->title = ++c_head->name_size; @@ -3160,7 +3160,7 @@ errr init_player_info_txt(FILE *fp, char *buf) s = buf + 6; /* Hack -- Verify space */ - if (c_head->text_size + strlen(s) + 8 > fake_text_size) return (7); + if (c_head->text_size + strlen(s) + 8 > FAKE_TEXT_SIZE) return (7); /* Advance and Save the text index */ if (!s_ptr->desc) @@ -3501,7 +3501,7 @@ errr init_v_info_txt(FILE *fp, char *buf, bool_ start) v_ptr = &v_info[i]; /* Hack -- Verify space */ - if (v_head->name_size + strlen(s) + 8 > fake_name_size) return (7); + if (v_head->name_size + strlen(s) + 8 > FAKE_NAME_SIZE) return (7); /* Advance and Save the name index */ if (!v_ptr->name) v_ptr->name = ++v_head->name_size; @@ -3526,7 +3526,7 @@ errr init_v_info_txt(FILE *fp, char *buf, bool_ start) s = buf + 2; /* Hack -- Verify space */ - if (v_head->text_size + strlen(s) + 8 > fake_text_size) return (7); + if (v_head->text_size + strlen(s) + 8 > FAKE_TEXT_SIZE) return (7); /* Advance and Save the text index */ if (!v_ptr->text) v_ptr->text = ++v_head->text_size; @@ -3755,7 +3755,7 @@ errr init_f_info_txt(FILE *fp, char *buf) f_ptr = &f_info[i]; /* Hack -- Verify space */ - if (f_head->name_size + strlen(s) + 8 > fake_name_size) return (7); + if (f_head->name_size + strlen(s) + 8 > FAKE_NAME_SIZE) return (7); /* Advance and Save the name index */ if (!f_ptr->name) f_ptr->name = ++f_head->name_size; @@ -3788,7 +3788,7 @@ errr init_f_info_txt(FILE *fp, char *buf) s = buf + 4; /* Hack -- Verify space */ - if (f_head->text_size + strlen(s) + 8 > fake_text_size) return (7); + if (f_head->text_size + strlen(s) + 8 > FAKE_TEXT_SIZE) return (7); switch (buf[2]) { @@ -4188,7 +4188,7 @@ errr init_k_info_txt(FILE *fp, char *buf) k_ptr = &k_info[i]; /* Hack -- Verify space */ - if (k_head->name_size + strlen(s) + 8 > fake_name_size) return (7); + if (k_head->name_size + strlen(s) + 8 > FAKE_NAME_SIZE) return (7); /* Advance and Save the name index */ if (!k_ptr->name) k_ptr->name = ++k_head->name_size; @@ -4217,7 +4217,7 @@ errr init_k_info_txt(FILE *fp, char *buf) s = buf + 2; /* Hack -- Verify space */ - if (k_head->text_size + strlen(s) + 8 > fake_text_size) return (7); + if (k_head->text_size + strlen(s) + 8 > FAKE_TEXT_SIZE) return (7); /* Advance and Save the text index */ if (!k_ptr->text) k_ptr->text = ++k_head->text_size; @@ -4821,7 +4821,7 @@ errr init_al_info_txt(FILE *fp, char *buf) s = buf + 2; /* Hack -- Verify space */ - if (al_head->name_size + strlen(s) + 8 > fake_name_size) return (7); + if (al_head->name_size + strlen(s) + 8 > FAKE_NAME_SIZE) return (7); /* Advance and Save the name index */ a_ptr->item_descp = ++al_head->name_size; @@ -4843,7 +4843,7 @@ errr init_al_info_txt(FILE *fp, char *buf) s = buf + 2; /* Hack -- Verify space */ - if (al_head->name_size + strlen(s) + 8 > fake_name_size) return (7); + if (al_head->name_size + strlen(s) + 8 > FAKE_NAME_SIZE) return (7); /* Advance and Save the name index */ a_ptr->desc = ++al_head->name_size; @@ -4865,7 +4865,7 @@ errr init_al_info_txt(FILE *fp, char *buf) s = buf + 2; /* Hack -- Verify space */ - if (al_head->name_size + strlen(s) + 8 > fake_name_size) return (7); + if (al_head->name_size + strlen(s) + 8 > FAKE_NAME_SIZE) return (7); if (a_ptr->item_desc) return (7); @@ -5098,7 +5098,7 @@ errr init_a_info_txt(FILE *fp, char *buf) a_ptr = &a_info[i]; /* Hack -- Verify space */ - if (a_head->name_size + strlen(s) + 8 > fake_name_size) return (7); + if (a_head->name_size + strlen(s) + 8 > FAKE_NAME_SIZE) return (7); /* Advance and Save the name index */ if (!a_ptr->name) a_ptr->name = ++a_head->name_size; @@ -5140,7 +5140,7 @@ errr init_a_info_txt(FILE *fp, char *buf) s = buf + 2; /* Hack -- Verify space */ - if (a_head->text_size + strlen(s) + 8 > fake_text_size) return (7); + if (a_head->text_size + strlen(s) + 8 > FAKE_TEXT_SIZE) return (7); /* Advance and Save the text index */ if (!a_ptr->text) a_ptr->text = ++a_head->text_size; @@ -5440,7 +5440,7 @@ errr init_set_info_txt(FILE *fp, char *buf) set_ptr = &set_info[i]; /* Hack -- Verify space */ - if (set_head->name_size + strlen(s) + 8 > fake_name_size) return (7); + if (set_head->name_size + strlen(s) + 8 > FAKE_NAME_SIZE) return (7); /* Advance and Save the name index */ if (!set_ptr->name) set_ptr->name = ++set_head->name_size; @@ -5484,7 +5484,7 @@ errr init_set_info_txt(FILE *fp, char *buf) s = buf + 2; /* Hack -- Verify space */ - if (set_head->text_size + strlen(s) + 8 > fake_text_size) return (7); + if (set_head->text_size + strlen(s) + 8 > FAKE_TEXT_SIZE) return (7); /* Advance and Save the text index */ if (!set_ptr->desc) set_ptr->desc = ++set_head->text_size; @@ -5789,7 +5789,7 @@ errr init_s_info_txt(FILE *fp, char *buf) s_ptr = &s_info[i]; /* Hack -- Verify space */ - if (s_head->name_size + strlen(s) + 8 > fake_name_size) return (7); + if (s_head->name_size + strlen(s) + 8 > FAKE_NAME_SIZE) return (7); /* Advance and Save the name index */ if (!s_ptr->name) s_ptr->name = ++s_head->name_size; @@ -5823,7 +5823,7 @@ errr init_s_info_txt(FILE *fp, char *buf) s = buf + 2; /* Hack -- Verify space */ - if (s_head->text_size + strlen(s) + 8 > fake_text_size) return (7); + if (s_head->text_size + strlen(s) + 8 > FAKE_TEXT_SIZE) return (7); /* Advance and Save the text index */ if (!s_ptr->desc) @@ -5862,7 +5862,7 @@ errr init_s_info_txt(FILE *fp, char *buf) txt++; /* Hack -- Verify space */ - if (s_head->text_size + strlen(txt) + 8 > fake_text_size) return (7); + if (s_head->text_size + strlen(txt) + 8 > FAKE_TEXT_SIZE) return (7); /* Advance and Save the text index */ if (!s_ptr->action_desc) s_ptr->action_desc = ++s_head->text_size; @@ -6051,7 +6051,7 @@ errr init_ab_info_txt(FILE *fp, char *buf) ab_ptr = &ab_info[i]; /* Hack -- Verify space */ - if (ab_head->name_size + strlen(s) + 8 > fake_name_size) return (7); + if (ab_head->name_size + strlen(s) + 8 > FAKE_NAME_SIZE) return (7); /* Advance and Save the name index */ if (!ab_ptr->name) ab_ptr->name = ++ab_head->name_size; @@ -6090,7 +6090,7 @@ errr init_ab_info_txt(FILE *fp, char *buf) s = buf + 2; /* Hack -- Verify space */ - if (ab_head->text_size + strlen(s) + 8 > fake_text_size) return (7); + if (ab_head->text_size + strlen(s) + 8 > FAKE_TEXT_SIZE) return (7); /* Advance and Save the text index */ if (!ab_ptr->desc) @@ -6129,7 +6129,7 @@ errr init_ab_info_txt(FILE *fp, char *buf) txt++; /* Hack -- Verify space */ - if (ab_head->text_size + strlen(txt) + 8 > fake_text_size) return (7); + if (ab_head->text_size + strlen(txt) + 8 > FAKE_TEXT_SIZE) return (7); /* Advance and Save the text index */ if (!ab_ptr->action_desc) ab_ptr->action_desc = ++ab_head->text_size; @@ -6616,7 +6616,7 @@ errr init_e_info_txt(FILE *fp, char *buf) e_ptr = &e_info[i]; /* Hack -- Verify space */ - if (e_head->name_size + strlen(s) + 8 > fake_name_size) return (7); + if (e_head->name_size + strlen(s) + 8 > FAKE_NAME_SIZE) return (7); /* Advance and Save the name index */ if (!e_ptr->name) e_ptr->name = ++e_head->name_size; @@ -7549,7 +7549,7 @@ errr init_r_info_txt(FILE *fp, char *buf) r_ptr = &r_info[i]; /* Hack -- Verify space */ - if (r_head->name_size + strlen(s) + 8 > fake_name_size) return (7); + if (r_head->name_size + strlen(s) + 8 > FAKE_NAME_SIZE) return (7); /* Advance and Save the name index */ if (!r_ptr->name) r_ptr->name = ++r_head->name_size; @@ -7582,7 +7582,7 @@ errr init_r_info_txt(FILE *fp, char *buf) s = buf + 2; /* Hack -- Verify space */ - if (r_head->text_size + strlen(s) + 8 > fake_text_size) return (7); + if (r_head->text_size + strlen(s) + 8 > FAKE_TEXT_SIZE) return (7); /* Advance and Save the text index */ if (!r_ptr->text) r_ptr->text = ++r_head->text_size; @@ -8192,7 +8192,7 @@ errr init_re_info_txt(FILE *fp, char *buf) re_ptr = &re_info[i]; /* Hack -- Verify space */ - if (re_head->name_size + strlen(s) + 8 > fake_name_size) return (7); + if (re_head->name_size + strlen(s) + 8 > FAKE_NAME_SIZE) return (7); /* Advance and Save the name index */ if (!re_ptr->name) re_ptr->name = ++re_head->name_size; @@ -8733,7 +8733,7 @@ errr init_t_info_txt(FILE *fp, char *buf) t_ptr = &t_info[i]; /* Hack -- Verify space */ - if (t_head->name_size + strlen(s) + 8 > fake_name_size) return (7); + if (t_head->name_size + strlen(s) + 8 > FAKE_NAME_SIZE) return (7); /* Advance and Save the name index */ if (!t_ptr->name) t_ptr->name = ++t_head->name_size; @@ -8787,7 +8787,7 @@ errr init_t_info_txt(FILE *fp, char *buf) s = buf + 2; /* Hack -- Verify space */ - if (t_head->text_size + strlen(s) + 8 > fake_text_size) return (7); + if (t_head->text_size + strlen(s) + 8 > FAKE_TEXT_SIZE) return (7); /* Advance and Save the text index */ if (!t_ptr->text) t_ptr->text = ++t_head->text_size; @@ -9106,7 +9106,7 @@ errr init_d_info_txt(FILE *fp, char *buf) d_ptr = &d_info[i]; /* Hack -- Verify space */ - if (d_head->name_size + strlen(s) + 8 > fake_name_size) return (7); + if (d_head->name_size + strlen(s) + 8 > FAKE_NAME_SIZE) return (7); /* Advance and Save the name index */ if (!d_ptr->name) d_ptr->name = ++d_head->name_size; @@ -9165,7 +9165,7 @@ errr init_d_info_txt(FILE *fp, char *buf) s = buf + 6; /* Hack -- Verify space */ - if (d_head->text_size + strlen(s) + 8 > fake_text_size) return (7); + if (d_head->text_size + strlen(s) + 8 > FAKE_TEXT_SIZE) return (7); /* Advance and Save the text index */ if (!d_ptr->text) d_ptr->text = ++d_head->text_size; @@ -9751,7 +9751,7 @@ errr init_st_info_txt(FILE *fp, char *buf) st_ptr = &st_info[i]; /* Hack -- Verify space */ - if (st_head->name_size + strlen(s) + 8 > fake_name_size) return (7); + if (st_head->name_size + strlen(s) + 8 > FAKE_NAME_SIZE) return (7); /* Advance and Save the name index */ if (!st_ptr->name) st_ptr->name = ++st_head->name_size; @@ -10040,7 +10040,7 @@ errr init_ba_info_txt(FILE *fp, char *buf) ba_ptr = &ba_info[i]; /* Hack -- Verify space */ - if (ba_head->name_size + strlen(s) + 8 > fake_name_size) return (7); + if (ba_head->name_size + strlen(s) + 8 > FAKE_NAME_SIZE) return (7); /* Advance and Save the name index */ if (!ba_ptr->name) ba_ptr->name = ++ba_head->name_size; @@ -10210,7 +10210,7 @@ errr init_ow_info_txt(FILE *fp, char *buf) ow_ptr = &ow_info[i]; /* Hack -- Verify space */ - if (ow_head->name_size + strlen(s) + 8 > fake_name_size) return (7); + if (ow_head->name_size + strlen(s) + 8 > FAKE_NAME_SIZE) return (7); /* Advance and Save the name index */ if (!ow_ptr->name) ow_ptr->name = ++ow_head->name_size; @@ -10454,7 +10454,7 @@ errr init_wf_info_txt(FILE *fp, char *buf) wf_ptr = &wf_info[i]; /* Hack -- Verify space */ - if (wf_head->name_size + strlen(s) + 8 > fake_name_size) return (7); + if (wf_head->name_size + strlen(s) + 8 > FAKE_NAME_SIZE) return (7); /* Advance and Save the name index */ if (!wf_ptr->name) wf_ptr->name = ++wf_head->name_size; @@ -10479,7 +10479,7 @@ errr init_wf_info_txt(FILE *fp, char *buf) s = buf + 2; /* Hack -- Verify space */ - if (wf_head->text_size + strlen(s) + 8 > fake_text_size) return (7); + if (wf_head->text_size + strlen(s) + 8 > FAKE_TEXT_SIZE) return (7); /* Advance and Save the text index */ if (!wf_ptr->text) wf_ptr->text = ++wf_head->text_size; diff --git a/src/init2.c b/src/init2.c index 815d1255..50329509 100644 --- a/src/init2.c +++ b/src/init2.c @@ -225,14 +225,6 @@ s16b error_line; /* - * Hack -- help initialise the fake "name" and "text" arrays when - * parsing an "ascii" template file. - */ -u32b fake_name_size; -u32b fake_text_size; - - -/* * Standard error message text */ static cptr err_str[9] = @@ -288,16 +280,12 @@ static errr init_f_info(void) /*** Make the fake arrays ***/ - /* Fake the size of "f_name" and "f_text" */ - fake_name_size = FAKE_NAME_SIZE; - fake_text_size = FAKE_TEXT_SIZE; - /* Allocate the "f_info" array */ C_MAKE(f_info, f_head->info_num, feature_type); /* Hack -- make "fake" arrays */ - C_MAKE(f_name, fake_name_size, char); - C_MAKE(f_text, fake_text_size, char); + C_MAKE(f_name, FAKE_NAME_SIZE, char); + C_MAKE(f_text, FAKE_TEXT_SIZE, char); /*** Load the ascii template file ***/ @@ -372,16 +360,12 @@ static errr init_k_info(void) /*** Make the fake arrays ***/ - /* Fake the size of "k_name" and "k_text" */ - fake_name_size = FAKE_NAME_SIZE; - fake_text_size = FAKE_TEXT_SIZE; - /* Allocate the "k_info" array */ C_MAKE(k_info, k_head->info_num, object_kind); /* Hack -- make "fake" arrays */ - C_MAKE(k_name, fake_name_size, char); - C_MAKE(k_text, fake_text_size, char); + C_MAKE(k_name, FAKE_NAME_SIZE, char); + C_MAKE(k_text, FAKE_TEXT_SIZE, char); /*** Load the ascii template file ***/ @@ -456,16 +440,12 @@ static errr init_set_info(void) /*** Make the fake arrays ***/ - /* Fake the size of "set_name" and "set_text" */ - fake_name_size = FAKE_NAME_SIZE; - fake_text_size = FAKE_TEXT_SIZE; - /* Allocate the "set_info" array */ C_MAKE(set_info, set_head->info_num, set_type); /* Hack -- make "fake" arrays */ - C_MAKE(set_name, fake_name_size, char); - C_MAKE(set_text, fake_text_size, char); + C_MAKE(set_name, FAKE_NAME_SIZE, char); + C_MAKE(set_text, FAKE_TEXT_SIZE, char); /*** Load the ascii template file ***/ @@ -539,16 +519,12 @@ static errr init_a_info(void) /*** Make the fake arrays ***/ - /* Fake the size of "a_name" and "a_text" */ - fake_name_size = FAKE_NAME_SIZE; - fake_text_size = FAKE_TEXT_SIZE; - /* Allocate the "a_info" array */ C_MAKE(a_info, a_head->info_num, artifact_type); /* Hack -- make "fake" arrays */ - C_MAKE(a_name, fake_name_size, char); - C_MAKE(a_text, fake_text_size, char); + C_MAKE(a_name, FAKE_NAME_SIZE, char); + C_MAKE(a_text, FAKE_TEXT_SIZE, char); /*** Load the ascii template file ***/ @@ -622,16 +598,12 @@ static errr init_s_info(void) /*** Make the fake arrays ***/ - /* Fake the size of "a_name" and "a_text" */ - fake_name_size = FAKE_NAME_SIZE; - fake_text_size = FAKE_TEXT_SIZE; - /* Allocate the "s_info" array */ C_MAKE(s_info, s_head->info_num, skill_type); /* Hack -- make "fake" arrays */ - C_MAKE(s_name, fake_name_size, char); - C_MAKE(s_text, fake_text_size, char); + C_MAKE(s_name, FAKE_NAME_SIZE, char); + C_MAKE(s_text, FAKE_TEXT_SIZE, char); /*** Load the ascii template file ***/ @@ -704,16 +676,12 @@ static errr init_ab_info(void) /*** Make the fake arrays ***/ - /* Fake the size of "a_name" and "a_text" */ - fake_name_size = FAKE_NAME_SIZE; - fake_text_size = FAKE_TEXT_SIZE; - /* Allocate the "ab_info" array */ C_MAKE(ab_info, ab_head->info_num, ability_type); /* Hack -- make "fake" arrays */ - C_MAKE(ab_name, fake_name_size, char); - C_MAKE(ab_text, fake_text_size, char); + C_MAKE(ab_name, FAKE_NAME_SIZE, char); + C_MAKE(ab_text, FAKE_TEXT_SIZE, char); /*** Load the ascii template file ***/ @@ -787,16 +755,12 @@ static errr init_e_info(void) /*** Make the fake arrays ***/ - /* Fake the size of "e_name" and "e_text" */ - fake_name_size = FAKE_NAME_SIZE; - fake_text_size = FAKE_TEXT_SIZE; - /* Allocate the "e_info" array */ C_MAKE(e_info, e_head->info_num, ego_item_type); /* Hack -- make "fake" arrays */ - C_MAKE(e_name, fake_name_size, char); - C_MAKE(e_text, fake_text_size, char); + C_MAKE(e_name, FAKE_NAME_SIZE, char); + C_MAKE(e_text, FAKE_TEXT_SIZE, char); /*** Load the ascii template file ***/ @@ -870,10 +834,6 @@ static errr init_ra_info(void) /*** Make the fake arrays ***/ - /* Fake the size of "ra_name" and "ra_text" */ - fake_name_size = FAKE_NAME_SIZE; - fake_text_size = FAKE_TEXT_SIZE; - /* Allocate the "ra_info" array */ C_MAKE(ra_info, ra_head->info_num, randart_part_type); @@ -945,16 +905,12 @@ static errr init_r_info(void) /*** Make the fake arrays ***/ - /* Assume the size of "r_name" and "r_text" */ - fake_name_size = FAKE_NAME_SIZE; - fake_text_size = FAKE_TEXT_SIZE; - /* Allocate the "r_info" array */ C_MAKE(r_info, r_head->info_num, monster_race); /* Hack -- make "fake" arrays */ - C_MAKE(r_name, fake_name_size, char); - C_MAKE(r_text, fake_text_size, char); + C_MAKE(r_name, FAKE_NAME_SIZE, char); + C_MAKE(r_text, FAKE_TEXT_SIZE, char); /*** Load the ascii template file ***/ @@ -1028,14 +984,11 @@ static errr init_re_info(void) /*** Make the fake arrays ***/ - /* Assume the size of "re_name" */ - fake_name_size = FAKE_NAME_SIZE; - /* Allocate the "re_info" array */ C_MAKE(re_info, re_head->info_num, monster_ego); /* Hack -- make "fake" arrays */ - C_MAKE(re_name, fake_name_size, char); + C_MAKE(re_name, FAKE_NAME_SIZE, char); /*** Load the ascii template file ***/ @@ -1108,16 +1061,12 @@ static errr init_d_info(void) /*** Make the fake arrays ***/ - /* Assume the size of "d_name" and "d_text" */ - fake_name_size = FAKE_NAME_SIZE; - fake_text_size = FAKE_TEXT_SIZE; - /* Allocate the "d_info" array */ C_MAKE(d_info, d_head->info_num, dungeon_info_type); /* Hack -- make "fake" arrays */ - C_MAKE(d_name, fake_name_size, char); - C_MAKE(d_text, fake_text_size, char); + C_MAKE(d_name, FAKE_NAME_SIZE, char); + C_MAKE(d_text, FAKE_TEXT_SIZE, char); /*** Load the ascii template file ***/ @@ -1211,30 +1160,26 @@ static errr init_player_info(void) /*** Make the fake arrays ***/ - /* Assume the size of "rp_name" and "rp_text" */ - fake_name_size = FAKE_NAME_SIZE; - fake_text_size = FAKE_TEXT_SIZE; - /* Allocate the "rp_info" array */ C_MAKE(race_info, rp_head->info_num, player_race); /* Hack -- make "fake" arrays */ - C_MAKE(rp_name, fake_name_size, char); - C_MAKE(rp_text, fake_text_size, char); + C_MAKE(rp_name, FAKE_NAME_SIZE, char); + C_MAKE(rp_text, FAKE_TEXT_SIZE, char); /* Allocate the "rmp_info" array */ C_MAKE(race_mod_info, rmp_head->info_num, player_race_mod); /* Hack -- make "fake" arrays */ - C_MAKE(rmp_name, fake_name_size, char); - C_MAKE(rmp_text, fake_text_size, char); + C_MAKE(rmp_name, FAKE_NAME_SIZE, char); + C_MAKE(rmp_text, FAKE_TEXT_SIZE, char); /* Allocate the "c_info" array */ C_MAKE(class_info, c_head->info_num, player_class); /* Hack -- make "fake" arrays */ - C_MAKE(c_name, fake_name_size, char); - C_MAKE(c_text, fake_text_size, char); + C_MAKE(c_name, FAKE_NAME_SIZE, char); + C_MAKE(c_text, FAKE_TEXT_SIZE, char); /* Allocate the "bg" array */ C_MAKE(bg, max_bg_idx, hist_type); @@ -1320,14 +1265,11 @@ static errr init_st_info(void) /*** Make the fake arrays ***/ - /* Assume the size of "st_name" and "st_text" */ - fake_name_size = FAKE_NAME_SIZE; - /* Allocate the "st_info" array */ C_MAKE(st_info, st_head->info_num, store_info_type); /* Hack -- make "fake" arrays */ - C_MAKE(st_name, fake_name_size, char); + C_MAKE(st_name, FAKE_NAME_SIZE, char); /*** Load the ascii template file ***/ @@ -1399,14 +1341,11 @@ static errr init_ow_info(void) /*** Make the fake arrays ***/ - /* Assume the size of "ow_name" and "ow_text" */ - fake_name_size = FAKE_NAME_SIZE; - /* Allocate the "ow_info" array */ C_MAKE(ow_info, ow_head->info_num, owner_type); /* Hack -- make "fake" arrays */ - C_MAKE(ow_name, fake_name_size, char); + C_MAKE(ow_name, FAKE_NAME_SIZE, char); /*** Load the ascii template file ***/ @@ -1478,14 +1417,11 @@ static errr init_ba_info(void) /*** Make the fake arrays ***/ - /* Assume the size of "ba_name" and "ba_text" */ - fake_name_size = FAKE_NAME_SIZE; - /* Allocate the "ba_info" array */ C_MAKE(ba_info, ba_head->info_num, store_action_type); /* Hack -- make "fake" arrays */ - C_MAKE(ba_name, fake_name_size, char); + C_MAKE(ba_name, FAKE_NAME_SIZE, char); /*** Load the ascii template file ***/ @@ -1557,16 +1493,12 @@ static errr init_wf_info(void) /*** Make the fake arrays ***/ - /* Assume the size of "wf_name" and "wf_text" */ - fake_name_size = FAKE_NAME_SIZE; - fake_text_size = FAKE_TEXT_SIZE; - /* Allocate the "r_info" array */ C_MAKE(wf_info, wf_head->info_num, wilderness_type_info); /* Hack -- make "fake" arrays */ - C_MAKE(wf_name, fake_name_size, char); - C_MAKE(wf_text, fake_text_size, char); + C_MAKE(wf_name, FAKE_NAME_SIZE, char); + C_MAKE(wf_text, FAKE_TEXT_SIZE, char); /*** Load the ascii template file ***/ @@ -1640,16 +1572,12 @@ static errr init_t_info(void) /*** Make the fake arrays ***/ - /* Fake the size of "t_name" and "t_text" */ - fake_name_size = FAKE_NAME_SIZE; - fake_text_size = FAKE_TEXT_SIZE; - /* Allocate the "t_info" array */ C_MAKE(t_info, t_head->info_num, trap_type); /* Hack -- make "fake" arrays */ - C_MAKE(t_name, fake_name_size, char); - C_MAKE(t_text, fake_text_size, char); + C_MAKE(t_name, FAKE_NAME_SIZE, char); + C_MAKE(t_text, FAKE_TEXT_SIZE, char); /*** Load the ascii template file ***/ @@ -1721,9 +1649,6 @@ errr init_al_info(void) - fake_text_size = FAKE_TEXT_SIZE; - fake_name_size = FAKE_NAME_SIZE; - /* Allocate the "al_info" array */ C_MAKE(alchemist_recipes, al_head->info_num, alchemist_recipe); @@ -1733,11 +1658,11 @@ errr init_al_info(void) than 32*5*sizeof(artifact_select_flag) = 10 int and 5 bytes which is the maximum size of the a_select_flags array */ - C_MAKE(al_name, fake_name_size, char); + C_MAKE(al_name, FAKE_NAME_SIZE, char); { char *hack; - C_MAKE(hack, fake_text_size, char); + C_MAKE(hack, FAKE_TEXT_SIZE, char); a_select_flags = (artifact_select_flag *) hack; } @@ -1812,16 +1737,12 @@ errr init_v_info(void) /*** Make the fake arrays ***/ - /* Fake the size of "v_name" and "v_text" */ - fake_name_size = FAKE_NAME_SIZE; - fake_text_size = FAKE_TEXT_SIZE; - /* Allocate the "k_info" array */ C_MAKE(v_info, v_head->info_num, vault_type); /* Hack -- make "fake" arrays */ - C_MAKE(v_name, fake_name_size, char); - C_MAKE(v_text, fake_text_size, char); + C_MAKE(v_name, FAKE_NAME_SIZE, char); + C_MAKE(v_text, FAKE_TEXT_SIZE, char); /*** Load the ascii template file ***/ |