From 288c3d3f725eabfee06507966a0ba63bf587c3da Mon Sep 17 00:00:00 2001 From: Bardur Arantsson Date: Sat, 17 Sep 2016 09:58:14 +0200 Subject: Remove quark.{cc,hpp} --- src/CMakeLists.txt | 1 - src/cmd1.cc | 1 - src/cmd3.cc | 1 - src/cmd5.cc | 1 - src/cmd7.cc | 1 - src/dungeon.cc | 1 - src/init2.cc | 22 ------------ src/loadsave.cc | 1 - src/melee2.cc | 1 - src/object1.cc | 1 - src/powers.cc | 1 - src/q_fireprof.cc | 1 - src/q_god.cc | 1 - src/q_library.cc | 1 - src/q_poison.cc | 1 - src/q_thrain.cc | 1 - src/q_wight.cc | 1 - src/quark.cc | 96 ----------------------------------------------------- src/quark.hpp | 12 ------- src/randart.cc | 1 - src/squelch/rule.cc | 1 - src/store.cc | 1 - src/util.cc | 1 - src/xtra2.cc | 1 - 24 files changed, 151 deletions(-) delete mode 100644 src/quark.cc delete mode 100644 src/quark.hpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8ac5e097..8991318d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -87,7 +87,6 @@ SET(SRCS_COMMON q_ultrag.cc q_wight.cc q_wolves.cc - quark.cc quest.cc randart.cc range.cc diff --git a/src/cmd1.cc b/src/cmd1.cc index f1dfaac9..c0283512 100644 --- a/src/cmd1.cc +++ b/src/cmd1.cc @@ -35,7 +35,6 @@ #include "options.hpp" #include "player_race_flag.hpp" #include "player_type.hpp" -#include "quark.hpp" #include "skills.hpp" #include "spells1.hpp" #include "spells2.hpp" diff --git a/src/cmd3.cc b/src/cmd3.cc index c333a599..66991c70 100644 --- a/src/cmd3.cc +++ b/src/cmd3.cc @@ -26,7 +26,6 @@ #include "object_type.hpp" #include "options.hpp" #include "player_type.hpp" -#include "quark.hpp" #include "squeltch.hpp" #include "store.hpp" #include "store_type.hpp" diff --git a/src/cmd5.cc b/src/cmd5.cc index 6e54c76e..2fd9801e 100644 --- a/src/cmd5.cc +++ b/src/cmd5.cc @@ -39,7 +39,6 @@ #include "util.h" #include "variable.h" #include "variable.hpp" -#include "quark.hpp" #include "wizard2.hpp" #include "xtra1.hpp" #include "xtra2.hpp" diff --git a/src/cmd7.cc b/src/cmd7.cc index 49de2611..4c485c2f 100644 --- a/src/cmd7.cc +++ b/src/cmd7.cc @@ -28,7 +28,6 @@ #include "object_kind.hpp" #include "options.hpp" #include "player_type.hpp" -#include "quark.hpp" #include "skills.hpp" #include "spells1.hpp" #include "spells2.hpp" diff --git a/src/dungeon.cc b/src/dungeon.cc index 2e42e871..16b6bcc0 100644 --- a/src/dungeon.cc +++ b/src/dungeon.cc @@ -58,7 +58,6 @@ #include "player_type.hpp" #include "powers.hpp" #include "quest.hpp" -#include "quark.hpp" #include "skills.hpp" #include "spell_type.hpp" #include "spells1.hpp" diff --git a/src/init2.cc b/src/init2.cc index ad96df86..8fc4bb07 100644 --- a/src/init2.cc +++ b/src/init2.cc @@ -33,7 +33,6 @@ #include "player_race.hpp" #include "player_race_mod.hpp" #include "q_library.hpp" -#include "quark.hpp" #include "randart.hpp" #include "randart_part_type.hpp" #include "set_type.hpp" @@ -649,9 +648,6 @@ static errr init_misc(void) /*** Prepare the various "bizarre" arrays ***/ - /* Initialize quark subsystem */ - quark_init(); - /* Initialize messages subsystem */ message_init(); @@ -792,24 +788,6 @@ static errr init_other(void) cave[i] = new cave_type[MAX_WID]; } - /*** Pre-allocate the basic "auto-inscriptions" ***/ - - /* The "basic" feelings */ - (void)quark_add("cursed"); - (void)quark_add("broken"); - (void)quark_add("average"); - (void)quark_add("good"); - - /* The "extra" feelings */ - (void)quark_add("excellent"); - (void)quark_add("worthless"); - (void)quark_add("special"); - (void)quark_add("terrible"); - - /* Some extra strings */ - (void)quark_add("uncursed"); - (void)quark_add("on sale"); - /* Analyze the windows */ for (n = 0; n < 8; n++) { diff --git a/src/loadsave.cc b/src/loadsave.cc index 3f4ba47f..b66aeb01 100644 --- a/src/loadsave.cc +++ b/src/loadsave.cc @@ -23,7 +23,6 @@ #include "player_race.hpp" #include "player_race_mod.hpp" #include "player_type.hpp" -#include "quark.hpp" #include "hooks.hpp" #include "skill_type.hpp" #include "store_type.hpp" diff --git a/src/melee2.cc b/src/melee2.cc index 41756550..773cdad1 100644 --- a/src/melee2.cc +++ b/src/melee2.cc @@ -38,7 +38,6 @@ #include "object_flag.hpp" #include "options.hpp" #include "player_type.hpp" -#include "quark.hpp" #include "skills.hpp" #include "spells1.hpp" #include "spells2.hpp" diff --git a/src/object1.cc b/src/object1.cc index b4e1141d..c311ee34 100644 --- a/src/object1.cc +++ b/src/object1.cc @@ -38,7 +38,6 @@ #include "player_race.hpp" #include "player_race_mod.hpp" #include "player_type.hpp" -#include "quark.hpp" #include "set_type.hpp" #include "skills.hpp" #include "spell_type.hpp" diff --git a/src/powers.cc b/src/powers.cc index 8edfb7b5..0c01a0e6 100644 --- a/src/powers.cc +++ b/src/powers.cc @@ -29,7 +29,6 @@ #include "object_kind.hpp" #include "options.hpp" #include "player_type.hpp" -#include "quark.hpp" #include "spells1.hpp" #include "spells2.hpp" #include "stats.hpp" diff --git a/src/q_fireprof.cc b/src/q_fireprof.cc index 033aec05..207f306f 100644 --- a/src/q_fireprof.cc +++ b/src/q_fireprof.cc @@ -12,7 +12,6 @@ #include "object_flag.hpp" #include "object_type.hpp" #include "player_type.hpp" -#include "quark.hpp" #include "tables.hpp" #include "traps.hpp" #include "util.hpp" diff --git a/src/q_god.cc b/src/q_god.cc index c2dd3760..c5120da0 100644 --- a/src/q_god.cc +++ b/src/q_god.cc @@ -14,7 +14,6 @@ #include "monster_spell_flag.hpp" #include "object2.hpp" #include "player_type.hpp" -#include "quark.hpp" #include "skill_type.hpp" #include "tables.hpp" #include "util.hpp" diff --git a/src/q_library.cc b/src/q_library.cc index c379b6d1..96c93980 100644 --- a/src/q_library.cc +++ b/src/q_library.cc @@ -8,7 +8,6 @@ #include "monster_type.hpp" #include "object2.hpp" #include "player_type.hpp" -#include "quark.hpp" #include "spells3.hpp" #include "spells4.hpp" #include "tables.hpp" diff --git a/src/q_poison.cc b/src/q_poison.cc index 70eebcb9..54df78f9 100644 --- a/src/q_poison.cc +++ b/src/q_poison.cc @@ -15,7 +15,6 @@ #include "monster_type.hpp" #include "object2.hpp" #include "player_type.hpp" -#include "quark.hpp" #include "tables.hpp" #include "util.hpp" #include "variable.hpp" diff --git a/src/q_thrain.cc b/src/q_thrain.cc index 7cd64bbf..b7eb0756 100644 --- a/src/q_thrain.cc +++ b/src/q_thrain.cc @@ -11,7 +11,6 @@ #include "init1.hpp" #include "lua_bind.hpp" #include "object_type.hpp" -#include "quark.hpp" #include "randart.hpp" #include "messages.hpp" #include "monster2.hpp" diff --git a/src/q_wight.cc b/src/q_wight.cc index 531bec29..01272aea 100644 --- a/src/q_wight.cc +++ b/src/q_wight.cc @@ -11,7 +11,6 @@ #include "object2.hpp" #include "object_flag.hpp" #include "player_type.hpp" -#include "quark.hpp" #include "tables.hpp" #include "util.hpp" #include "variable.hpp" diff --git a/src/quark.cc b/src/quark.cc deleted file mode 100644 index 45072ded..00000000 --- a/src/quark.cc +++ /dev/null @@ -1,96 +0,0 @@ -#include "quark.hpp" - -#include "z-util.h" - -#include - -/* - * The number of quarks - */ -static s16b quark__num = 0; - - -/* - * The pointers to the quarks [QUARK_MAX] - */ -static cptr *quark__str = NULL; - - -/* - * Initialize the quark subsystem - */ -void quark_init() -{ - quark__num = 0; - quark__str = new cptr[QUARK_MAX]; - - for (int i = 0; i < QUARK_MAX; i++) { - quark__str[i] = nullptr; - } -} - - -/* -* We use a global array for all inscriptions to reduce the memory -* spent maintaining inscriptions. Of course, it is still possible -* to run out of inscription memory, especially if too many different -* inscriptions are used, but hopefully this will be rare. -* -* We use dynamic string allocation because otherwise it is necessary -* to pre-guess the amount of quark activity. We limit the total -* number of quarks, but this is much easier to "expand" as needed. -* -* Any two items with the same inscription will have the same "quark" -* index, which should greatly reduce the need for inscription space. -* -* Note that "quark zero" is NULL and should not be "dereferenced". -*/ - -/* -* Add a new "quark" to the set of quarks. -*/ -s16b quark_add(cptr str) -{ - assert(str != nullptr); - - int i; - - /* Look for an existing quark */ - for (i = 1; i < quark__num; i++) - { - /* Check for equality */ - if (streq(quark__str[i], str)) return (i); - } - - /* Paranoia -- Require room */ - if (quark__num == QUARK_MAX) return (0); - - /* New maximal quark */ - quark__num = i + 1; - - /* Add a new quark */ - quark__str[i] = strdup(str); - - /* Return the index */ - return (i); -} - - -/* -* This function looks up a quark -*/ -cptr quark_str(s16b i) -{ - cptr q; - - /* Verify */ - if ((i < 0) || (i >= quark__num)) i = 0; - - /* Access the quark */ - q = quark__str[i]; - - /* Return the quark */ - return (q); -} - - diff --git a/src/quark.hpp b/src/quark.hpp deleted file mode 100644 index 0fce3932..00000000 --- a/src/quark.hpp +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once - -#include "h-basic.h" - -/** - * Maximum number of quarks. - */ -constexpr int QUARK_MAX = 768; - -void quark_init(); -cptr quark_str(s16b num); -s16b quark_add(cptr str); diff --git a/src/randart.cc b/src/randart.cc index 1ccba225..7a6b2398 100644 --- a/src/randart.cc +++ b/src/randart.cc @@ -14,7 +14,6 @@ #include "object_type.hpp" #include "options.hpp" #include "player_type.hpp" -#include "quark.hpp" #include "randart_gen_type.hpp" #include "randart_part_type.hpp" #include "spells2.hpp" diff --git a/src/squelch/rule.cc b/src/squelch/rule.cc index 0f952ebb..223cf6d3 100644 --- a/src/squelch/rule.cc +++ b/src/squelch/rule.cc @@ -10,7 +10,6 @@ #include "../object2.hpp" #include "../object_flag.hpp" #include "../object_type.hpp" -#include "../quark.hpp" #include "../tables.hpp" #include "../util.hpp" #include "../variable.hpp" diff --git a/src/store.cc b/src/store.cc index a518677b..eb8f703c 100644 --- a/src/store.cc +++ b/src/store.cc @@ -24,7 +24,6 @@ #include "options.hpp" #include "owner_type.hpp" #include "player_type.hpp" -#include "quark.hpp" #include "spell_type.hpp" #include "skills.hpp" #include "spells5.hpp" diff --git a/src/util.cc b/src/util.cc index 70cc3f4f..3c358052 100644 --- a/src/util.cc +++ b/src/util.cc @@ -17,7 +17,6 @@ #include "player_race.hpp" #include "player_race_mod.hpp" #include "player_type.hpp" -#include "quark.hpp" #include "tables.h" #include "tables.hpp" #include "timer_type.hpp" diff --git a/src/xtra2.cc b/src/xtra2.cc index 4334b999..501d9693 100644 --- a/src/xtra2.cc +++ b/src/xtra2.cc @@ -42,7 +42,6 @@ #include "player_race_mod.hpp" #include "player_type.hpp" #include "point.hpp" -#include "quark.hpp" #include "randart.hpp" #include "skill_type.hpp" #include "skills.hpp" -- cgit v1.2.3