summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-06 19:08:10 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-06 19:08:10 +0000
commit7d8f213e503f50ce492a7021e6d991e771c4e88a (patch)
tree4b42105600711dffde6a7b1156b7d9373f18129b /crawl-ref
parentd717830fb8d47cb6ae2fe1fedc00240e9f5f601f (diff)
downloadcrawl-ref-7d8f213e503f50ce492a7021e6d991e771c4e88a.tar.gz
crawl-ref-7d8f213e503f50ce492a7021e6d991e771c4e88a.zip
Properly use apostrophise() in a few more places.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8275 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/Kills.cc4
-rw-r--r--crawl-ref/source/fight.cc7
-rw-r--r--crawl-ref/source/hiscores.cc14
-rw-r--r--crawl-ref/source/monstuff.cc7
-rw-r--r--crawl-ref/source/religion.cc7
-rw-r--r--crawl-ref/source/spl-book.cc7
-rw-r--r--crawl-ref/source/xom.cc5
7 files changed, 24 insertions, 27 deletions
diff --git a/crawl-ref/source/Kills.cc b/crawl-ref/source/Kills.cc
index 4ec028b37d..733cd5c5ce 100644
--- a/crawl-ref/source/Kills.cc
+++ b/crawl-ref/source/Kills.cc
@@ -355,8 +355,8 @@ std::string apostrophise(const std::string &name)
if (name.empty())
return (name);
- const char lastc = name[ name.length() - 1 ];
- return (name + (lastc == 's' || lastc == 'x'? "'" : "'s"));
+ const char lastc = name[name.length() - 1];
+ return (name + (lastc == 's' || lastc == 'x' ? "'" : "'s"));
}
// For monster names ending with these suffixes, we pluralise directly without
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index 6ac9990b9e..a3a489c105 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -471,12 +471,7 @@ std::string melee_attack::wep_name(description_level_type desc,
}
if (possessive)
- {
- name = atk_name(desc);
- name += "'s ";
- // Proper English-language possessive.
- name = replace_all(name, "s's ", "s' ");
- }
+ name = apostrophise(atk_name(desc));
name += weapon->name(desc, false, false, false, false, ignore_flags);
diff --git a/crawl-ref/source/hiscores.cc b/crawl-ref/source/hiscores.cc
index f48bcf90a6..49fe90b540 100644
--- a/crawl-ref/source/hiscores.cc
+++ b/crawl-ref/source/hiscores.cc
@@ -1084,18 +1084,18 @@ std::string scorefile_entry::game_time(death_desc_verbosity verbosity) const
#ifdef MULTIUSER
if (uid > 0)
{
- struct passwd *pw_entry = getpwuid( uid );
+ struct passwd *pw_entry = getpwuid(uid);
if (pw_entry)
{
- strncpy( username, pw_entry->pw_name, sizeof(username) );
- strncat( username, "'s", sizeof(username) );
- username[0] = toupper( username[0] );
+ strncpy(username, pw_entry->pw_name, sizeof(username));
+ username[0] = toupper(username[0]);
+ strncat(username, "'s", sizeof(username));
}
}
#endif
- snprintf( scratch, INFO_SIZE, "%s game lasted %s (%ld turns).",
- username, make_time_string(real_time).c_str(),
- num_turns );
+ snprintf(scratch, INFO_SIZE, "%s game lasted %s (%ld turns).",
+ username, make_time_string(real_time).c_str(),
+ num_turns);
line += scratch;
line += _hiscore_newline_string();
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index a03563b5d5..28d8b38baa 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -986,8 +986,8 @@ void _monster_die_cloud(const monsters* monster, bool corpse, bool silent,
simple_monster_message(monster, (prefix + msg).c_str());
if (cloud != CLOUD_NONE)
- place_cloud( cloud, monster->pos(), 1 + random2(3),
- monster->kill_alignment() );
+ place_cloud(cloud, monster->pos(), 1 + random2(3),
+ monster->kill_alignment());
}
void monster_die(monsters *monster, killer_type killer,
@@ -4258,7 +4258,8 @@ monsters *choose_random_monster_on_level(int weight,
// permitting output of "It" messages for the invisible {dlb}
// Intentionally avoids info and str_pass now. -- bwr
bool simple_monster_message(const monsters *monster, const char *event,
- msg_channel_type channel, int param,
+ msg_channel_type channel,
+ int param,
description_level_type descrip)
{
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 9242fede60..1008fd428d 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -41,6 +41,7 @@ REVISION("$Rev$");
#include "itemprop.h"
#include "item_use.h"
#include "items.h"
+#include "Kills.h"
#include "macro.h"
#include "makeitem.h"
#include "message.h"
@@ -5548,7 +5549,7 @@ void yred_make_enslaved_soul(monsters *mon, bool force_hostile,
_yred_souls_disappear();
const int type = mon->type;
- const std::string name_cap_the = mon->name(DESC_CAP_THE);
+ const std::string name = apostrophise(mon->name(DESC_CAP_THE));
const std::string name_plain = mon->name(DESC_PLAIN);
bool twisted = false;
@@ -5557,7 +5558,7 @@ void yred_make_enslaved_soul(monsters *mon, bool force_hostile,
if (!quiet)
{
- mprf("%s's soul %s.", name_cap_the.c_str(),
+ mprf("%s soul %s.", name.c_str(),
twisted ? "becomes twisted" : "remains intact");
}
@@ -5597,7 +5598,7 @@ void yred_make_enslaved_soul(monsters *mon, bool force_hostile,
if (!quiet)
{
- mprf("%s's soul %s.", name_cap_the.c_str(),
+ mprf("%s soul %s.", name.c_str(),
!force_hostile ? "is now yours" : "fights you");
}
}
diff --git a/crawl-ref/source/spl-book.cc b/crawl-ref/source/spl-book.cc
index 1f273d634c..09a6df8809 100644
--- a/crawl-ref/source/spl-book.cc
+++ b/crawl-ref/source/spl-book.cc
@@ -32,6 +32,7 @@ REVISION("$Rev$");
#include "itemprop.h"
#include "items.h"
#include "it_use3.h"
+#include "Kills.h"
#include "message.h"
#include "player.h"
#include "randart.h"
@@ -1950,9 +1951,9 @@ bool make_book_level_randart(item_def &book, int level, int num_spells)
std::string name = "\"";
if (god != GOD_NO_GOD)
- name += god_name(god, false) + "'s ";
+ name += apostrophise(god_name(god, false)) + " ";
else if (one_chance_in(3))
- name += make_name(random_int(), false) + "'s ";
+ name += apostrophise(make_name(random_int(), false)) + " ";
else
has_owner = false;
@@ -2410,7 +2411,7 @@ bool make_book_theme_randart(item_def &book, int disc1, int disc2,
need_quotes = false;
if (need_quotes)
- name = '"' + name + "'s ";
+ name = "\"" + apostrophise(name) + " ";
name += getRandNameString("book_noun");
name += " of ";
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc
index dcb662fa87..845311f06a 100644
--- a/crawl-ref/source/xom.cc
+++ b/crawl-ref/source/xom.cc
@@ -17,6 +17,7 @@ REVISION("$Rev$");
#include "effects.h"
#include "it_use2.h"
#include "items.h"
+#include "Kills.h"
#include "makeitem.h"
#include "message.h"
#include "misc.h"
@@ -641,9 +642,7 @@ static void _do_chaos_upgrade(item_def &item, const monsters* mon)
description_level_type desc = mons_friendly(mon) ? DESC_CAP_YOUR :
DESC_CAP_THE;
- std::string msg = mon->name(desc);
- msg += "'s ";
- msg = replace_all(msg, "s's", "s'"); // Proper possessive.
+ std::string msg = apostrophise(mon->name(desc));
msg += item.name(DESC_PLAIN, false, false, false);