diff options
author | Bardur Arantsson <bardur@scientician.net> | 2019-02-15 19:20:25 +0100 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2019-02-15 19:20:25 +0100 |
commit | cf174d71d2b56fb40248d96707090a484b4957fc (patch) | |
tree | ca2666f5f0aabca22b45f2f87baf19be296ac0af /src/init1.cc | |
parent | 79d1633d51015b2a9224dece9da083ff1ab8b7c2 (diff) |
Search/replace bool_ with bool
We also search/replace TRUE/FALSE with their bool equivalents.
Diffstat (limited to 'src/init1.cc')
-rw-r--r-- | src/init1.cc | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/src/init1.cc b/src/init1.cc index ad81f4c8..850a7be9 100644 --- a/src/init1.cc +++ b/src/init1.cc @@ -639,7 +639,7 @@ static void strappend(char **s, const char *t) /* * Grab one race flag from a textual string */ -static bool_ unknown_shut_up = FALSE; +static bool unknown_shut_up = false; static errr grab_one_class_flag(std::array<u32b, 2> &choice, const char *what) { auto const &class_info = game->edit_data.class_info; @@ -3404,7 +3404,7 @@ static ego_flag_set lookup_ego_flag(const char *what) * * We explicitly allow nullptr for the "ego" parameter. */ -static bool_ grab_one_ego_item_flag(object_flag_set *flags, ego_flag_set *ego, const char *what) +static bool grab_one_ego_item_flag(object_flag_set *flags, ego_flag_set *ego, const char *what) { /* Lookup as an object_flag */ if (auto f = object_flag_set_from_string(what)) @@ -4503,7 +4503,7 @@ errr init_re_info_txt(FILE *fp) re_ptr->rarity = rar; re_ptr->weight = (wt << 2) + monster_ego_modify(mwt); re_ptr->mexp = (exp << 2) + monster_ego_modify(mexp); - re_ptr->before = (pos == 'B') ? TRUE : FALSE; + re_ptr->before = (pos == 'B') ? true : false; /* Next... */ continue; @@ -5314,22 +5314,22 @@ errr init_d_info_txt(FILE *fp) static errr grab_one_race_flag(owner_type *ow_ptr, int state, const char *what) { /* Scan race flags */ - unknown_shut_up = TRUE; + unknown_shut_up = true; if (!grab_one_race_allow_flag(ow_ptr->races[state], what)) { - unknown_shut_up = FALSE; + unknown_shut_up = false; return (0); } /* Scan classes flags */ if (!grab_one_class_flag(ow_ptr->classes[state], what)) { - unknown_shut_up = FALSE; + unknown_shut_up = false; return (0); } /* Oops */ - unknown_shut_up = FALSE; + unknown_shut_up = false; msg_format("Unknown race/class flag '%s'.", what); /* Failure */ @@ -6007,17 +6007,17 @@ struct dungeon_grid int bx, by; /* For between gates */ int mimic; /* Mimiced features */ s32b mflag; /* monster's mflag */ - bool_ ok; - bool_ defined; + bool ok; + bool defined; }; -static bool_ meta_sleep = TRUE; +static bool meta_sleep = true; static dungeon_grid letter[255]; /* * Parse a sub-file of the "extra info" */ -static errr process_dungeon_file_aux(char *buf, int *yval, int *xval, int xvalstart, int ymax, int xmax, bool_ full) +static errr process_dungeon_file_aux(char *buf, int *yval, int *xval, int xvalstart, int ymax, int xmax, bool full) { auto &wilderness = game->wilderness; auto &wf_info = game->edit_data.wf_info; @@ -6047,7 +6047,7 @@ static errr process_dungeon_file_aux(char *buf, int *yval, int *xval, int xvalst if (buf[0] == '%') { /* Attempt to Process the given file */ - return (process_dungeon_file(buf + 2, yval, xval, ymax, xmax, FALSE, full)); + return (process_dungeon_file(buf + 2, yval, xval, ymax, xmax, false, full)); } /* Process "N:<sleep>" */ @@ -6083,8 +6083,8 @@ static errr process_dungeon_file_aux(char *buf, int *yval, int *xval, int xvalst letter[index].random = 0; letter[index].mimic = 0; letter[index].mflag = 0; - letter[index].ok = TRUE; - letter[index].defined = TRUE; + letter[index].ok = true; + letter[index].defined = true; if (num > 1) { @@ -6297,16 +6297,16 @@ static errr process_dungeon_file_aux(char *buf, int *yval, int *xval, int xvalst monster_level = quest[p_ptr->inside_quest].level + monster_index; - m_idx = place_monster(y, x, meta_sleep, FALSE); + m_idx = place_monster(y, x, meta_sleep, false); monster_level = level; } else if (monster_index) { /* Place it */ - m_allow_special[monster_index] = TRUE; - m_idx = place_monster_aux(y, x, monster_index, meta_sleep, FALSE, MSTATUS_ENEMY); - m_allow_special[monster_index] = FALSE; + m_allow_special[monster_index] = true; + m_idx = place_monster_aux(y, x, monster_index, meta_sleep, false, MSTATUS_ENEMY); + m_allow_special[monster_index] = false; } /* Set the mflag of the monster */ @@ -6322,25 +6322,25 @@ static errr process_dungeon_file_aux(char *buf, int *yval, int *xval, int xvalst object_level = quest[p_ptr->inside_quest].level + object_index; if (rand_int(100) < 75) - place_object(y, x, FALSE, FALSE, OBJ_FOUND_SPECIAL); + place_object(y, x, false, false, OBJ_FOUND_SPECIAL); else if (rand_int(100) < 80) - place_object(y, x, TRUE, FALSE, OBJ_FOUND_SPECIAL); + place_object(y, x, true, false, OBJ_FOUND_SPECIAL); else - place_object(y, x, TRUE, TRUE, OBJ_FOUND_SPECIAL); + place_object(y, x, true, true, OBJ_FOUND_SPECIAL); object_level = level; } else if (rand_int(100) < 75) { - place_object(y, x, FALSE, FALSE, OBJ_FOUND_SPECIAL); + place_object(y, x, false, false, OBJ_FOUND_SPECIAL); } else if (rand_int(100) < 80) { - place_object(y, x, TRUE, FALSE, OBJ_FOUND_SPECIAL); + place_object(y, x, true, false, OBJ_FOUND_SPECIAL); } else { - place_object(y, x, TRUE, TRUE, OBJ_FOUND_SPECIAL); + place_object(y, x, true, true, OBJ_FOUND_SPECIAL); } } else if (object_index) @@ -6348,17 +6348,17 @@ static errr process_dungeon_file_aux(char *buf, int *yval, int *xval, int xvalst /* Get local object */ object_type *o_ptr = &object_type_body; - k_info[object_index]->allow_special = TRUE; + k_info[object_index]->allow_special = true; /* Create the item */ object_prep(o_ptr, object_index); /* Apply magic (no messages, no artifacts) */ - apply_magic(o_ptr, dun_level, FALSE, TRUE, FALSE); + apply_magic(o_ptr, dun_level, false, true, false); o_ptr->found = OBJ_FOUND_SPECIAL; - k_info[object_index]->allow_special = FALSE; + k_info[object_index]->allow_special = false; drop_near(o_ptr, -1, y, x); } @@ -6374,7 +6374,7 @@ static errr process_dungeon_file_aux(char *buf, int *yval, int *xval, int xvalst object_type forge; object_type *q_ptr = &forge; - a_allow_special[artifact_index] = TRUE; + a_allow_special[artifact_index] = true; /* Wipe the object */ object_wipe(q_ptr); @@ -6403,7 +6403,7 @@ static errr process_dungeon_file_aux(char *buf, int *yval, int *xval, int xvalst a_info[artifact_index].cur_num = 1; - a_allow_special[artifact_index] = FALSE; + a_allow_special[artifact_index] = false; /* It's amazing that this "creating objects anywhere" junk ever worked. @@ -6735,7 +6735,7 @@ static const char *process_dungeon_file_expr(char **sp, char *fp) /* Other */ else { - bool_ text_mode = FALSE; + bool text_mode = false; /* Accept all printables except spaces and brackets */ while (isprint(*s)) @@ -6841,7 +6841,7 @@ static const char *process_dungeon_file_expr(char **sp, char *fp) } -errr process_dungeon_file(const char *name, int *yval, int *xval, int ymax, int xmax, bool_ init, bool_ full) +errr process_dungeon_file(const char *name, int *yval, int *xval, int ymax, int xmax, bool init, bool full) { FILE *fp = 0; @@ -6851,19 +6851,19 @@ errr process_dungeon_file(const char *name, int *yval, int *xval, int ymax, int errr err = 0; - bool_ bypass = FALSE; + bool bypass = false; /* Save the start since it ought to be modified */ int xmin = *xval; if (init) { - meta_sleep = TRUE; + meta_sleep = true; for (i = 0; i < 255; i++) { - letter[i].defined = FALSE; - if (i == ' ') letter[i].ok = TRUE; - else letter[i].ok = FALSE; + letter[i].defined = false; + if (i == ' ') letter[i].ok = true; + else letter[i].ok = false; letter[i].bx = 0; letter[i].by = 0; } @@ -6913,7 +6913,7 @@ errr process_dungeon_file(const char *name, int *yval, int *xval, int ymax, int v = process_dungeon_file_expr(&s, &f); /* Set flag */ - bypass = (equals(v, "0") ? TRUE : FALSE); + bypass = (equals(v, "0") ? true : false); /* Continue */ continue; @@ -6927,7 +6927,7 @@ errr process_dungeon_file(const char *name, int *yval, int *xval, int ymax, int if (buf[0] == '%') { /* Process that file if allowed */ - process_dungeon_file(buf + 2, yval, xval, ymax, xmax, FALSE, full); + process_dungeon_file(buf + 2, yval, xval, ymax, xmax, false, full); /* Continue */ continue; |