aboutsummaryrefslogtreecommitdiffstats
path: root/games/xevil
diff options
context:
space:
mode:
authoraraujo <araujo@FreeBSD.org>2012-12-14 15:16:20 +0800
committeraraujo <araujo@FreeBSD.org>2012-12-14 15:16:20 +0800
commit5f7a046850a5927e02b3e92f2955693f59f692fb (patch)
tree807cc9a938cd668365749aa2fd384cf6641191bf /games/xevil
parent6388d9ac468fb59d6dbdd78fd451b4c23d2632f8 (diff)
downloadfreebsd-ports-gnome-5f7a046850a5927e02b3e92f2955693f59f692fb.tar.gz
freebsd-ports-gnome-5f7a046850a5927e02b3e92f2955693f59f692fb.tar.zst
freebsd-ports-gnome-5f7a046850a5927e02b3e92f2955693f59f692fb.zip
- Update MASTER_SITES.
- Fix build using CLANG. - Add LICENSE. - Add MAKE_JOBS_SAFE. PR: ports/172010 Submitted by: KATO Tsuguru <tkato432@yahoo.com>
Diffstat (limited to 'games/xevil')
-rw-r--r--games/xevil/Makefile48
-rw-r--r--games/xevil/files/patch-ad22
-rw-r--r--games/xevil/files/patch-cmn::actual.cpp201
-rw-r--r--games/xevil/files/patch-cmn::area.cpp13
-rw-r--r--games/xevil/files/patch-cmn::game.cpp575
-rw-r--r--games/xevil/files/patch-cmn::game.h47
-rw-r--r--games/xevil/files/patch-cmn::game_style.cpp908
-rw-r--r--games/xevil/files/patch-cmn::game_style.h205
-rw-r--r--games/xevil/files/patch-cmn::intel.cpp107
-rw-r--r--games/xevil/files/patch-cmn::locator.h29
-rw-r--r--games/xevil/files/patch-cmn::physical.cpp178
-rw-r--r--games/xevil/files/patch-cmn::role.cpp472
-rw-r--r--games/xevil/files/patch-cmn::streams.cpp31
-rw-r--r--games/xevil/files/patch-cmn::utils.cpp88
-rw-r--r--games/xevil/files/patch-cmn::world.cpp15
-rw-r--r--games/xevil/files/patch-cmn::xetp.cpp40
-rw-r--r--games/xevil/files/patch-cmn__coord.h11
-rw-r--r--games/xevil/files/patch-cmn__intel.h83
-rw-r--r--games/xevil/files/patch-cmn__locator.cpp10
-rw-r--r--games/xevil/files/patch-cmn__role.h11
-rw-r--r--games/xevil/files/patch-cmn__streams.h29
-rw-r--r--games/xevil/files/patch-cmn__utils.h28
-rw-r--r--games/xevil/files/patch-cmn__xetp.h14
-rw-r--r--games/xevil/files/patch-cmn__xetp_basic.cpp11
-rw-r--r--games/xevil/files/patch-cmn__xetp_basic.h11
-rw-r--r--games/xevil/files/patch-x11::l_agreement_dlg.cpp8
-rw-r--r--games/xevil/files/patch-x11::main.cpp30
-rw-r--r--games/xevil/files/patch-x11::panel.cpp48
-rw-r--r--games/xevil/files/patch-x11::serverping.cpp107
-rw-r--r--games/xevil/files/patch-x11::ui.cpp308
-rw-r--r--games/xevil/files/patch-x11::viewport.cpp287
-rw-r--r--games/xevil/files/patch-x11::xdata.cpp97
-rw-r--r--games/xevil/files/patch-x11__draw.cpp100
-rw-r--r--games/xevil/files/patch-x11__ui.h20
-rw-r--r--games/xevil/files/patch-x11__viewport.h11
-rw-r--r--games/xevil/files/patch-x11__xdata.h28
-rw-r--r--games/xevil/pkg-descr3
-rw-r--r--games/xevil/pkg-plist10
38 files changed, 4040 insertions, 204 deletions
diff --git a/games/xevil/Makefile b/games/xevil/Makefile
index 8aa459f18e9a..fd2ddce13b74 100644
--- a/games/xevil/Makefile
+++ b/games/xevil/Makefile
@@ -1,47 +1,47 @@
-# New ports collection makefile for: xevil
-# Date created: 7 November 2000
-# Whom: Göran Runfeldt <goranrunfeldt@home.se>
-#
+# Created by: G_ran Runfeldt <goranrunfeldt@home.se>
# $FreeBSD$
-#
PORTNAME= xevil
PORTVERSION= 2.02.r2
PORTREVISION= 2
CATEGORIES= games
-MASTER_SITES= http://www.xevil.com/download/stable/
-DISTNAME= xevilsrc${PORTVERSION:S/.r/r/}
+MASTER_SITES= SF/${PORTNAME}.mirror \
+ http://www.xevil.com/download/stable/
+DISTNAME= ${PORTNAME}src${PORTVERSION:S/.r/r/}
MAINTAINER= ports@FreeBSD.org
COMMENT= A fast-action, networked, anti-social, kill-everything game
+LICENSE= GPLv2
+
+OPTIONS_DEFINE= DOCS
+
+NO_WRKSUBDIR=yes
+
USE_ZIP= yes
USE_XORG= xpm
-USE_DOS2UNIX= makefile config.mk cmn/makefile cmn/*.cpp cmn/*.h x11/makefile x11/*.cpp
+USE_DOS2UNIX= *.cpp *.h config.mk makefile
MAKEFILE= makefile
-ALL_TARGET= freebsd
-MAKE_JOBS_UNSAFE= yes
+MAKE_ARGS= DEPTH="${WKRSRC}"
+ALL_TARGET= ${OPSYS:L}
+MAKE_JOBS_SAFE= yes
-.include <bsd.port.pre.mk>
-
-# I'm not sure if this should be here
-.if (${MACHINE} == "alpha")
-CFLAGS+="-DXEVIL_KEYSET=UIalpha"
-.endif
+PORTDOCS= *
+PLIST_FILES= bin/${PORTNAME}
-pre-extract:
- @${MKDIR} ${WRKDIR}/${DISTNAME}
+.include <bsd.port.options.mk>
-do-extract:
- @${UNZIP_CMD} ${EXTRACT_BEFORE_ARGS} ${DISTDIR}/${DISTFILES} -d ${WRKSRC}
+port-patch:
+ @${FIND} ${WRKSRC} -name "*.xpm" | ${XARGS} ${REINPLACE_CMD} -e \
+ 's|^static char|static const char|'
do-install:
- ${INSTALL_PROGRAM} ${WRKSRC}/x11/FREEBSD/xevil ${PREFIX}/bin/xevil
-.if !defined(NOPORTDOCS)
- @${MKDIR} ${DOCSDIR}
+ ${INSTALL_PROGRAM} ${WRKSRC}/x11/${OPSYS:U}/${PORTNAME} ${PREFIX}/bin
+.if ${PORT_OPTIONS:MDOCS}
+ @{MKDIR} ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/readme.txt ${DOCSDIR}
@${MKDIR} ${DOCSDIR}/instructions
${INSTALL_DATA} ${WRKSRC}/instructions/* ${DOCSDIR}/instructions
.endif
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff --git a/games/xevil/files/patch-ad b/games/xevil/files/patch-ad
index 003de2c995b0..ee41a1647319 100644
--- a/games/xevil/files/patch-ad
+++ b/games/xevil/files/patch-ad
@@ -1,6 +1,22 @@
---- makefile.orig Sun Mar 23 00:09:08 2003
-+++ makefile Sun May 18 12:05:08 2003
-@@ -63,11 +63,6 @@
+--- makefile.orig 2012-05-27 06:39:04.000000000 +0900
++++ makefile 2012-05-27 06:42:04.000000000 +0900
+@@ -42,9 +42,9 @@
+ $(OBJ_DIR)/ui_cmn.o $(OBJ_DIR)/l_agreement_dlg.o $(OBJ_DIR)/viewport.o
+
+
+-xevil: $(OBJ_DIR)/xevil $(OBJ_DIR)/xevil$(VERSION).$(PCKG_NAME).tar.Z
++#xevil: $(OBJ_DIR)/xevil $(OBJ_DIR)/xevil$(VERSION).$(PCKG_NAME).tar.Z
+ #xevil: $(OBJ_DIR)/xevil$(VERSION).$(PCKG_NAME).tar.Z
+-#xevil: $(OBJ_DIR)/xevil
++xevil: $(OBJ_DIR)/xevil
+
+
+ # Build the xevil executable.
+@@ -59,15 +59,9 @@
+ cd $(DEPTH)/cmn; $(MAKE)
+ cd $(DEPTH)/x11; $(MAKE)
+ $(CC) $(LINK_FLAGS) $(LINK_OPT) $(LIBS_DIRS) -o $(OBJ_DIR)/xevil $(ALL_OBJS) $(LIBS)
+- $(STRIP) $(OBJ_DIR)/xevil
# Could also include serverping in the distribution
$(OBJ_DIR)/xevil$(VERSION).$(PCKG_NAME).tar.Z::
diff --git a/games/xevil/files/patch-cmn::actual.cpp b/games/xevil/files/patch-cmn::actual.cpp
index f4bf162ff0ad..1b4fdd54e96c 100644
--- a/games/xevil/files/patch-cmn::actual.cpp
+++ b/games/xevil/files/patch-cmn::actual.cpp
@@ -1,21 +1,208 @@
---- cmn/actual.cpp.orig 2000-01-19 12:54:36.000000000 +0100
-+++ cmn/actual.cpp 2007-07-31 15:47:25.000000000 +0200
-@@ -32,7 +32,8 @@
+--- cmn/actual.cpp.orig 2012-05-27 06:52:29.000000000 +0900
++++ cmn/actual.cpp 2012-05-27 06:53:11.000000000 +0900
+@@ -32,7 +32,7 @@
// Include Files
#if X11
-#include <strstream.h>
-+#include <strstream>
-+using namespace std;
++#include <sstream>
#endif
#if WIN32
#include <strstrea.h>
-@@ -1534,7 +1535,7 @@
+@@ -122,6 +122,7 @@
+ #include "bitmaps/yeti/yeti.bitmaps"
+
+
++using namespace std;
+
+ ///// Some helper macros to define creatures with certain abilities.
+ #define DEFINE_CREATURE_CTORS_2(CLASSNAME,ABILITY0,ability0,ABILITY1,ability1) \
+@@ -454,9 +455,9 @@
+ }
+ }
+
+- ostrstream msg;
+- msg << "Explosion hits " << hit << " objects." << ends;
+- locator->message_enq(msg.str());
++ stringstream msg;
++ msg << "Explosion hits " << hit << " objects.";
++ locator->message_enq(Utils::strdup(msg.str().c_str()));
+
+ kill_self();
+ Physical::act();
+@@ -1001,7 +1002,7 @@
+ if (other && (other->get_class_id() != A_AltarOfSin) &&
+ (intel = other->get_intel())) {
+ LocatorP locator = get_locator();
+- ostrstream str;
++ stringstream str;
+
+ // Turned into a frog/baby seal.
+ if (Utils::coin_flip() && other->is_moving() &&
+@@ -1014,8 +1015,8 @@
+
+ str << intel->get_name() << " attacks the Altar of Sin and is "
+ << "turned into a " << (doFrog ? "frog" : "baby-seal")
+- << "." << ends;
+- locator->message_enq(str.str());
++ << ".";
++ locator->message_enq(Utils::strdup(str.str().c_str()));
+
+ other->set_intel(NULL);
+ if (!other->get_mapped()) {
+@@ -1047,8 +1048,8 @@
+ // Lose all health.
+ else {
+ str << "BLASPHMER! " << intel->get_name() <<
+- " loses health for daring to attack the Altar of Sin." << ends;
+- locator->message_enq(str.str());
++ " loses health for daring to attack the Altar of Sin.";
++ locator->message_enq(Utils::strdup(str.str().c_str()));
+
+ int damage = other->get_health();
+ other->corporeal_attack(this,damage);
+@@ -1075,8 +1076,8 @@
+ (intel = other->get_intel()) && intel->is_human()) {
+ int lives = intel->get_lives();
+ LocatorP locator = get_locator();
+- ostrstream msg;
+- ostrstream arenaMsg;
++ stringstream msg;
++ stringstream arenaMsg;
+
+ // Choose different blessings to give.
+ int n = 0;
+@@ -1112,8 +1113,8 @@
+ }
+ else {
+ intel->set_lives(lives + 1);
+- msg << intel->get_name() << " sells soul for an extra life." << ends;
+- arenaMsg << "You Sold Your Soul For an Extra Life" << ends;
++ msg << intel->get_name() << " sells soul for an extra life.";
++ arenaMsg << "You Sold Your Soul For an Extra Life";
+ }
+ break;
+
+@@ -1123,8 +1124,8 @@
+ mod = new DoubleSpeed();
+ assert(mod);
+ modList->append_unique(mod);
+- msg << intel->get_name() << " sells soul for Double Speed." << ends;
+- arenaMsg << "Double Speed" << ends;
++ msg << intel->get_name() << " sells soul for Double Speed.";
++ arenaMsg << "Double Speed";
+ break;
+
+
+@@ -1138,9 +1139,8 @@
+ mod = new DoubleJump();
+ assert(mod);
+ modList->append_unique(mod);
+- msg << intel->get_name() << " sells soul for extra jumping powers."
+- << ends;
+- arenaMsg << "Extra Jumping Powers" << ends;
++ msg << intel->get_name() << " sells soul for extra jumping powers.";
++ arenaMsg << "Extra Jumping Powers";
+ break;
+
+
+@@ -1157,8 +1157,8 @@
+ // So max health takes effect immediately.
+ other->heal();
+
+- msg << intel->get_name() << " sells soul for Double Health." << ends;
+- arenaMsg << "Double Health" << ends;
++ msg << intel->get_name() << " sells soul for Double Health.";
++ arenaMsg << "Double Health";
+ break;
+
+
+@@ -1176,8 +1176,8 @@
+ // Might as well make sure they can take advantage of it now.
+ other->heal();
+
+- msg << intel->get_name() << " sells soul for Healing Powers." << ends;
+- arenaMsg << "Healing Powers" << ends;
++ msg << intel->get_name() << " sells soul for Healing Powers.";
++ arenaMsg << "Healing Powers";
+ }
+ break;
+
+@@ -1193,8 +1193,8 @@
+ // Already checked that other is a Creature().
+ ((CreatureP)other)->add_ability(a);
+
+- msg << intel->get_name() << " sells soul for HellFire Powers." << ends;
+- arenaMsg << "HellFire Powers" << ends;
++ msg << intel->get_name() << " sells soul for HellFire Powers.";
++ arenaMsg << "HellFire Powers";
+ }
+ break;
+
+@@ -1217,8 +1217,8 @@
+ // Already checked that other is a Creature().
+ ((CreatureP)other)->add_ability(a);
+
+- msg << intel->get_name() << " sells soul for Fireballs." << ends;
+- arenaMsg << "Fireballs" << ends;
++ msg << intel->get_name() << " sells soul for Fireballs.";
++ arenaMsg << "Fireballs";
+ }
+ break;
+
+@@ -1241,8 +1241,8 @@
+ // Already checked that other is a Creature().
+ ((CreatureP)other)->add_ability(a);
+
+- msg << intel->get_name() << " sells soul for Flying Powers." << ends;
+- arenaMsg << "Flying Powers" << ends;
++ msg << intel->get_name() << " sells soul for Flying Powers.";
++ arenaMsg << "Flying Powers";
+ }
+ break;
+
+@@ -1274,8 +1274,8 @@
+ // Already checked that other is a Creature().
+ ((CreatureP)other)->add_ability(a);
+
+- msg << intel->get_name() << " sells soul for Sticky Powers." << ends;
+- arenaMsg << "Sticky Powers" << ends;
++ msg << intel->get_name() << " sells soul for Sticky Powers.";
++ arenaMsg << "Sticky Powers";
+ }
+ break;
+
+@@ -1285,8 +1285,8 @@
+ }
+ } // while
+
+- locator->message_enq(msg.str());
+- locator->arena_message_enq(arenaMsg.str(),other);
++ locator->message_enq(Utils::strdup(msg.str().c_str()));
++ locator->arena_message_enq(Utils::strdup(arenaMsg.str().c_str()),other);
+
+ kill_self();
+ turnTaken = True;
+@@ -1534,7 +1534,7 @@
void *closure) {
// notThis is used to prevent transmogifying into the same class an object
// already is.
- ClassId notThis = (ClassId)closure;
-+ ClassId notThis = (intptr_t)closure;
++ ClassId notThis = (long)closure;
if (pc->classId == notThis) {
return False;
}
+@@ -2087,10 +2087,9 @@
+ PhysicalP seal = new Seal(w,l,pos);
+ assert(seal);
+
+- char sealStr[20];
+- ostrstream str(sealStr,20);
+- str << "seal-" << sealsNum << ends;
+- NeutralP sealIntel = new SealIntel(w,l,sealStr,homeId);
++ stringstream str;
++ str << "seal-" << sealsNum;
++ NeutralP sealIntel = new SealIntel(w,l,Utils::strdup(str.str().c_str()),homeId);
+ seal->set_intel(sealIntel);
+ l->register_neutral(sealIntel);
+ seals[sealsNum] = sealIntel->get_intel_id();
diff --git a/games/xevil/files/patch-cmn::area.cpp b/games/xevil/files/patch-cmn::area.cpp
index 15133f5610f2..1c268954c8a0 100644
--- a/games/xevil/files/patch-cmn::area.cpp
+++ b/games/xevil/files/patch-cmn::area.cpp
@@ -1,12 +1,17 @@
---- cmn/area.cpp.orig Wed Mar 19 10:04:22 2003
-+++ cmn/area.cpp Sat Oct 25 21:39:50 2003
-@@ -34,7 +34,8 @@
+--- cmn/area.cpp.orig 2012-05-27 06:52:29.000000000 +0900
++++ cmn/area.cpp 2012-05-27 06:53:11.000000000 +0900
+@@ -34,12 +34,13 @@
extern "C" {
#include <limits.h> // For INT_MAX
}
-#include <iostream.h>
+#include <iostream>
-+using namespace std;
#include "utils.h"
#include "coord.h"
#include "area.h"
+
+
++using namespace std;
+
+ Size Area::operator - (const Area &other) const {
+ assert ((shape == AR_RECT) && (other.shape == AR_RECT));
diff --git a/games/xevil/files/patch-cmn::game.cpp b/games/xevil/files/patch-cmn::game.cpp
index 0ce375a3ced2..b7407b7d8370 100644
--- a/games/xevil/files/patch-cmn::game.cpp
+++ b/games/xevil/files/patch-cmn::game.cpp
@@ -1,12 +1,577 @@
---- cmn/game.cpp.orig Sat Mar 22 22:20:00 2003
-+++ cmn/game.cpp Sat Oct 25 21:40:23 2003
-@@ -34,7 +34,8 @@
+--- cmn/game.cpp.orig 2012-05-27 06:52:29.000000000 +0900
++++ cmn/game.cpp 2012-05-27 06:53:11.000000000 +0900
+@@ -31,16 +31,17 @@
+ #include "stdafx.h"
+ extern "C" {
+ #include <string.h>
++#include <stdlib.h>
}
#if X11
-#include <strstream.h>
-+#include <strstream>
-+using namespace std;
++#include <sstream>
#endif
#if WIN32
#include <strstrea.h>
+ #endif
+
+-#include <iomanip.h>
++#include <iomanip>
+
+ #include "utils.h"
+ #include "coord.h"
+@@ -123,7 +124,7 @@
+ #define SOUNDONOFF_DEFAULT True
+
+
+-char *Game::wittySayings[Game::WITTY_SAYINGS_NUM] = {
++const char *Game::wittySayings[Game::WITTY_SAYINGS_NUM] = {
+ "If it moves it's a threat. If it doesn't move it's a potential threat.",
+ "Happy, happy. Joy, joy.",
+ "For the mother country!!!",
+@@ -271,11 +272,19 @@
+ "Prepare to Qualify.",
+ "I got a bad feeling about this drop.",
+ "Cowboys never quit!",
++ "The voices say I'm not crazy, so I'm OK!",
++ "Cure Sars!?!",
++ "Ha Ha Ha, Loser!",
++ "It's all fun and games until someone loses an eye.",
++ "Eye for an eye, tooth for a tooth.",
++ "Mo-o-m!",
++ "Timmy's touching me!",
++ "I'm not touching you! See? I'm not touching you!"
+ };
+
+
+
+-char *Game::intelNames[Game::INTEL_NAMES_NUM] = {
++const char *Game::intelNames[Game::INTEL_NAMES_NUM] = {
+ "Dr. Pain",
+ "Steve",
+ "hardts",
+@@ -350,6 +359,9 @@
+ "Stan",
+ "Mr. Hat",
+ "Cid",
++ "Mr. Hankey",
++ "Michael Jackson",
++ "O.J. Simpson"
+ };
+
+
+@@ -793,7 +805,7 @@
+
+ // Just for tracing in the debugger.
+ char* version = Utils::get_OS_info();
+- delete version;
++ delete [] version;
+
+ noUi = False;
+ noNewLevel = False;
+@@ -1056,7 +1068,7 @@
+
+ Game::~Game() {
+ if (oneItem) {
+- delete oneItem;
++ delete [] oneItem;
+ }
+
+ delete ui;
+@@ -1500,13 +1512,13 @@
+
+ if (mask & UIconnectServer) {
+ delete role;
+- ostrstream portName;
+- portName << settings.connectPort << ends;
++ stringstream portName;
++ portName << settings.connectPort;
+ IViewportInfo* vInfo = Ui::get_viewport_info();
+- ClientP client = new Client(settings.connectHostname,portName.str(),
++ ClientP client = new Client(settings.connectHostname,
++ Utils::strdup(portName.str().c_str()),
+ 0,settings.humanName,vInfo,
+ Connection::ADJUST_SKIP,&locator);
+- delete portName.str();
+ assert(client);
+ role = client;
+ ui->set_role_type(role->get_type());
+@@ -1544,10 +1556,9 @@
+ }
+
+ delete role;
+- ostrstream portName;
+- portName << settings.serverPort << ends;
+- role = new Server(settings.localHuman,portName.str(),&locator);
+- delete portName.str();
++ stringstream portName;
++ portName << settings.serverPort;
++ role = new Server(settings.localHuman,portName.str().c_str(),&locator);
+ assert(role);
+ restartEnd = RE_RESTART;
+ ui->set_role_type(role->get_type());
+@@ -1573,9 +1584,9 @@
+ ui->set_style(styleType);
+ }
+
+- ostrstream str;
++ stringstream str;
+ styleNext->describe(str);
+- locator.message_enq(str.str());
++ locator.message_enq(Utils::strdup(str.str().c_str()));
+ }
+
+
+@@ -1589,9 +1600,9 @@
+ human->reincarnate();
+ obj->set_intel(human);
+
+- ostrstream msg;
+- msg << human->get_name() << " is back from the dead." << ends;
+- locator.message_enq(msg.str());
++ stringstream msg;
++ msg << human->get_name() << " is back from the dead.";
++ locator.message_enq(Utils::strdup(msg.str().c_str()));
+ }
+ }
+
+@@ -1615,7 +1626,7 @@
+ void Game::new_level_check(int enemiesPlaying) {
+ assert(state == gameOn);
+
+- ostrstream str;
++ stringstream str;
+ Boolean lStrChanged = False;
+ int val = style->new_level_check(enemiesPlaying,&world,&locator,
+ level,lStrChanged,str,timer,
+@@ -1645,11 +1656,8 @@
+ // if str has anything in it. Fucking Linux compilers.
+ if (lStrChanged) {
+ if (ui) {
+- ui->set_level(str.str());
++ ui->set_level(str.str().c_str());
+ }
+- // Ok to delete even if ui is NULL, str.str() will allocate the memory to
+- // kill off.
+- delete str.str();
+ }
+ }
+
+@@ -1841,7 +1849,7 @@
+
+
+
+-char *Game::choose_ranking(int kills) {
++const char *Game::choose_ranking(int kills) {
+ // Figure out the ranking set, they are listed in order.
+ int setNum = 0;
+ assert(kills >= 0 && rankingSets[0].killsMin == 0);
+@@ -1876,7 +1884,7 @@
+ if (showMessages) {
+ for (int n = 0; n < locator.humans_registered(); n++) {
+ HumanP human = locator.get_human(n);
+- ostrstream msg;
++ stringstream msg;
+
+ // Soups are only taken into account if you have unlimited lives.
+ int totalKills;
+@@ -1894,11 +1902,11 @@
+ totalKills = human->get_human_kills() + human->get_enemy_kills();
+ }
+
+- char *ranking = choose_ranking(totalKills);
++ const char *ranking = choose_ranking(totalKills);
+ msg << totalKills << (totalKills == 1 ? "Kill" : " Kills")
+- << ", Rank: " << ranking << ends;
++ << ", Rank: " << ranking;
+ IntelId humanIntelId = human->get_intel_id();
+- locator.arena_message_enq(msg.str(),&humanIntelId,10000);
++ locator.arena_message_enq(Utils::strdup(msg.str().c_str()),&humanIntelId,10000);
+ }
+ }
+ }
+@@ -1919,8 +1927,8 @@
+ // Will clean out non-persistent teams.
+ locator.level_reset();
+
+- ostrstream lStr; // For level box on the side of the ui->
+- ostrstream lTitleStr; // For Ui title screen.
++ stringstream lStr; // For level box on the side of the ui->
++ stringstream lTitleStr; // For Ui title screen.
+ Boolean doBonus;
+
+ // Possibly increment level count number.
+@@ -1960,7 +1968,7 @@
+ if (doBonus) {
+ delete levelTitleStored; // If it already exists.
+ // Store levelTitle string for later use.
+- levelTitleStored = lTitleStr.str();
++ levelTitleStored = Utils::strdup(lTitleStr.str().c_str());
+
+ // Tell user about the bonus.
+ award_bonuses_now();
+@@ -1970,13 +1978,12 @@
+ }
+ // Go to getBearings state.
+ else {
+- get_bearings(lTitleStr.str());
++ get_bearings(Utils::strdup(lTitleStr.str().c_str()));
+ }
+
+ if (ui) {
+- ui->set_level(lStr.str());
++ ui->set_level(lStr.str().c_str());
+ }
+- delete lStr.str();
+
+ // Will pass in more info later.
+ role->new_level(this,&world,&locator);
+@@ -1997,7 +2004,7 @@
+ continue;
+ }
+
+- char* awardMsg = NULL;
++ const char* awardMsg = NULL;
+ int count = 0;
+ while (!awardMsg && count < AWARD_BONUS_TRIES) {
+ count++;
+@@ -2184,9 +2191,9 @@
+
+ // Moved resetting world rooms to new_level();
+
+- ostrstream msg;
+- msg << wittySayings[Utils::choose(WITTY_SAYINGS_NUM)] << ends;
+- locator.message_enq(msg.str());
++ stringstream msg;
++ msg << wittySayings[Utils::choose(WITTY_SAYINGS_NUM)];
++ locator.message_enq(Utils::strdup(msg.str().c_str()));
+
+ /* Don't need to call Ui::set_* because the new values originally came
+ from ui-> */
+@@ -2242,41 +2249,39 @@
+ { // Right keys.
+ right[n][which] = 0;
+
+- ostrstream strm;
++ stringstream strm;
+ if (which == 0)
+- strm << "right_" << keysNames[n] << ends;
++ strm << "right_" << keysNames[n];
+ else
+- strm << "right_" << keysNames[n] << "_2" << ends;
+- char *option = strm.str();
++ strm << "right_" << keysNames[n] << "_2";
++ const string & option = strm.str();
+
+ // Should we free value??
+- char *value = XGetDefault(ui->get_dpy(0),XEVIL_CLASS,option);
++ char *value = XGetDefault(ui->get_dpy(0),XEVIL_CLASS,option.c_str());
+ if (value) {
+ KeySym keysym = XStringToKeysym(value);
+ if (keysym != NoSymbol)
+ right[n][which] = keysym;
+ }
+- delete option;
+ }
+
+ { // Left Keys.
+ left[n][which] = 0;
+
+- ostrstream strm;
++ stringstream strm;
+ if (which == 0)
+- strm << "left_" << keysNames[n] << ends;
++ strm << "left_" << keysNames[n];
+ else
+- strm << "left_" << keysNames[n] << "_2" << ends;
+- char *option = strm.str();
++ strm << "left_" << keysNames[n] << "_2";
++ const string & option = strm.str();
+
+ // Should we free value??
+- char *value = XGetDefault(ui->get_dpy(0),XEVIL_CLASS,option);
++ char *value = XGetDefault(ui->get_dpy(0),XEVIL_CLASS,option.c_str());
+ if (value) {
+ KeySym keysym = XStringToKeysym(value);
+ if (keysym != NoSymbol)
+ left[n][which] = keysym;
+ }
+- delete option;
+ }
+ }
+
+@@ -2291,10 +2296,10 @@
+ void Game::parse_args(int *argc,char **argv) {
+ // Create a bunch of "-name<x>" strings for comparing with command-line
+ // args.
+- ostrstream dashName[Locator::HUMANS_MAX];
++ stringstream dashName[Locator::HUMANS_MAX];
+ int n;
+ for (n = 0; n < Locator::HUMANS_MAX; n++) {
+- dashName[n] << "-name" << n << ends;
++ dashName[n] << "-name" << n;
+ }
+
+ // Defaults
+@@ -2351,7 +2356,7 @@
+ // Check "-name<x>" arguments.
+ else {
+ for (int j = 0; j < Locator::HUMANS_MAX; j++) {
+- if ((! strcmp(dashName[j].str(),argv[n])) && (n + 1 < *argc)) {
++ if ((! strcmp(dashName[j].str().c_str(),argv[n])) && (n + 1 < *argc)) {
+ humanNames[j] = Utils::strdup(argv[n+1]);
+ n++;
+ }
+@@ -2728,12 +2733,6 @@
+ n++;
+ }
+ } // for
+-
+-
+- // Delete memory for "-name" strings.
+- for (n = 0; n < Locator::HUMANS_MAX; n++) {
+- delete dashName[n].str();
+- }
+ }
+
+
+@@ -2741,15 +2740,15 @@
+ char **Game::display_names(int *argc,char **argv) {
+
+ #if X11
+- ostrstream dashDisplay[UI_VIEWPORTS_MAX][2];
++ stringstream dashDisplay[UI_VIEWPORTS_MAX][2];
+ char **displayNames = new charP [UI_VIEWPORTS_MAX];
+
+ int n;
+ for (n = 0; n < UI_VIEWPORTS_MAX; n++) {
+ displayNames[n] = new char [Xvars::DISPLAY_NAME_LENGTH];
+ strcpy(displayNames[n],"");
+- dashDisplay[n][0] << "-display" << n << ends;
+- dashDisplay[n][1] << "-d" << n << ends;
++ dashDisplay[n][0] << "-display" << n;
++ dashDisplay[n][1] << "-d" << n;
+ }
+
+ // Loop through all command line arguments.
+@@ -2765,7 +2764,7 @@
+ // Set display name for one viewport.
+ for (int m = 0; m < UI_VIEWPORTS_MAX; m++) {
+ for (int which = 0; which < 2; which++) {
+- if (!strcmp(argv[n],dashDisplay[m][which].str())) {
++ if (!strcmp(argv[n],dashDisplay[m][which].str().c_str())) {
+ assert(strlen(argv[n+1]) < Xvars::DISPLAY_NAME_LENGTH);
+ strcpy(displayNames[m],argv[n+1]);
+ }
+@@ -2773,11 +2772,6 @@
+ }
+ }
+
+- for (n = 0; n < UI_VIEWPORTS_MAX; n++) {
+- for (int which = 0; which < 2; which++) {
+- delete dashDisplay[n][which].str();
+- }
+- }
+ return displayNames;
+ #endif
+
+@@ -2890,7 +2884,7 @@
+ assert(role->get_type() != R_CLIENT);
+
+ // Choose random name if -name was not specified for this player.
+- char *nameNonPc =
++ const char *nameNonPc =
+ Utils::strlen(humanNames[h]) ?
+ humanNames[h] :
+ intelNames[intelNamesIndices[h % INTEL_NAMES_NUM]];
+@@ -2954,13 +2948,12 @@
+
+ // Put message in the status bar when the game starts up.
+ // Use \n in string for locator.message_enq.
+- ostrstream msg;
++ stringstream msg;
+ msg
+ << "XEvil(TM) " << VERSION
+ << " http://www.xevil.com satan@xevil.com " << XETP::versionStr << "\n"
+- << "Copyright(C) 1994,2000 Steve Hardt and Michael Judge"
+- << ends;
+- locator.message_enq(msg.str());
++ << "Copyright(C) 1994,2000 Steve Hardt and Michael Judge";
++ locator.message_enq(Utils::strdup(msg.str().c_str()));
+
+
+ // Print message to standard out. Doesn't really do anything on Windows.
+@@ -3075,11 +3068,10 @@
+ IntelOptions ops;
+ ITmask opMask = intel_options_for(ops,obj->get_class_id());
+
+- ostrstream name;
+- name << "Machine-" << (enemyNameCount++) << ends;
+- EnemyP enemy = new Enemy(&world,&locator,name.str(),&ops,opMask);
++ stringstream name;
++ name << "Machine-" << (enemyNameCount++);
++ EnemyP enemy = new Enemy(&world,&locator,name.str().c_str(),&ops,opMask);
+ assert(enemy);
+- delete name.str();
+ locator.register_enemy(enemy);
+
+ if (addToLocator) {
+@@ -3235,14 +3227,13 @@
+ switch (Utils::choose(8)) {
+ case 0: { // A bunch of Heros and an Alien.
+ for (int n = 0; n < 10; n++) {
+- ostrstream name;
+- name << "Enemy-" << n << ends;
++ stringstream name;
++ name << "Enemy-" << n;
+ IntelOptions ops;
+ ops.harmless = True;
+- EnemyP enemy = new Enemy(&world,&locator,name.str(),
++ EnemyP enemy = new Enemy(&world,&locator,name.str().c_str(),
+ &ops,ITharmless);
+ assert(enemy);
+- delete name.str();
+ locator.register_enemy(enemy);
+
+ Pos pos = world.empty_rect(Hero::get_size_max());
+@@ -3268,16 +3259,15 @@
+
+ case 1: { // Hero, FThrower, and a bunch of Frogs (does not mean Frenchmen).
+ for (int n = 0; n < 15; n++) {
+- ostrstream name;
+- name << "Enemy-" << n << ends;
++ stringstream name;
++ name << "Enemy-" << n;
+ IntelOptions ops;
+ ops.psychotic = Utils::coin_flip();
+- EnemyP enemy = new Enemy(&world,&locator,name.str(),
++ EnemyP enemy = new Enemy(&world,&locator,name.str().c_str(),
+ &ops,ITpsychotic);
+ assert(enemy);
+- delete name.str();
+ locator.register_enemy(enemy);
+-
++
+ Pos pos = world.empty_rect(Frog::get_size_max());
+ PhysicalP obj = new Frog(&world,&locator,pos);
+ assert(obj);
+@@ -3304,15 +3294,14 @@
+ case 2: { // A bunch of Enforcers.
+ for (int n = 0; n < 10; n++)
+ {
+- ostrstream name;
+- name << "Enemy-" << n << ends;
++ stringstream name;
++ name << "Enemy-" << n;
+ IntelOptions ops;
+ ops.classFriends = False;
+ ops.psychotic = True;
+- EnemyP enemy = new Enemy(&world,&locator,name.str(),
++ EnemyP enemy = new Enemy(&world,&locator,name.str().c_str(),
+ &ops,ITclassFriends|ITpsychotic);
+ assert(enemy);
+- delete name.str();
+ locator.register_enemy(enemy);
+
+ Pos pos = world.empty_rect(Enforcer::get_size_max());
+@@ -3327,14 +3316,13 @@
+
+ case 3: { // A bunch of Ninjas and a chainsaw.
+ for (int n = 0; n < 10; n++) {
+- ostrstream name;
+- name << "Enemy-" << n << ends;
++ stringstream name;
++ name << "Enemy-" << n;
+ IntelOptions ops;
+ ops.classFriends = False;
+- EnemyP enemy = new Enemy(&world,&locator,name.str(),
++ EnemyP enemy = new Enemy(&world,&locator,name.str().c_str(),
+ &ops,ITclassFriends);
+ assert(enemy);
+- delete name.str();
+ locator.register_enemy(enemy);
+
+ Pos pos = world.empty_rect(Ninja::get_size_max());
+@@ -3373,12 +3361,11 @@
+ }
+
+ for (int m = 0; m < 10; m++) {
+- ostrstream name;
+- name << "Enemy-" << m << ends;
+- EnemyP enemy = new Enemy(&world,&locator,name.str(),
++ stringstream name;
++ name << "Enemy-" << m;
++ EnemyP enemy = new Enemy(&world,&locator,name.str().c_str(),
+ NULL,ITnone);
+ assert(enemy);
+- delete name.str();
+ locator.register_enemy(enemy);
+
+ Pos pos = world.empty_rect(Hero::get_size_max());
+@@ -3414,14 +3401,13 @@
+ case 5: { // Ninjas and ChopperBoys.
+ int n;
+ for (n = 0; n < 10; n++) {
+- ostrstream name;
+- name << "Enemy-" << n << ends;
++ stringstream name;
++ name << "Enemy-" << n;
+ IntelOptions ops;
+ ops.classFriends = False;
+- EnemyP enemy = new Enemy(&world,&locator,name.str(),
++ EnemyP enemy = new Enemy(&world,&locator,name.str().c_str(),
+ &ops,ITclassFriends);
+ assert(enemy);
+- delete name.str();
+ locator.register_enemy(enemy);
+
+ PhysicalP obj;
+@@ -3458,11 +3444,10 @@
+ // and the scenario isn't set up yet.
+
+ for (n = 0; n < 9; n++) {
+- ostrstream name;
+- name << "Dog-" << n << ends;
+- EnemyP intel = new Enemy(&world,&locator,name.str(),NULL,ITnone);
++ stringstream name;
++ name << "Dog-" << n;
++ EnemyP intel = new Enemy(&world,&locator,name.str().c_str(),NULL,ITnone);
+ assert(intel);
+- delete name.str();
+ locator.register_enemy(intel);
+
+ Pos pos = world.empty_rect(Dog::get_size_max());
+@@ -3473,13 +3458,12 @@
+ }
+
+ for (n = 0; n < 3; n++) {
+- ostrstream name;
+- name << "Enemy-" << n << ends;
++ stringstream name;
++ name << "Enemy-" << n;
+ IntelOptions ops;
+ ops.harmless = True;
+- EnemyP enemy = new Enemy(&world,&locator,name.str(),&ops,ITharmless);
++ EnemyP enemy = new Enemy(&world,&locator,name.str().c_str(),&ops,ITharmless);
+ assert(enemy);
+- delete name.str();
+ locator.register_enemy(enemy);
+
+ PhysicalP obj;
+@@ -3510,13 +3494,12 @@
+ Segmented::create_and_add_composite(ret,&world,&locator,Dragon::SEGMENTS_NUM,pos,
+ Dragon::create,NULL);
+ for (int m = 0; m < ret.length(); m++) {
+- ostrstream name;
+- name << "Enemy-" << n << ends;
++ stringstream name;
++ name << "Enemy-" << n;
+ IntelOptions ops;
+ ops.harmless = True;
+- EnemyP enemy = new Enemy(&world,&locator,name.str(),&ops,ITharmless);
++ EnemyP enemy = new Enemy(&world,&locator,name.str().c_str(),&ops,ITharmless);
+ assert(enemy);
+- delete name.str();
+ locator.register_enemy(enemy);
+ PhysicalP p = (PhysicalP)ret.get(m);
+ p->set_intel(enemy);
diff --git a/games/xevil/files/patch-cmn::game.h b/games/xevil/files/patch-cmn::game.h
index ec1b32704c95..9fb9045baaa4 100644
--- a/games/xevil/files/patch-cmn::game.h
+++ b/games/xevil/files/patch-cmn::game.h
@@ -1,12 +1,51 @@
---- cmn/game.h.dist Sat Mar 22 20:44:32 2003
-+++ cmn/game.h Sat Oct 25 21:40:54 2003
-@@ -35,7 +35,8 @@
+--- cmn/game.h.orig 2012-05-27 06:52:31.000000000 +0900
++++ cmn/game.h 2012-05-27 06:53:11.000000000 +0900
+@@ -35,7 +35,7 @@
extern "C" {
#include <time.h>
}
-#include <iostream.h>
+#include <iostream>
-+using namespace std;
#include "utils.h"
#include "ui.h"
#include "world.h"
+@@ -136,7 +136,7 @@
+ struct RankingSet {
+ enum {RANKING_SET_MAX = 8}; // Max number of rankings in a set.
+ int killsMin; // Min number of kills to get this rank.
+- char *rankings[RANKING_SET_MAX + 1]; // Extra for NULL.
++ const char *rankings[RANKING_SET_MAX + 1]; // Extra for NULL.
+ };
+
+
+@@ -268,8 +268,8 @@
+
+ private:
+ enum {
+- WITTY_SAYINGS_NUM = 147,
+- INTEL_NAMES_NUM = 74,
++ WITTY_SAYINGS_NUM = 155,
++ INTEL_NAMES_NUM = 77,
+ RANKING_SETS_NUM = 12,
+ };
+
+@@ -306,7 +306,7 @@
+ static Boolean potential_enemy_filter(const PhysicalContext* pc,void*);
+ /* EFFECTS: Filter those classes whose potentialEnemy flag is True. */
+
+- char *choose_ranking(int kills);
++ const char *choose_ranking(int kills);
+ /* EFFECTS: Choose a rank for the player at the end of game based on the
+ number of kills. */
+
+@@ -412,8 +412,8 @@
+ SoundName currentSoundName;
+ //keeps track of current sound track being played: can be 0
+
+- static char *wittySayings[WITTY_SAYINGS_NUM];
+- static char *intelNames[INTEL_NAMES_NUM];
++ static const char *wittySayings[WITTY_SAYINGS_NUM];
++ static const char *intelNames[INTEL_NAMES_NUM];
+ static DifficultyLevel difficultyLevels[DIFFICULTY_LEVELS_NUM];
+ static RankingSet rankingSets[RANKING_SETS_NUM];
+
diff --git a/games/xevil/files/patch-cmn::game_style.cpp b/games/xevil/files/patch-cmn::game_style.cpp
index 4fc02cc99b8c..c7179626de05 100644
--- a/games/xevil/files/patch-cmn::game_style.cpp
+++ b/games/xevil/files/patch-cmn::game_style.cpp
@@ -1,21 +1,911 @@
---- cmn/game_style.cpp.orig 2003-03-22 20:47:42.000000000 +0100
-+++ cmn/game_style.cpp 2007-07-31 15:57:08.000000000 +0200
-@@ -34,7 +34,8 @@
+--- cmn/game_style.cpp.orig 2012-05-27 06:52:29.000000000 +0900
++++ cmn/game_style.cpp 2012-05-27 06:53:11.000000000 +0900
+@@ -33,15 +33,9 @@
+ #include <string.h>
}
- #if X11
+-#if X11
-#include <strstream.h>
-+#include <strstream>
-+using namespace std;
+-#endif
+-
+-#if WIN32
+-#include <strstrea.h>
+-#endif
++#include <sstream>
+
+-#include <iomanip.h>
++#include <iomanip>
+ #include "utils.h"
+ #include "coord.h"
+ #include "world.h"
+@@ -109,13 +103,13 @@
+ /* DEFAULT: True */
+
+ virtual int new_level_check(int enemiesPlaying,WorldP,LocatorP,
+- int level,Boolean &lStrChanged,ostrstream &levelStr,Timer &timer,
++ int level,Boolean &lStrChanged,stringstream &levelStr,Timer &timer,
+ IPhysicalManagerP) = 0;
+
+ virtual void setup_world(WorldP,LocatorP,const DifficultyLevel &) = 0;
+ virtual void new_level(int level,WorldP world,LocatorP locator,
+ const DifficultyLevel &dLevel,
+- ostrstream &lStr,ostrstream &lTitleStr,
++ stringstream &lStr,stringstream &lTitleStr,
+ IPhysicalManagerP manager,int humansNum) = 0;
+ /* EFFECTS: These two functions start a new level in a scenario. setup_world() should
+ just setup the map and size of the world. new_level() is called after world.reset()
+@@ -158,13 +152,13 @@
+ virtual ScenarioType get_scenario_type() {return EXTERMINATE;}
+
+ virtual int new_level_check(int enemiesPlaying,WorldP,LocatorP,
+- int level,Boolean &lStrChanged,ostrstream &levelStr,Timer &timer,
++ int level,Boolean &lStrChanged,stringstream &levelStr,Timer &timer,
+ IPhysicalManagerP);
+
+ virtual void setup_world(WorldP,LocatorP,const DifficultyLevel &);
+ virtual void new_level(int level,WorldP world,LocatorP locator,
+ const DifficultyLevel &dLevel,
+- ostrstream &lStr,ostrstream &lTitleStr,
++ stringstream &lStr,stringstream &lTitleStr,
+ IPhysicalManagerP manager,int humansNum);
+
+
+@@ -183,13 +177,13 @@
+ virtual Boolean can_refill_game_objects();
+
+ virtual int new_level_check(int enemiesPlaying,WorldP,LocatorP,
+- int level,Boolean &lStrChanged,ostrstream &levelStr,Timer &timer,
++ int level,Boolean &lStrChanged,stringstream &levelStr,Timer &timer,
+ IPhysicalManagerP);
+
+ virtual void setup_world(WorldP,LocatorP,const DifficultyLevel &);
+ virtual void new_level(int level,WorldP world,LocatorP locator,
+ const DifficultyLevel &dLevel,
+- ostrstream &lStr,ostrstream &lTitleStr,
++ stringstream &lStr,stringstream &lTitleStr,
+ IPhysicalManagerP manager,int humansNum);
+
+ virtual void new_level_set_timer(Timer &timer);
+@@ -209,7 +203,7 @@
+ virtual ScenarioType get_scenario_type() {return HIVE;}
+
+ virtual int new_level_check(int enemiesPlaying,WorldP,LocatorP,
+- int level,Boolean &lStrChanged,ostrstream &levelStr,Timer &timer,
++ int level,Boolean &lStrChanged,stringstream &levelStr,Timer &timer,
+ IPhysicalManagerP);
+
+ virtual Boolean award_bonus();
+@@ -218,7 +212,7 @@
+ virtual void setup_world(WorldP,LocatorP,const DifficultyLevel &);
+ virtual void new_level(int level,WorldP world,LocatorP locator,
+ const DifficultyLevel &dLevel,
+- ostrstream &lStr,ostrstream &lTitleStr,
++ stringstream &lStr,stringstream &lTitleStr,
+ IPhysicalManagerP manager,int humansNum);
+
+ virtual void refill_enemies(Boolean enemiesRefill,WorldP,LocatorP,IPhysicalManagerP);
+@@ -242,13 +236,13 @@
+ virtual ScenarioType get_scenario_type() {return CAPTURE_THE_FLAG;}
+
+ virtual int new_level_check(int enemiesPlaying,WorldP,LocatorP,
+- int level,Boolean &lStrChanged,ostrstream &levelStr,Timer &timer,
++ int level,Boolean &lStrChanged,stringstream &levelStr,Timer &timer,
+ IPhysicalManagerP);
+
+ virtual void setup_world(WorldP,LocatorP,const DifficultyLevel &);
+ virtual void new_level(int level,WorldP world,LocatorP locator,
+ const DifficultyLevel &dLevel,
+- ostrstream &lStr,ostrstream &lTitleStr,
++ stringstream &lStr,stringstream &lTitleStr,
+ IPhysicalManagerP manager,int humansNum);
+
+ virtual void refill_enemies(Boolean enemiesRefill,WorldP,LocatorP,IPhysicalManagerP);
+@@ -269,7 +263,7 @@
+ virtual void setup_world(WorldP,LocatorP,const DifficultyLevel &);
+ virtual void new_level(int level,WorldP world,LocatorP locator,
+ const DifficultyLevel &dLevel,
+- ostrstream &lStr,ostrstream &lTitleStr,
++ stringstream &lStr,stringstream &lTitleStr,
+ IPhysicalManagerP manager,int humansNum);
+
+ virtual Boolean advance_level();
+@@ -292,7 +286,7 @@
+
+ virtual Boolean (*get_team())(LocatorP,PhysicalP,PhysicalP) = 0;
+
+- virtual void set_level_strings(int level,ostrstream &lStr,ostrstream &lTitleStr) = 0;
++ virtual void set_level_strings(int level,stringstream &lStr,stringstream &lTitleStr) = 0;
+ /* EFFECTS: Called in new_level() to set the appropriate messages. */
+
+
+@@ -311,7 +305,7 @@
+ virtual ScenarioType get_scenario_type() {return SEALS;}
+
+ virtual int new_level_check(int enemiesPlaying,WorldP,LocatorP,
+- int level,Boolean &lStrChanged,ostrstream &levelStr,Timer &timer,
++ int level,Boolean &lStrChanged,stringstream &levelStr,Timer &timer,
+ IPhysicalManagerP);
+
+ virtual Boolean award_bonus();
+@@ -323,7 +317,7 @@
+ #endif
+ virtual Boolean (*get_team())(LocatorP,PhysicalP,PhysicalP);
+
+- virtual void set_level_strings(int level,ostrstream &lStr,ostrstream &lTitleStr);
++ virtual void set_level_strings(int level,stringstream &lStr,stringstream &lTitleStr);
+
+
+ private:
+@@ -342,7 +336,7 @@
+ virtual ScenarioType get_scenario_type() {return ANTI_SEALS;}
+
+ virtual int new_level_check(int enemiesPlaying,WorldP,LocatorP,
+- int level,Boolean &lStrChanged,ostrstream &levelStr,Timer &timer,
++ int level,Boolean &lStrChanged,stringstream &levelStr,Timer &timer,
+ IPhysicalManagerP);
+
+
+@@ -351,7 +345,7 @@
+ #endif
+ virtual Boolean (*get_team())(LocatorP,PhysicalP,PhysicalP);
+
+- virtual void set_level_strings(int level,ostrstream &lStr,ostrstream &lTitleStr);
++ virtual void set_level_strings(int level,stringstream &lStr,stringstream &lTitleStr);
+
+
+ private:
+@@ -369,13 +363,13 @@
+ virtual SoundName get_midisoundtrack(){return SoundNames::FIRE_SOUNDTRACK;}
+
+ virtual int new_level_check(int enemiesPlaying,WorldP,LocatorP,
+- int level,Boolean &lStrChanged,ostrstream &levelStr,Timer &timer,
++ int level,Boolean &lStrChanged,stringstream &levelStr,Timer &timer,
+ IPhysicalManagerP);
+
+ virtual void setup_world(WorldP,LocatorP,const DifficultyLevel &);
+ virtual void new_level(int level,WorldP world,LocatorP locator,
+ const DifficultyLevel &dLevel,
+- ostrstream &lStr,ostrstream &lTitleStr,
++ stringstream &lStr,stringstream &lTitleStr,
+ IPhysicalManagerP manager,int humansNum);
+
+ virtual Boolean award_bonus();
+@@ -391,13 +385,13 @@
+ virtual ScenarioType get_scenario_type() {return KILL_THE_DRAGON;}
+
+ virtual int new_level_check(int enemiesPlaying,WorldP,LocatorP,
+- int level,Boolean &lStrChanged,ostrstream &levelStr,Timer &timer,
++ int level,Boolean &lStrChanged,stringstream &levelStr,Timer &timer,
+ IPhysicalManagerP);
+
+ virtual void setup_world(WorldP,LocatorP,const DifficultyLevel &);
+ virtual void new_level(int level,WorldP world,LocatorP locator,
+ const DifficultyLevel &dLevel,
+- ostrstream &lStr,ostrstream &lTitleStr,
++ stringstream &lStr,stringstream &lTitleStr,
+ IPhysicalManagerP manager,int humansNum);
+
+ virtual SoundName get_midisoundtrack(){return SoundNames::FIRE_SOUNDTRACK;}
+@@ -419,13 +413,13 @@
+ virtual Pos human_initial_pos(WorldP,LocatorP,const Size &s);
+
+ virtual int new_level_check(int enemiesPlaying,WorldP,LocatorP,
+- int level,Boolean &lStrChanged,ostrstream &levelStr,Timer &timer,
++ int level,Boolean &lStrChanged,stringstream &levelStr,Timer &timer,
+ IPhysicalManagerP);
+
+ virtual void setup_world(WorldP,LocatorP,const DifficultyLevel &);
+ virtual void new_level(int level,WorldP world,LocatorP locator,
+ const DifficultyLevel &dLevel,
+- ostrstream &lStr,ostrstream &lTitleStr,
++ stringstream &lStr,stringstream &lTitleStr,
+ IPhysicalManagerP manager,int humansNum);
+
+ virtual void refill_enemies(Boolean enemiesRefill,WorldP,LocatorP,IPhysicalManagerP);
+@@ -447,13 +441,13 @@
+ virtual ScenarioType get_scenario_type() {return THE_POUND;}
+
+ virtual int new_level_check(int enemiesPlaying,WorldP,LocatorP,
+- int level,Boolean &lStrChanged,ostrstream &levelStr,Timer &timer,
++ int level,Boolean &lStrChanged,stringstream &levelStr,Timer &timer,
+ IPhysicalManagerP);
+
+ virtual void setup_world(WorldP,LocatorP,const DifficultyLevel &);
+ virtual void new_level(int level,WorldP world,LocatorP locator,
+ const DifficultyLevel &dLevel,
+- ostrstream &lStr,ostrstream &lTitleStr,
++ stringstream &lStr,stringstream &lTitleStr,
+ IPhysicalManagerP manager,int humansNum);
+ };
+
+@@ -466,13 +460,13 @@
+ virtual ScenarioType get_scenario_type() {return JAPAN_TOWN;}
+
+ virtual int new_level_check(int enemiesPlaying,WorldP,LocatorP,
+- int level,Boolean &lStrChanged,ostrstream &levelStr,Timer &timer,
++ int level,Boolean &lStrChanged,stringstream &levelStr,Timer &timer,
+ IPhysicalManagerP);
+
+ virtual void setup_world(WorldP,LocatorP,const DifficultyLevel &);
+ virtual void new_level(int level,WorldP world,LocatorP locator,
+ const DifficultyLevel &dLevel,
+- ostrstream &lStr,ostrstream &lTitleStr,
++ stringstream &lStr,stringstream &lTitleStr,
+ IPhysicalManagerP manager,int humansNum);
+
+ virtual void filter_weapons_and_other_items(LocatorP,int &weaponsNum,
+@@ -581,7 +575,7 @@
+
+
+ int GameStyle::new_level_check(int,WorldP,LocatorP,
+- int,Boolean &,ostrstream &,Timer &timer,
++ int,Boolean &,stringstream &,Timer &timer,
+ IPhysicalManagerP) {
+ // A timer-based level.
+ if (timer.ready()) {
+@@ -791,8 +785,8 @@
+
+
+
+-void Normal::describe(ostrstream &str) {
+- str << "Complete each level/scenario to proceed to the next one." << ends;
++void Normal::describe(stringstream &str) {
++ str << "Complete each level/scenario to proceed to the next one.";
+ }
+
+
+@@ -852,7 +846,7 @@
+
+
+ int Normal::new_level_check(int enemiesPlaying,WorldP w,LocatorP l,
+- int level,Boolean &lStrChanged,ostrstream &levelStr,Timer &timer,
++ int level,Boolean &lStrChanged,stringstream &levelStr,Timer &timer,
+ IPhysicalManagerP manager) {
+ GameStyleP delegate = get_delegate();
+ return delegate->new_level_check(enemiesPlaying,w,l,level,lStrChanged,levelStr,timer,manager);
+@@ -876,7 +870,7 @@
+
+ void Normal::new_level(int level,WorldP world,LocatorP locator,
+ const DifficultyLevel &dLevel,
+- ostrstream &lStr,ostrstream &lTitleStr,
++ stringstream &lStr,stringstream &lTitleStr,
+ IPhysicalManagerP manager,int humansNum) {
+ // Choose which delegate to use.
+ if (level % NORMAL_SCENARIOS_FREQUENCY == 0) {
+@@ -934,11 +928,10 @@
+
+
+
+-void Levels::describe(ostrstream &str) {
++void Levels::describe(stringstream &str) {
+ str << "Human player(s) fights through increasing levels of "
+ << "difficulty." << "\n"
+- << "To complete a level you must kill all enemy players."
+- << ends;
++ << "To complete a level you must kill all enemy players.";
+ }
+
+
+@@ -969,7 +962,7 @@
+
+
+ int Levels::new_level_check(int enemiesPlaying,WorldP,LocatorP,
+- int,Boolean &,ostrstream &,Timer &,
++ int,Boolean &,stringstream &,Timer &,
+ IPhysicalManagerP) {
+ if (enemiesPlaying == 0) {
+ return 1;
+@@ -983,7 +976,7 @@
+
+ void Levels::new_level(int level,WorldP world,LocatorP locator,
+ const DifficultyLevel &dLevel,
+- ostrstream &lStr,ostrstream &lTitleStr,
++ stringstream &lStr,stringstream &lTitleStr,
+ IPhysicalManagerP manager,int) {
+ world->reset();
+
+@@ -991,8 +984,8 @@
+ clean_physicals(False,world,locator,manager);
+
+
+- lTitleStr << "[" << level << "] Kill All Machines" << ends;
+- lStr << "Level: " << level << ends;
++ lTitleStr << "[" << level << "] Kill All Machines";
++ lStr << "Level: " << level;
+
+ enemiesNum += dLevel.enemiesIncr;
+ enemiesNum = Utils::minimum(enemiesNum,dLevel.enemiesMax);
+@@ -1037,8 +1030,8 @@
+
+
+
+-void KillKillKill::describe(ostrstream &str) {
+- str << "Every human and machine for him/her/itself." << ends;
++void KillKillKill::describe(stringstream &str) {
++ str << "Every human and machine for him/her/itself.";
+ }
+
+
+@@ -1095,15 +1088,15 @@
+
+ void KillKillKill::new_level(int level,WorldP world,LocatorP locator,
+ const DifficultyLevel &,
+- ostrstream &lStr,ostrstream &lTitleStr,
++ stringstream &lStr,stringstream &lTitleStr,
+ IPhysicalManagerP manager,int) {
+ world->reset();
+
+ // Don't wipe out the Enemies.
+ clean_physicals(True,world,locator,manager);
+
+- lTitleStr << "Level: " << level << ends;
+- lStr << "Level: " << level << ends;
++ lTitleStr << "Level: " << level;
++ lStr << "Level: " << level;
+
+ // Only create enemies first time or if enemiesRefill is set.
+ if (justReset) {
+@@ -1152,9 +1145,9 @@
+
+
+
+-void Duel::describe(ostrstream &str) {
++void Duel::describe(stringstream &str) {
+ str << "Human vs. human battle to the death."
+- << "\n" << "Each human has 3 lives." << ends;
++ << "\n" << "Each human has 3 lives.";
+ }
+
+
+@@ -1207,13 +1200,13 @@
+
+ void Duel::new_level(int level,WorldP world,LocatorP locator,
+ const DifficultyLevel &,
+- ostrstream &lStr,ostrstream &lTitleStr,
++ stringstream &lStr,stringstream &lTitleStr,
+ IPhysicalManagerP manager,int) {
+ world->reset();
+ clean_physicals(False,world,locator,manager);
+
+- lTitleStr << "Level: " << level << ends;
+- lStr << "Level: " << level << ends;
++ lTitleStr << "Level: " << level;
++ lStr << "Level: " << level;
+
+ // Only create enemies first time.
+ if (justReset) {
+@@ -1256,9 +1249,9 @@
+
+
+
+-void ExtendedDuel::describe(ostrstream &str) {
++void ExtendedDuel::describe(stringstream &str) {
+ str << "Human vs. human battle to the death."
+- << "\n" << "Unlimited lives." << ends;
++ << "\n" << "Unlimited lives.";
+ }
+
+
+@@ -1318,13 +1311,13 @@
+
+ void ExtendedDuel::new_level(int level,WorldP world,LocatorP locator,
+ const DifficultyLevel &,
+- ostrstream &lStr,ostrstream &lTitleStr,
++ stringstream &lStr,stringstream &lTitleStr,
+ IPhysicalManagerP manager,int) {
+ world->reset();
+ clean_physicals(False,world,locator,manager);
+
+- lTitleStr << "Level: " << level << ends;
+- lStr << "Level: " << level << ends;
++ lTitleStr << "Level: " << level;
++ lStr << "Level: " << level;
+
+ // Only create enemies first time.
+ if (justReset) {
+@@ -1367,8 +1360,8 @@
+
+
+
+-void Training::describe(ostrstream &str) {
+- str << "No enemies. Useful for learning the controls." << ends;
++void Training::describe(stringstream &str) {
++ str << "No enemies. Useful for learning the controls.";
+ }
+
+
+@@ -1392,13 +1385,13 @@
+
+ void Training::new_level(int level,WorldP world,LocatorP locator,
+ const DifficultyLevel &,
+- ostrstream &lStr,ostrstream &lTitleStr,
++ stringstream &lStr,stringstream &lTitleStr,
+ IPhysicalManagerP manager,int) {
+ world->reset();
+ clean_physicals(False,world,locator,manager);
+
+- lTitleStr << "Level: " << level << ends;
+- lStr << "Level: " << level << ends;
++ lTitleStr << "Level: " << level;
++ lStr << "Level: " << level;
+ }
+
+
+@@ -1428,10 +1421,10 @@
+
+
+
+-void Scenarios::describe(ostrstream &str) {
++void Scenarios::describe(stringstream &str) {
+ str << "A number of different scenarios." << "\n"
+ << "You must complete each scenario to continue on to the "
+- << "next one." << ends;
++ << "next one.";
+ }
+
+
+@@ -1499,7 +1492,7 @@
+
+ int Scenarios::new_level_check(int enemiesPlaying,WorldP w,LocatorP l,
+ int level,Boolean &lStrChanged,
+- ostrstream &levelStr,Timer &timer,
++ stringstream &levelStr,Timer &timer,
+ IPhysicalManagerP manager) {
+ assert(scenario);
+ return scenario->new_level_check(enemiesPlaying,w,l,level,
+@@ -1534,7 +1527,7 @@
+
+ void Scenarios::new_level(int level,WorldP world,LocatorP locator,
+ const DifficultyLevel &dLevel,
+- ostrstream &lStr,ostrstream &lTitleStr,
++ stringstream &lStr,stringstream &lTitleStr,
+ IPhysicalManagerP manager,int humansNum) {
+ // Works even if scenario is NULL.
+ if (!scenario || scenario->advance_level()) {
+@@ -1804,7 +1797,7 @@
+
+
+ int Exterminate::new_level_check(int enemiesPlaying,WorldP,LocatorP,
+- int,Boolean &,ostrstream &,Timer &,
++ int,Boolean &,stringstream &,Timer &,
+ IPhysicalManagerP) {
+ if (enemiesPlaying == 0) {
+ return 1;
+@@ -1822,10 +1815,10 @@
+
+ void Exterminate::new_level(int level,WorldP,LocatorP,
+ const DifficultyLevel &dLevel,
+- ostrstream &lStr,ostrstream &lTitleStr,
++ stringstream &lStr,stringstream &lTitleStr,
+ IPhysicalManagerP manager,int) {
+- lTitleStr << "[" << level << "] EXTERMINATE" << ends;
+- lStr << "[" << level << "] EXTERMINATE\nKill all machines." << ends;
++ lTitleStr << "[" << level << "] EXTERMINATE";
++ lStr << "[" << level << "] EXTERMINATE\nKill all machines.";
+
+ // Doesn't increment like LEVELS game style
+ enemiesNum = dLevel.enemiesIncr;
+@@ -1852,7 +1845,7 @@
+
+ int Bonus::new_level_check(int,WorldP,LocatorP locator,
+ int level,Boolean &lStrChanged,
+- ostrstream &levelStr,Timer &timer,
++ stringstream &levelStr,Timer &timer,
+ IPhysicalManagerP) {
+ // Ran out of time.
+ if (timer.ready()) {
+@@ -1873,13 +1866,13 @@
+ if (remaining != frogsRemaining) {
+ frogsRemaining = remaining;
+ levelStr << "[" << level << "] BONUS LEVEL\nfrogs remaining: "
+- << remaining << ends;
++ << remaining;
+ lStrChanged = True;
+ if (remaining > 0) {
+- ostrstream arenaStr;
++ stringstream arenaStr;
+ arenaStr << remaining << " Frog" <<
+- (remaining > 1 ? "s" : "") << " Remaining" << ends;
+- locator->arena_message_enq(arenaStr.str());
++ (remaining > 1 ? "s" : "") << " Remaining";
++ locator->arena_message_enq(Utils::strdup(arenaStr.str().c_str()));
+ }
+
+ // Will only be called once per level.
+@@ -1907,7 +1900,7 @@
+
+ void Bonus::new_level(int level,WorldP world,LocatorP locator,
+ const DifficultyLevel &,
+- ostrstream &lStr,ostrstream &lTitleStr,
++ stringstream &lStr,stringstream &lTitleStr,
+ IPhysicalManagerP manager,int) {
+ // Create frogs
+ for (int n = 0; n < SCENARIO_BONUS_FROGS; n++) {
+@@ -1940,9 +1933,9 @@
+ frogsRemaining = SCENARIO_BONUS_FROGS;
+
+ lTitleStr << "[" << level << "] Bonus Level: Kill "
+- << (int)SCENARIO_BONUS_FROGS << " Frogs" << ends;
++ << (int)SCENARIO_BONUS_FROGS << " Frogs";
+ lStr << "[" << level << "] BONUS LEVEL\nfrogs remaining: "
+- << (int)SCENARIO_BONUS_FROGS << ends;
++ << (int)SCENARIO_BONUS_FROGS;
+ }
+
+
+@@ -1960,7 +1953,7 @@
+
+
+ int Hive::new_level_check(int,WorldP,LocatorP locator,
+- int,Boolean &,ostrstream &,Timer &,
++ int,Boolean &,stringstream &,Timer &,
+ IPhysicalManagerP) {
+ PhysicalP xit = locator->lookup(xitId);
+ assert(xit); // The Xit should never be destroyed.
+@@ -1987,7 +1980,7 @@
+
+ void Hive::new_level(int level,WorldP world,LocatorP locator,
+ const DifficultyLevel &,
+- ostrstream &lStr,ostrstream &lTitleStr,
++ stringstream &lStr,stringstream &lTitleStr,
+ IPhysicalManagerP manager,int) {
+ // Aliens are created in Game::clock.
+
+@@ -2012,8 +2005,8 @@
+ locator->add(egg);
+ }
+
+- lTitleStr << "[" << level << "] HIVE" << ends;
+- lStr << "[" << level << "] HIVE.\nFind the exit." << ends;
++ lTitleStr << "[" << level << "] HIVE";
++ lStr << "[" << level << "] HIVE.\nFind the exit.";
+ }
+
+
+@@ -2073,7 +2066,7 @@
+
+
+ int CaptureTheFlag::new_level_check(int,WorldP,LocatorP locator,
+- int level,Boolean &lStrChanged,ostrstream &levelStr,Timer &,
++ int level,Boolean &lStrChanged,stringstream &levelStr,Timer &,
+ IPhysicalManagerP manager) {
+ int fRemaining = 0;
+ for (int n = 0; n < SCENARIO_FLAG_FLAGS; n++) {
+@@ -2091,19 +2084,19 @@
+ flagsRemaining = fRemaining;
+ levelStr << "[" << level << "] COLLECT "
+ << (int)SCENARIO_FLAG_FLAGS
+- << " FLAGS\nremaining: "<< flagsRemaining << ends;
++ << " FLAGS\nremaining: "<< flagsRemaining;
+ lStrChanged = True;
+
+- ostrstream arenaStr;
++ stringstream arenaStr;
+ if (fRemaining != 0) {
+ arenaStr << flagsRemaining << " Flag" <<
+- (flagsRemaining > 1 ? "s" : "") << " Remaining" << ends;
++ (flagsRemaining > 1 ? "s" : "") << " Remaining";
+ }
+ else {
+- arenaStr << "All Flags Collected" << ends;
++ arenaStr << "All Flags Collected";
+ }
+
+- locator->arena_message_enq(arenaStr.str());
++ locator->arena_message_enq(Utils::strdup(arenaStr.str().c_str()));
+ }
+
+ if (fRemaining == 0) { // All flags are gone, so end level.
+@@ -2124,7 +2117,7 @@
+
+ void CaptureTheFlag::new_level(int level,WorldP world,LocatorP locator,
+ const DifficultyLevel &,
+- ostrstream &lStr,ostrstream &lTitleStr,
++ stringstream &lStr,stringstream &lTitleStr,
+ IPhysicalManagerP,int) {
+ for (int n = 0; n < SCENARIO_FLAG_FLAGS; n++) {
+ Pos pos = world->empty_accessible_rect(Flag::get_size_max());
+@@ -2136,9 +2129,9 @@
+ flagsRemaining = SCENARIO_FLAG_FLAGS;
+
+ lTitleStr << "[" << level << "] Capture The Flag: "
+- << (int)SCENARIO_FLAG_FLAGS << " Flags" << ends;
++ << (int)SCENARIO_FLAG_FLAGS << " Flags";
+ lStr << "[" << level << "] COLLECT " << (int)SCENARIO_FLAG_FLAGS
+- << " FLAGS.\nremaining: " << (int)SCENARIO_FLAG_FLAGS << ends;
++ << " FLAGS.\nremaining: " << (int)SCENARIO_FLAG_FLAGS;
+ }
+
+
+@@ -2169,7 +2162,7 @@
+
+ void GenericSeals::new_level(int level,WorldP world,LocatorP locator,
+ const DifficultyLevel &,
+- ostrstream &lStr,ostrstream &lTitleStr,
++ stringstream &lStr,stringstream &lTitleStr,
+ IPhysicalManagerP,int) {
+ // Add a team for each human in the game.
+ // Don't use locator->humans_registered() because they may not have been
+@@ -2298,7 +2291,7 @@
+
+
+ int Seals::new_level_check(int,WorldP,LocatorP locator,
+- int level,Boolean &lStrChanged,ostrstream &levelStr,Timer &,
++ int level,Boolean &lStrChanged,stringstream &levelStr,Timer &,
+ IPhysicalManagerP) {
+ int lemOut,lemSafe,lemActive,lemDead;
+ compute_out_safe_active_dead(locator,lemOut,lemSafe,lemActive,lemDead);
+@@ -2312,10 +2305,10 @@
+
+ // Only update arena string if sealsSafe has changed.
+ if (lemSafe != sealsSafe && lemSafe != SCENARIO_SEALS_NEED) {
+- ostrstream arenaStr;
++ stringstream arenaStr;
+ arenaStr << "Save " << (SCENARIO_SEALS_NEED - lemSafe)
+- << " More Baby Seals" << ends;
+- locator->arena_message_enq(arenaStr.str());
++ << " More Baby Seals";
++ locator->arena_message_enq(Utils::strdup(arenaStr.str().c_str()));
+ }
+
+ sealsSafe = lemSafe;
+@@ -2324,18 +2317,17 @@
+ levelStr << "[" << level << "] SAVE "
+ << (int)SCENARIO_SEALS_NEED << " BABY SEALS\n"
+ << "out: " << sealsOut << " safe: " << sealsSafe
+- << " dead: " << lemDead
+- << ends;
++ << " dead: " << lemDead;
+ lStrChanged = True;
+
+ // New level if enough seals are safe or too many are dead.
+ if (lemDead > (SCENARIO_SEALS_SEALS - SCENARIO_SEALS_NEED)
+ || lemSafe >= SCENARIO_SEALS_NEED) {
+ if (lemSafe < SCENARIO_SEALS_NEED) {
+- ostrstream msg;
++ stringstream msg;
+ msg << "YOU FAILED TO SAVE " << (int)SCENARIO_SEALS_NEED
+- << " BABY SEALS. TRY THIS LEVEL AGAIN." << ends;
+- locator->arena_message_enq(msg.str());
++ << " BABY SEALS. TRY THIS LEVEL AGAIN.";
++ locator->arena_message_enq(Utils::strdup(msg.str().c_str()));
+ }
+ else {
+ locator->arena_message_enq(Utils::strdup("Good work. Go to the next level."));
+@@ -2365,11 +2357,10 @@
+
+
+
+-void Seals::set_level_strings(int level,ostrstream &lStr,ostrstream &lTitleStr) {
+- lTitleStr << "[" << level << "] SAVE THE BABY SEALS" << ends;
++void Seals::set_level_strings(int level,stringstream &lStr,stringstream &lTitleStr) {
++ lTitleStr << "[" << level << "] SAVE THE BABY SEALS";
+ lStr << "[" << level << "] SAVE "<<
+- (int)SCENARIO_SEALS_NEED << " BABY SEALS\n"
+- << "out: 0 safe: 0 dead: 0" << ends;
++ (int)SCENARIO_SEALS_NEED << " BABY SEALS\n" << "out: 0 safe: 0 dead: 0";
+ }
+
+
+@@ -2430,7 +2421,7 @@
+
+
+ int AntiSeals::new_level_check(int,WorldP,LocatorP locator,
+- int level,Boolean &lStrChanged,ostrstream &levelStr,Timer &,
++ int level,Boolean &lStrChanged,stringstream &levelStr,Timer &,
+ IPhysicalManagerP) {
+ // level not over by default.
+ int ret = -1;
+@@ -2441,15 +2432,13 @@
+
+ // Failure
+ if (lemSafe > SCENARIO_ANTI_SEALS_MAX_SLIPPAGE) {
+- ostrstream msg;
+ #if 0
+ // Not enough space on screen, need two lines.
+ msg << "YOU LET TOO MANY OF THE FAT BASTARDS GET AWAY\n"
+ << "Try this level again" << ends;
+ #else
+- msg << "YOU LET TOO MANY OF THE FAT BASTARDS GET AWAY" << ends;
#endif
+- locator->arena_message_enq(msg.str());
++ locator->arena_message_enq(Utils::strdup("YOU LET TOO MANY OF THE FAT BASTARDS GET AWAY"));
+
+ // start new level
+ ret = 1;
+@@ -2473,13 +2462,11 @@
+ }
+ // Update UI
+ else if (lemSafe == sealsSafe) { // o.w. the "one got away" message takes priority
+- ostrstream arenaStr;
+- arenaStr << "Kill "
+- << lemToKill << " More Baby Seals" << ends;
+- locator->arena_message_enq(arenaStr.str());
++ stringstream arenaStr;
++ arenaStr << "Kill " << lemToKill << " More Baby Seals";
++ locator->arena_message_enq(Utils::strdup(arenaStr.str().c_str()));
+
+- levelStr << "[" << level << "] KILL "
+- << lemToKill << " BABY SEALS" << ends;
++ levelStr << "[" << level << "] KILL " << lemToKill << " BABY SEALS";
+ lStrChanged = True;
+ }
+ } // lemDead != sealsDead
+@@ -2502,10 +2489,10 @@
+
+
+
+-void AntiSeals::set_level_strings(int level,ostrstream &lStr,ostrstream &lTitleStr) {
+- lTitleStr << "[" << level << "] KILL THE BABY SEALS" << ends;
++void AntiSeals::set_level_strings(int level,stringstream &lStr,stringstream &lTitleStr) {
++ lTitleStr << "[" << level << "] KILL THE BABY SEALS";
+ lStr << "[" << level << "] KILL "<<
+- (int)SCENARIO_SEALS_SEALS << " BABY SEALS" << ends;
++ (int)SCENARIO_SEALS_SEALS << " BABY SEALS";
+ }
+
+
+@@ -2552,7 +2539,7 @@
+
+
+ int KillTheFireDemon::new_level_check(int enemiesPlaying,WorldP,LocatorP locator,
+- int,Boolean &,ostrstream &,Timer &,
++ int,Boolean &,stringstream &,Timer &,
+ IPhysicalManagerP) {
+ if (enemiesPlaying == 0) {
+ locator->arena_message_enq(Utils::strdup("Take That, You Mother-Fucking Spawn From Hell"));
+@@ -2572,12 +2559,12 @@
+
+ void KillTheFireDemon::new_level(int level,WorldP,LocatorP,
+ const DifficultyLevel &,
+- ostrstream &lStr,ostrstream &lTitleStr,
++ stringstream &lStr,stringstream &lTitleStr,
+ IPhysicalManagerP manager,int) {
+ manager->create_enemy(manager->enemy_physical(A_FireDemon));
+
+- lTitleStr << "[" << level << "] FIRE DEMON" << ends;
+- lStr << "[" << level << "] Kill the Fire Demon." << ends;
++ lTitleStr << "[" << level << "] FIRE DEMON";
++ lStr << "[" << level << "] Kill the Fire Demon.";
+ }
+
+
+@@ -2594,7 +2581,7 @@
+
+
+ int KillTheDragon::new_level_check(int enemiesPlaying,WorldP,LocatorP locator,
+- int,Boolean &,ostrstream &,Timer &,
++ int,Boolean &,stringstream &,Timer &,
+ IPhysicalManagerP) {
+ if (enemiesPlaying == 0) {
+ locator->arena_message_enq(Utils::strdup("The Infernal Worm has been vanquished"));
+@@ -2614,7 +2601,7 @@
+
+ void KillTheDragon::new_level(int level,WorldP w,LocatorP l,
+ const DifficultyLevel &,
+- ostrstream &lStr,ostrstream &lTitleStr,
++ stringstream &lStr,stringstream &lTitleStr,
+ IPhysicalManagerP manager,int) {
+ const PhysicalContext *cx = &Dragon::creatureContext.movingContext.physicalContext;
+ Pos pos = w->empty_rect(cx->sizeMax);
+@@ -2628,8 +2615,8 @@
+ manager->create_enemy(p,False);
+ }
+
+- lTitleStr << "[" << level << "] Dragon" << ends;
+- lStr << "[" << level << "] Kill the Dragon." << ends;
++ lTitleStr << "[" << level << "] Dragon";
++ lStr << "[" << level << "] Kill the Dragon.";
+ }
- #if WIN32
-@@ -2680,7 +2681,7 @@
+
+@@ -2667,7 +2654,7 @@
+
+
+ int ZigZag::new_level_check(int,WorldP world,LocatorP locator,
+- int,Boolean &,ostrstream &,Timer &,
++ int,Boolean &,stringstream &,Timer &,
+ IPhysicalManagerP) {
+ PhysicalP xit = locator->lookup(xitId);
+ assert(xit); // The Xit should never be destroyed.
+@@ -2680,7 +2667,7 @@
HumanP human = locator->get_human(n);
if (human) {
// previous depth
- int depthOld = (int)human->get_data();
-+ intptr_t depthOld = (intptr_t)human->get_data();
++ long depthOld = (long)human->get_data();
Id id = human->get_id();
// Get physical for intelligence
+@@ -2697,9 +2684,9 @@
+ human->set_data((void *)depth);
+
+ // Use 1-based counting for the User.
+- ostrstream str;
+- str << "Depth " << (depth + 1) << ends;
+- locator->arena_message_enq(str.str(),p);
++ stringstream str;
++ str << "Depth " << (depth + 1);
++ locator->arena_message_enq(Utils::strdup(str.str().c_str()),p);
+ }
+ }
+ }
+@@ -2718,7 +2705,7 @@
+
+ void ZigZag::new_level(int level,WorldP world,LocatorP locator,
+ const DifficultyLevel &,
+- ostrstream &lStr,ostrstream &lTitleStr,
++ stringstream &lStr,stringstream &lTitleStr,
+ IPhysicalManagerP,int) {
+ Rooms worldRooms = world->get_rooms();
+ RoomIndex upperRight(0,worldRooms.acrossMax - 1);
+@@ -2731,9 +2718,8 @@
+ xitId = p->get_id();
+
+ // 1-based counting of depth for the user.
+- lTitleStr << "[" << level << "] ZIG-ZAG: Depth "
+- << worldRooms.downMax << ends;
+- lStr << "[" << level << "] ZIG-ZAG.\nFind the exit." << ends;
++ lTitleStr << "[" << level << "] ZIG-ZAG: Depth " << worldRooms.downMax;
++ lStr << "[" << level << "] ZIG-ZAG.\nFind the exit.";
+ }
+
+
+@@ -2761,7 +2747,7 @@
+
+
+ int ThePound::new_level_check(int enemiesPlaying,WorldP,LocatorP locator,
+- int,Boolean &,ostrstream &,Timer &,
++ int,Boolean &,stringstream &,Timer &,
+ IPhysicalManagerP) {
+ if (enemiesPlaying == 0) {
+ locator->arena_message_enq(Utils::strdup("Killed the Mutts"));
+@@ -2781,7 +2767,7 @@
+
+ void ThePound::new_level(int level,WorldP,LocatorP locator,
+ const DifficultyLevel &,
+- ostrstream &lStr,ostrstream &lTitleStr,
++ stringstream &lStr,stringstream &lTitleStr,
+ IPhysicalManagerP manager,int) {
+ locator->add_team(Scenarios::dog_team,NULL);
+
+@@ -2789,8 +2775,8 @@
+ manager->create_enemy(manager->enemy_physical(A_Dog));
+ }
+
+- lTitleStr << "[" << level << "] The Pound" << ends;
+- lStr << "[" << level << "] The Pound" << ends;
++ lTitleStr << "[" << level << "] The Pound";
++ lStr << "[" << level << "] The Pound";
+ }
+
+
+@@ -2801,7 +2787,7 @@
+
+
+ int JapanTown::new_level_check(int enemiesPlaying,WorldP,LocatorP locator,
+- int,Boolean &,ostrstream &,Timer &,
++ int,Boolean &,stringstream &,Timer &,
+ IPhysicalManagerP) {
+ if (enemiesPlaying == 0) {
+ locator->arena_message_enq(Utils::strdup("Damn Ninjas. Worse than roaches."));
+@@ -2821,7 +2807,7 @@
+
+ void JapanTown::new_level(int level,WorldP,LocatorP locator,
+ const DifficultyLevel &,
+- ostrstream &lStr,ostrstream &lTitleStr,
++ stringstream &lStr,stringstream &lTitleStr,
+ IPhysicalManagerP manager,int) {
+ locator->add_team(JapanTown::ninja_team,NULL);
+
+@@ -2829,8 +2815,8 @@
+ manager->create_enemy(manager->enemy_physical(A_Ninja));
+ }
+
+- lTitleStr << "[" << level << "] Japan-Town" << ends;
+- lStr << "[" << level << "] Japan-Town" << ends;
++ lTitleStr << "[" << level << "] Japan-Town";
++ lStr << "[" << level << "] Japan-Town";
+ }
+
+
diff --git a/games/xevil/files/patch-cmn::game_style.h b/games/xevil/files/patch-cmn::game_style.h
index eb7968439d64..665984e9708d 100644
--- a/games/xevil/files/patch-cmn::game_style.h
+++ b/games/xevil/files/patch-cmn::game_style.h
@@ -1,12 +1,201 @@
---- cmn/game_style.h.dist Sat Mar 22 20:22:30 2003
-+++ cmn/game_style.h Sat Oct 25 21:41:50 2003
-@@ -31,7 +31,8 @@
+--- cmn/game_style.h.orig 2012-05-27 06:52:31.000000000 +0900
++++ cmn/game_style.h 2012-05-27 06:53:11.000000000 +0900
+@@ -30,12 +30,7 @@
+ #endif
#endif
- #if X11
+-#if X11
-#include <strstream.h>
-+#include <strstream>
+-#endif
+-#if WIN32
+-#include <strstrea.h>
+-#endif
++#include <sstream>
+
+ #include "utils.h"
+ #include "coord.h"
+@@ -44,6 +39,8 @@
+ #include "intel.h"
+
+
+using namespace std;
- #endif
- #if WIN32
- #include <strstrea.h>
++
+ #define SCENARIO_SEALS_TRAPDOORS 2
+ #define SCENARIO_BONUS_FROGS 12
+ #define SCENARIO_FLAG_FLAGS 15
+@@ -91,7 +88,7 @@
+
+ virtual GameStyle *clone() = 0;
+
+- virtual void describe(ostrstream &) = 0;
++ virtual void describe(stringstream &) = 0;
+ /* EFFECTS: Write a two-line description of the style to the stream. */
+
+ virtual GameStyleType get_type() = 0;
+@@ -137,7 +134,7 @@
+
+ virtual int new_level_check(int enemiesPlaying,WorldP,LocatorP,
+ int level,
+- Boolean &lStrChanged,ostrstream &levelStr,
++ Boolean &lStrChanged,stringstream &levelStr,
+ Timer &timer,
+ IPhysicalManagerP);
+ /* MODIFIES: lStrChanged */
+@@ -166,7 +163,7 @@
+
+ virtual void new_level(int level,WorldP,LocatorP,
+ const DifficultyLevel &dLevel,
+- ostrstream &levelStr,ostrstream &levelTitleStr,
++ stringstream &levelStr,stringstream &levelTitleStr,
+ IPhysicalManagerP,int humansNum) = 0;
+ /* MODIFIES: level */
+ /* EFFECTS: Start a new level. Use levelStr levelTitleStr to
+@@ -249,7 +246,7 @@
+
+ virtual GameStyleP clone();
+
+- virtual void describe(ostrstream &);
++ virtual void describe(stringstream &);
+
+ virtual GameStyleType get_type();
+
+@@ -269,7 +266,7 @@
+
+ virtual int new_level_check(int enemiesPlaying,WorldP,LocatorP,
+ int level,Boolean &lStrChanged,
+- ostrstream &levelStr,Timer &timer,
++ stringstream &levelStr,Timer &timer,
+ IPhysicalManagerP);
+
+ virtual Boolean advance_level();
+@@ -277,7 +274,7 @@
+ virtual Boolean award_bonus();
+
+ virtual void new_level(int level,WorldP,LocatorP,const DifficultyLevel &dLevel,
+- ostrstream &levelStr,ostrstream &levelTitleStr,
++ stringstream &levelStr,stringstream &levelTitleStr,
+ IPhysicalManagerP,int humansNum);
+
+ virtual void new_level_set_timer(Timer &timer);
+@@ -305,7 +302,7 @@
+
+ virtual GameStyleP clone();
+
+- virtual void describe(ostrstream &);
++ virtual void describe(stringstream &);
+
+ virtual GameStyleType get_type();
+
+@@ -314,11 +311,11 @@
+ virtual void reset(WorldP,LocatorP,const DifficultyLevel &,int enemiesNumNext);
+
+ virtual int new_level_check(int enemiesPlaying,WorldP,LocatorP,
+- int level,Boolean &lStrChanged,ostrstream &levelStr,Timer &timer,
++ int level,Boolean &lStrChanged,stringstream &levelStr,Timer &timer,
+ IPhysicalManagerP);
+
+ virtual void new_level(int level,WorldP,LocatorP,const DifficultyLevel &dLevel,
+- ostrstream &levelStr,ostrstream &levelTitleStr,
++ stringstream &levelStr,stringstream &levelTitleStr,
+ IPhysicalManagerP,int humansNum);
+
+ virtual void new_level_set_timer(Timer &timer);
+@@ -340,7 +337,7 @@
+
+ virtual GameStyleP clone();
+
+- virtual void describe(ostrstream &);
++ virtual void describe(stringstream &);
+
+ virtual GameStyleType get_type();
+
+@@ -355,7 +352,7 @@
+ virtual Boolean game_over_check(int humansPlaying,int enemiesPlaying);
+
+ virtual void new_level(int level,WorldP,LocatorP,const DifficultyLevel &dLevel,
+- ostrstream &levelStr,ostrstream &levelTitleStr,
++ stringstream &levelStr,stringstream &levelTitleStr,
+ IPhysicalManagerP,int humansNum);
+
+ virtual void refill_enemies(Boolean enemiesRefill,WorldP,LocatorP,IPhysicalManagerP);
+@@ -376,7 +373,7 @@
+
+ virtual GameStyleP clone();
+
+- virtual void describe(ostrstream &);
++ virtual void describe(stringstream &);
+
+ virtual GameStyleType get_type();
+
+@@ -389,7 +386,7 @@
+ virtual Boolean game_over_check(int humansPlaying,int enemiesPlaying);
+
+ virtual void new_level(int level,WorldP,LocatorP,const DifficultyLevel &dLevel,
+- ostrstream &levelStr,ostrstream &levelTitleStr,
++ stringstream &levelStr,stringstream &levelTitleStr,
+ IPhysicalManagerP,int humansNum);
+
+ virtual void refill_enemies(Boolean enemiesRefill,WorldP,LocatorP,IPhysicalManagerP);
+@@ -408,7 +405,7 @@
+
+ virtual GameStyleP clone();
+
+- virtual void describe(ostrstream &);
++ virtual void describe(stringstream &);
+
+ virtual GameStyleType get_type();
+
+@@ -423,7 +420,7 @@
+ virtual Boolean game_over_check(int humansPlaying,int enemiesPlaying);
+
+ virtual void new_level(int level,WorldP,LocatorP,const DifficultyLevel &dLevel,
+- ostrstream &levelStr,ostrstream &levelTitleStr,
++ stringstream &levelStr,stringstream &levelTitleStr,
+ IPhysicalManagerP,int humansNum);
+
+ virtual void refill_enemies(Boolean enemiesRefill,WorldP,LocatorP,IPhysicalManagerP);
+@@ -442,7 +439,7 @@
+
+ virtual GameStyleP clone();
+
+- virtual void describe(ostrstream &);
++ virtual void describe(stringstream &);
+
+ virtual GameStyleType get_type();
+
+@@ -451,7 +448,7 @@
+ virtual void reset(WorldP,LocatorP,const DifficultyLevel &dLevel,int);
+
+ virtual void new_level(int level,WorldP,LocatorP,const DifficultyLevel &dLevel,
+- ostrstream &levelStr,ostrstream &levelTitleStr,
++ stringstream &levelStr,stringstream &levelTitleStr,
+ IPhysicalManagerP,int humansNum);
+
+ virtual void refill_enemies(Boolean enemiesRefill,WorldP,LocatorP,IPhysicalManagerP);
+@@ -466,7 +463,7 @@
+
+ virtual GameStyleP clone();
+
+- virtual void describe(ostrstream &);
++ virtual void describe(stringstream &);
+
+ virtual GameStyleType get_type();
+
+@@ -485,7 +482,7 @@
+ virtual void reset(WorldP,LocatorP,const DifficultyLevel &,int enemiesNumNext);
+
+ virtual int new_level_check(int enemiesPlaying,WorldP,LocatorP,
+- int level,Boolean &lStrChanged,ostrstream &levelStr,Timer &timer,
++ int level,Boolean &lStrChanged,stringstream &levelStr,Timer &timer,
+ IPhysicalManagerP);
+
+ virtual Boolean advance_level();
+@@ -493,7 +490,7 @@
+ virtual Boolean award_bonus();
+
+ virtual void new_level(int level,WorldP,LocatorP,const DifficultyLevel &dLevel,
+- ostrstream &levelStr,ostrstream &levelTitleStr,
++ stringstream &levelStr,stringstream &levelTitleStr,
+ IPhysicalManagerP manager,int humansNum);
+
+ virtual void new_level_set_timer(Timer &timer);
diff --git a/games/xevil/files/patch-cmn::intel.cpp b/games/xevil/files/patch-cmn::intel.cpp
index 41b4c0c6886d..8d364a7f736e 100644
--- a/games/xevil/files/patch-cmn::intel.cpp
+++ b/games/xevil/files/patch-cmn::intel.cpp
@@ -1,12 +1,109 @@
---- cmn/intel.cpp.orig Wed Mar 19 09:49:22 2003
-+++ cmn/intel.cpp Sat Oct 25 21:42:14 2003
-@@ -35,7 +35,8 @@
+--- cmn/intel.cpp.orig 2012-05-27 06:52:29.000000000 +0900
++++ cmn/intel.cpp 2012-05-27 06:53:11.000000000 +0900
+@@ -35,7 +35,7 @@
#include <string.h>
}
#if X11
-#include <strstream.h>
-+#include <strstream>
-+using namespace std;
++#include <sstream>
#endif
#if WIN32
#include <strstrea.h>
+@@ -50,6 +50,7 @@
+ #include "xdata.h"
+
+
++using namespace std;
+
+ // Defines
+ #define FIGHT_RANGE 40 // made it smaller for Dogs 45 // [50-40]
+@@ -212,7 +213,7 @@
+
+
+
+-Intel::Intel(WorldP w,LocatorP l,char *name,
++Intel::Intel(WorldP w,LocatorP l,const char *name,
+ const IntelOptions *ops,ITmask opMask) {
+ intelStatusChanged = True;
+ living = True;
+@@ -755,7 +756,7 @@
+
+
+
+-Human::Human(WorldP w,LocatorP l,char *name,int lves,
++Human::Human(WorldP w,LocatorP l,const char *name,int lves,
+ int *sharedLves,ColorNum cNum)
+ : Intel(w,l,name,NULL,ITnone) {
+ lives = lves;
+@@ -931,7 +932,7 @@
+
+
+
+-Machine::Machine(WorldP w,LocatorP l,char *name,const IntelOptions *ops,
++Machine::Machine(WorldP w,LocatorP l,const char *name,const IntelOptions *ops,
+ ITmask opMask)
+ : Intel(w,l,name,ops,opMask)
+ {
+@@ -1829,7 +1830,7 @@
+
+
+
+-Enemy::Enemy(WorldP w,LocatorP l,char *name,
++Enemy::Enemy(WorldP w,LocatorP l,const char *name,
+ const IntelOptions *ops,ITmask opMask)
+ :Machine(w,l,name,ops,opMask) {}
+
+@@ -1854,7 +1855,7 @@
+
+
+
+-Neutral::Neutral(WorldP w,LocatorP l,char *name,
++Neutral::Neutral(WorldP w,LocatorP l,const char *name,
+ const IntelOptions *ops,ITmask opMask)
+ :Machine(w,l,name,ops,opMask) {}
+
+@@ -1867,7 +1868,7 @@
+
+
+
+-SealIntel::SealIntel(WorldP w,LocatorP l,char *name,const Id &home_id)
++SealIntel::SealIntel(WorldP w,LocatorP l,const char *name,const Id &home_id)
+ :Neutral(w,l,name,NULL,ITnone)
+ {
+ // Timer oTimer(LADDER_JUMP_TIME);
+@@ -1906,7 +1907,7 @@
+
+
+
+-DoppelIntel::DoppelIntel(WorldP w,LocatorP l,char *name,
++DoppelIntel::DoppelIntel(WorldP w,LocatorP l,const char *name,
+ const IntelOptions *ops,ITmask opMask,IntelP master)
+ :Neutral(w,l,name,ops,opMask) {
+ assert(master);
+@@ -2073,7 +2074,7 @@
+
+
+
+-Pet::Pet(WorldP w,LocatorP l,char *name,
++Pet::Pet(WorldP w,LocatorP l,const char *name,
+ const IntelOptions *ops,ITmask opMask,IntelP master)
+ :DoppelIntel(w,l,name,ops,opMask,master) {
+ mode = Heel;
+@@ -2095,7 +2096,7 @@
+ char buffer[80];
+ ostrstream str(buffer,80);
+ str << "mode changing from:" << Pet::mode_string(prev) <<
+- " to: " << Pet::mode_string(curr) << endl << ends;
++ " to: " << Pet::mode_string(curr) << endl;
+ #if WIN32
+ TRACE(buffer);
+ #endif
+@@ -2308,7 +2309,7 @@
+
+
+
+-char *Pet::mode_string(int mode) {
++const char *Pet::mode_string(int mode) {
+ switch (mode) {
+ case Heel:
+ return "Heel";
diff --git a/games/xevil/files/patch-cmn::locator.h b/games/xevil/files/patch-cmn::locator.h
index 4c6a54b96e05..68d27544fc5f 100644
--- a/games/xevil/files/patch-cmn::locator.h
+++ b/games/xevil/files/patch-cmn::locator.h
@@ -1,27 +1,20 @@
---- cmn/locator.h.orig Sat Mar 22 20:35:30 2003
-+++ cmn/locator.h Fri Oct 6 13:44:36 2006
-@@ -47,7 +47,8 @@
+--- cmn/locator.h.orig 2012-05-27 06:52:31.000000000 +0900
++++ cmn/locator.h 2012-05-27 06:53:11.000000000 +0900
+@@ -47,7 +47,7 @@
// Include Files
-#include <iostream.h>
+#include <iostream>
-+using namespace std;
#include "utils.h"
#include "coord.h"
-@@ -108,12 +109,12 @@
+@@ -96,6 +96,8 @@
+ #define OL_RECENT_SOUNDS_MAX 30
-
- // Only valid if mapped || flash.
-- OLgridEntry *gridEntry;
-+ class OLgridEntry *gridEntry;
- // Set by OLgridEntry::insert. Not nec. valid.
- GLoc gloc;
- #if X11
- // Only valid if mapped || flash.
-- OLshadowEntry *shadowEntry;
-+ class OLshadowEntry *shadowEntry;
- // Set by OLshadowEntry::insert. Not nec. valid.
- GLoc shadowGloc;
- #endif
+
++class OLgridEntry;
++class OLshadowEntry;
+
+ // An entry for one object in the list of all objects currently in the game.
+ class OLentry {
diff --git a/games/xevil/files/patch-cmn::physical.cpp b/games/xevil/files/patch-cmn::physical.cpp
index 30e8f28166c7..b9d29be92103 100644
--- a/games/xevil/files/patch-cmn::physical.cpp
+++ b/games/xevil/files/patch-cmn::physical.cpp
@@ -1,25 +1,191 @@
---- cmn/physical.cpp.orig 2000-01-19 20:38:14.000000000 +0100
-+++ cmn/physical.cpp 2007-07-31 15:54:01.000000000 +0200
-@@ -33,10 +33,11 @@
+--- cmn/physical.cpp.orig 2012-05-27 06:52:30.000000000 +0900
++++ cmn/physical.cpp 2012-05-27 06:53:11.000000000 +0900
+@@ -33,10 +33,10 @@
// Include Files
#include "xdata.h"
#include "physical.h"
-#include <iostream.h>
+#include <iostream>
-+using namespace std;
#if X11
-#include <strstream.h>
-+#include <strstream>
++#include <sstream>
#endif
#if WIN32
#include <strstrea.h>
+@@ -54,6 +54,7 @@
+
+ #include "bitmaps/transform/transform.bitmaps"
+
++using namespace std;
+
+ // Defines
+ #define VEL_SMALL 1
+@@ -523,9 +524,9 @@
+
+ if (heat == 0 && heatNext > 0) {
+ LocatorP l = get_locator();
+- ostrstream str;
+- str << get_class_name() << " is on fire." << ends;
+- locator->message_enq(str.str());
++ stringstream str;
++ str << get_class_name() << " is on fire.";
++ locator->message_enq(Utils::strdup(str.str().c_str()));
+ }
+ }
+ previousHeatWasSecondary = secondary;
@@ -1844,7 +1845,7 @@
}
// Use the pixmap resource id as the base.
- u_int cmnBitsId = (unsigned int)mc->pixmapBits[baseDir][animNum];
-+ u_int cmnBitsId = (unsigned intptr_t)mc->pixmapBits[baseDir][animNum];
++ u_int cmnBitsId = (unsigned long)mc->pixmapBits[baseDir][animNum];
// It is ok to call OneTransform::compute_key() even if there is no
// transformation, will just return 0x0.
+@@ -2556,17 +2557,17 @@
+
+ void Item::die() {
+ LocatorP locator = get_locator();
+- ostrstream msg;
++ stringstream msg;
+ switch (dieMessage) {
+ case NONE:
+ break;
+ case USED:
+- msg << get_class_name() << " has been used." << ends;
+- locator->message_enq(msg.str());
++ msg << get_class_name() << " has been used.";
++ locator->message_enq(Utils::strdup(msg.str().c_str()));
+ break;
+ case DESTROYED:
+- msg << get_class_name() << " is destroyed." << ends;
+- locator->message_enq(msg.str());
++ msg << get_class_name() << " is destroyed.";
++ locator->message_enq(Utils::strdup(msg.str().c_str()));
+ break;
+ };
+
+@@ -2650,10 +2651,8 @@
+ // Prevent non-biologicals from picking up drugs.
+
+ if (p->is_creature() && !((CreatureP)p)->biological()) {
+- ostrstream msg;
+- msg << "Non-Biological Creatures Cannot Use Drugs" << ends;
+ LocatorP locator = get_locator();
+- locator->arena_message_enq(msg.str(),p);
++ locator->arena_message_enq(Utils::strdup("Non-Biological Creatures Cannot Use Drugs"), p);
+ kill_self();
+ }
+ else {
+@@ -2673,13 +2672,11 @@
+ assert(context->odChance >= 0);
+ if (context->odChance && Utils::choose(context->odChance) == 0) {
+ p->kill_self();
+- ostrstream msg;
+- msg << p->get_class_name() << " dies from crack overdose." << ends;
+- locator->message_enq(msg.str());
++ stringstream msg;
++ msg << p->get_class_name() << " dies from crack overdose.";
++ locator->message_enq(Utils::strdup(msg.str().c_str()));
+
+- ostrstream arenaMsg;
+- arenaMsg << "You Died From Drug Overdose" << ends;
+- locator->arena_message_enq(arenaMsg.str(),p);
++ locator->arena_message_enq(Utils::strdup("You Died From Drug Overdose"),p);
+
+ set_quiet_death(); // so doesn't report "has been used" message.
+ }
+@@ -2693,9 +2690,7 @@
+ }
+ else {
+ // Shouldn't get here, should kill self when picking it up.
+- ostrstream msg;
+- msg << "Non-Biological Creatures Cannot Use Drugs" << ends;
+- locator->arena_message_enq(msg.str(),p);
++ locator->arena_message_enq(Utils::strdup("Non-Biological Creatures Cannot Use Drugs"),p);
+ }
+
+ kill_self();
+@@ -4334,14 +4329,14 @@
+ if (!get_quiet_death() && !alive() &&
+ (corpseTimer.ready() || (get_health() < - cc->corpseHealth))) {
+ LocatorP locator = get_locator();
+- ostrstream msg;
++ stringstream msg;
+ if (corpseTimer.ready()) {
+- msg << get_class_name() << " corpse has decomposed." << ends;
+- locator->message_enq(msg.str());
++ msg << get_class_name() << " corpse has decomposed.";
++ locator->message_enq(Utils::strdup(msg.str().c_str()));
+ }
+ else {
+- msg << get_class_name() << " corpse has been destroyed." << ends;
+- locator->message_enq(msg.str());
++ msg << get_class_name() << " corpse has been destroyed.";
++ locator->message_enq(Utils::strdup(msg.str().c_str()));
+ }
+ set_delete_me();
+ }
+@@ -4399,9 +4394,9 @@
+ set_vel_next(velNew);
+ set_stance_next(CO_air);
+
+- ostrstream msg;
+- msg << get_class_name() << " has died." << ends;
+- locator->message_enq(msg.str());
++ stringstream msg;
++ msg << get_class_name() << " has died.";
++ locator->message_enq(Utils::strdup(msg.str().c_str()));
+
+ set_no_death_delete();
+ }
+@@ -6072,10 +6067,10 @@
+ }
+ // If User is already holding the max number of weapons.
+ else if (weaponsNum >= PH_WEAPONS_MAX) {
+- ostrstream msg;
+- msg << "Can only hold " << PH_WEAPONS_MAX << " weapons" << ends;
++ stringstream msg;
++ msg << "Can only hold " << PH_WEAPONS_MAX << " weapons";
+ LocatorP locator = cre->get_locator();
+- locator->arena_message_enq(msg.str(),cre);
++ locator->arena_message_enq(Utils::strdup(msg.str().c_str()),cre);
+ destroyOther = True;
+ }
+ // Actually pick it up.
+@@ -6124,15 +6119,14 @@
+ else {
+ LocatorP locator = cre->get_locator();
+ if (itemsNum == PH_ITEMS_MAX) {
+- ostrstream msg;
+- msg << "Can only hold " << PH_ITEMS_MAX << " items" << ends;
+- locator->arena_message_enq(msg.str(),cre);
++ stringstream msg;
++ msg << "Can only hold " << PH_ITEMS_MAX << " items";
++ locator->arena_message_enq(Utils::strdup(msg.str().c_str()),cre);
+ }
+ else if (itemClassCount >= ITEM_CLASS_MAX) {
+- ostrstream msg;
+- msg << "Can only hold " << ITEM_CLASS_MAX
+- << " of any one item" << ends;
+- locator->arena_message_enq(msg.str(),cre);
++ stringstream msg;
++ msg << "Can only hold " << ITEM_CLASS_MAX << " of any one item";
++ locator->arena_message_enq(Utils::strdup(msg.str().c_str()),cre);
+ }
+
+ other->set_quiet_death();
+@@ -6661,9 +6655,9 @@
+ ((ItemP)p)->use(cre);
+ }
+ else {
+- ostrstream str;
+- str << "Cannot use " << p->get_class_name() << ends;
+- locator->arena_message_enq(str.str(),cre);
++ stringstream str;
++ str << "Cannot use " << p->get_class_name();
++ locator->arena_message_enq(Utils::strdup(str.str().c_str()),cre);
+ }
+ }
+ break;
diff --git a/games/xevil/files/patch-cmn::role.cpp b/games/xevil/files/patch-cmn::role.cpp
index 7f5ecfc4a643..4d90e7b1329c 100644
--- a/games/xevil/files/patch-cmn::role.cpp
+++ b/games/xevil/files/patch-cmn::role.cpp
@@ -1,15 +1,477 @@
---- cmn/role.cpp.orig Wed Jan 19 12:54:34 2000
-+++ cmn/role.cpp Sat Oct 25 21:43:43 2003
-@@ -29,9 +29,10 @@
+--- cmn/role.cpp.orig 2012-05-27 06:52:30.000000000 +0900
++++ cmn/role.cpp 2012-05-27 06:53:11.000000000 +0900
+@@ -29,9 +29,9 @@
#include "stdafx.h"
-#include <iostream.h>
+#include <iostream>
-+using namespace std;
#if X11
-#include <strstream.h>
-+#include <strstream>
++#include <sstream>
#include <time.h>
#endif
#if WIN32
+@@ -266,43 +266,39 @@
+
+
+ void Role::error(const char *msg1,const char *msg2,const char *msg3) {
+- ostrstream str;
++ stringstream str;
+
+ if (msg2 == NULL) {
+- str << msg1 << ends;
++ str << msg1;
+ }
+ else if (msg3 == NULL) {
+- str << msg1 << msg2 << ends;
++ str << msg1 << msg2;
+ }
+ else {
+- str << msg1 << msg2 << msg3 << ends;
++ str << msg1 << msg2 << msg3;
+ }
+
+ // Call one argument version.
+- _error(str.str());
+-
+- delete str.str();
++ _error(str.str().c_str());
+ }
+
+
+
+ void Role::message(const char *msg1,const char *msg2,const char *msg3) {
+- ostrstream str;
++ stringstream str;
+
+ if (msg2 == NULL) {
+- str << msg1 << ends;
++ str << msg1;
+ }
+ else if (msg3 == NULL) {
+- str << msg1 << msg2 << ends;
++ str << msg1 << msg2;
+ }
+ else {
+- str << msg1 << msg2 << msg3 << ends;
++ str << msg1 << msg2 << msg3;
+ }
+
+ // Call one argument version.
+- _message(str.str());
+-
+- delete str.str();
++ _message(str.str().c_str());
+ }
+
+
+@@ -605,11 +601,11 @@
+ // Display message that we are looking up IP address.
+ // Assumes that caller will call Client::connect_server after a turn or two,
+ // so the message will be displayed on the Ui.
+- ostrstream str;
+- str << "Looking up IP address for server " << serverName << ends;
++ stringstream str;
++ str << "Looking up IP address for server " << serverName;
+ // Display for a long time.
+- errLocator->arena_message_enq(str.str(),NULL,1000000);
+- errLocator->message_enq(Utils::strdup(str.str()));
++ errLocator->arena_message_enq(Utils::strdup(str.str().c_str()),NULL,1000000);
++ errLocator->message_enq(Utils::strdup(str.str().c_str()));
+ // Probably would be better to use Role::message(), but we want it to stay
+ // up for a long time. Should add argument to Role::message().
+
+@@ -663,12 +659,10 @@
+ }
+ }
+ if (n == CLIENT_PORT_TRIES) {
+- ostrstream str;
++ stringstream str;
+ str << "Could not bind local UDP port to any of "
+- << clientPortBase << "-" << (clientPortBase + CLIENT_PORT_TRIES - 1)
+- << ends;
+- error(str.str());
+- delete str.str();
++ << clientPortBase << "-" << (clientPortBase + CLIENT_PORT_TRIES - 1);
++ error(str.str().c_str());
+ return;
+ }
+ // cout << "UDP port seems to be" << client.sin_port << endl;
+@@ -703,22 +697,19 @@
+
+ // Inform user of failed connection
+ if (!ok()) {
+- strstream msg;
++ stringstream msg;
+ msg << "Could not connect to " << serverName << " on port " <<
+- port << "." << ends;
+- error(msg.str());
+- delete(msg.str());
++ port << ".";
++ error(msg.str().c_str());
+ delete tcpOut;
+ return;
+ }
+
+ // Inform user of successful connection
+- strstream msg;
++ stringstream msg;
+ msg << hostName << " connected to " << serverName << " on port " <<
+- port << ends;
+- message(msg.str());
+- delete msg.str();
+-
++ port;
++ message(msg.str().c_str());
+
+ // Create TCP and UDP streams.
+ tcpIn = new NetInStream(tcpSock,False);
+@@ -967,11 +958,11 @@
+ Role::_error(msg);
+
+ if (errorLocator) {
+- ostrstream str2;
+- str2 << "ERROR: " << msg << ends;
+- errorLocator->arena_message_enq(str2.str(),NULL,ROLE_FAILED_TIME);
++ stringstream str2;
++ str2 << "ERROR: " << msg;
++ errorLocator->arena_message_enq(Utils::strdup(str2.str().c_str()),NULL,ROLE_FAILED_TIME);
+ // Don't delete str2.str(), give memory to the Locator.
+- errorLocator->message_enq(Utils::strdup(str2.str()));
++ errorLocator->message_enq(Utils::strdup(str2.str().c_str()));
+ }
+ #if WIN32
+ // Only the client can afford to block on error messages.
+@@ -986,11 +977,9 @@
+ Role::_error(msg);
+
+ if (errorLocator) {
+- ostrstream str2;
+- str2 << msg << ends;
+- errorLocator->arena_message_enq(str2.str());
++ errorLocator->arena_message_enq(Utils::strdup(msg));
+ // Don't delete str2.str(), give memory to the Locator.
+- errorLocator->message_enq(Utils::strdup(str2.str()));
++ errorLocator->message_enq(Utils::strdup(msg));
+ }
+ }
+
+@@ -1256,10 +1245,9 @@
+ if (turn > turnMax) {
+ turnMax = turn;
+ if (echoPingPong) {
+- ostrstream str;
+- str << "PONG the server with turn " << turnMax << ends;
+- message(str.str());
+- delete str.str();
++ stringstream str;
++ str << "PONG the server with turn " << turnMax;
++ message(str.str().c_str());
+ }
+ // Tell server so it can free turn windows to send more data.
+ XETP::send_pong(udpOut,turnMax);
+@@ -1365,10 +1353,9 @@
+ }
+ }
+ else {
+- ostrstream str;
+- str << "No context for classId " << classId << ends;
+- error(str.str());
+- delete str.str();
++ stringstream str;
++ str << "No context for classId " << classId;
++ error(str.str().c_str());
+ }
+ }
+ }
+@@ -1582,9 +1569,9 @@
+ return Utils::strdup(clientName);
+ }
+
+- ostrstream str;
+- str << '\"' << intel->get_name() << "\"@" << clientName << ends;
+- return str.str();
++ stringstream str;
++ str << '\"' << intel->get_name() << "\"@" << clientName;
++ return Utils::strdup(str.str().c_str());
+ }
+
+
+@@ -1695,11 +1682,10 @@
+ }
+
+ #ifdef SKIP_MESSAGES
+- ostrstream msg;
++ stringstream msg;
+ msg << "Average delay is " << avg << " out of "
+- << delaysNum << " samples." << ends;
++ << delaysNum << " samples.";
+ server->message(msg.str());
+- delete msg.str();
+ #endif
+
+ #if 0
+@@ -1723,10 +1709,9 @@
+ // server->error("Client has reached maximum skip value.");
+ // }
+ #ifdef SKIP_MESSAGES
+- ostrstream msg;
+- msg << "Increasing skip to " << skip << ends;
++ stringstream msg;
++ msg << "Increasing skip to " << skip;
+ server->message(msg.str());
+- delete msg.str();
+ #endif
+ }
+ // We have moved back into our target range, can send more data now.
+@@ -1734,10 +1719,9 @@
+ skip--;
+
+ #ifdef SKIP_MESSAGES
+- ostrstream msg;
+- msg << "Decreasing skip to " << skip << ends;
++ stringstream msg;
++ msg << "Decreasing skip to " << skip;
+ server->message(msg.str());
+- delete msg.str();
+ #endif
+ }
+
+@@ -1777,7 +1761,7 @@
+
+
+
+-Server::Server(Boolean lHuman,char *portName,LocatorP errLocator) {
++Server::Server(Boolean lHuman,const char *portName,LocatorP errLocator) {
+ // Hack, using errLocator for more than reporting errors.
+ errLocator->set_remember_deleted(True);
+ errLocator->set_remember_sounds(True);
+@@ -1843,19 +1827,17 @@
+
+ // Give address to both the TCP and UDP sockets.
+ if (bind(tcpSock, (CMN_SOCKADDR *)&serverAddr, sizeof(serverAddr)) < 0) {
+- ostrstream str;
++ stringstream str;
+ str << "Couldn't bind socket name to TCP socket on port "
+- << port << "." << ends;
+- error(str.str());
+- delete str.str();
++ << port << ".";
++ error(str.str().c_str());
+ return;
+ }
+ if (bind(udpSock, (CMN_SOCKADDR *)&serverAddr, sizeof(serverAddr)) < 0) {
+- ostrstream str;
++ stringstream str;
+ str << "Couldn't bind socket name to UDP socket on port "
+- << port << "." << ends;
+- error(str.str());
+- delete str.str();
++ << port << ".";
++ error(str.str().c_str());
+ return;
+ }
+
+@@ -1868,10 +1850,9 @@
+ assert(udpIn);
+
+ // Message to server log.
+- strstream msg;
+- msg << "Set up server on port " << port << ends;
+- message(msg.str());
+- delete(msg.str());
++ stringstream msg;
++ msg << "Set up server on port " << port;
++ message(msg.str().c_str());
+
+ running = True;
+ }
+@@ -1951,10 +1932,9 @@
+ localHumanId = hId;
+
+ // Log the human's name.
+- strstream msg;
+- msg << "Player 0 \"" << human->get_name() << '\"' << "@SERVER" << ends;
+- message(msg.str());
+- delete(msg.str());
++ stringstream msg;
++ msg << "Player 0 \"" << human->get_name() << '\"' << "@SERVER";
++ message(msg.str().c_str());
+
+ return;
+ }
+@@ -1985,12 +1965,11 @@
+
+ // Log all the players in the game, some code duplication for the
+ // local human.
+- ostrstream str;
++ stringstream str;
+ char* fullName = cn->get_full_client_name();
+- str << "Player " << num << " " << fullName << ends;
+- message(str.str());
++ str << "Player " << num << " " << fullName;
++ message(str.str().c_str());
+ delete fullName;
+- delete str.str();
+
+ // Send assign_intel via TCP
+ OutStreamP out = cn->get_tcp_out_stream();
+@@ -2007,13 +1986,12 @@
+ // anyway.
+ for (m = 0; m < connections.length() && m != n; m++) {
+ char* fullName = cn->get_full_client_name();
+- ostrstream str;
+- str << fullName << " has joined the game" << ends;
++ stringstream str;
++ str << fullName << " has joined the game";
+ delete fullName;
+
+ OutStreamP out = cn->get_udp_out_stream();
+- XETP::send_arena_message(out,timeMS,str.str());
+- delete str.str();
++ XETP::send_arena_message(out,timeMS,str.str().c_str());
+ }
+ cn->creation_message_sent();
+ }
+@@ -2101,13 +2079,12 @@
+ // Give the connection some slack when it is first starting up.
+ turn - cn->get_start_turn() >= MINIMUM_CUTOFF) {
+ char* fullName = cn->get_full_client_name();
+- ostrstream str;
++ stringstream str;
+ str << fullName
+ << " has not responded in "
+- << diff << " turns. Disconnect." << ends;
+- message(str.str());
++ << diff << " turns. Disconnect.";
++ message(str.str().c_str());
+ delete fullName;
+- delete str.str();
+ tooOld = True;
+ }
+ }
+@@ -2147,11 +2124,10 @@
+ diff == NO_ACTIVITY_WARN_2 ||
+ diff == NO_ACTIVITY_WARN_3) {
+ if (echoPingPong) {
+- ostrstream str;
++ stringstream str;
+ str << "Haven't heard from " << cn->get_client_name()
+- << " in " << diff << " turns, sending PING." << ends;
+- message(str.str());
+- delete str.str();
++ << " in " << diff << " turns, sending PING.";
++ message(str.str().c_str());
+ }
+ XETP::send_ping(cn->get_udp_out_stream());
+ }
+@@ -2311,7 +2287,11 @@
+ for (m = 0; m < followers.length(); m++) {
+ PhysicalP q = (PhysicalP)followers.get(m);
+ netData = q->get_net_data();
+- assert(!netData->get_sent_flag());
++ // This line was aborting network games, often in the pound scenario.
++ // Without it, the server seems to continue without error.
++ // I tried replacing it with a warning, but there is so much of it
++ // that it is nearly impossible to see anything else. -Brandon
++// assert(!netData->get_sent_flag());
+ netData->set_sent_flag(True);
+ }
+
+@@ -2713,9 +2693,9 @@
+ // Careful to set the propagate flag to False so the message doesn't get
+ // sent to the clients.
+ if (errorLocator) {
+- ostrstream str2;
+- str2 << "SERVER: " << msg << ends;
+- errorLocator->arena_message_enq(str2.str(),NULL,ROLE_FAILED_TIME,False);
++ stringstream str2;
++ str2 << "SERVER: " << msg;
++ errorLocator->arena_message_enq(Utils::strdup(str2.str().c_str()),NULL,ROLE_FAILED_TIME,False);
+ // Don't delete str2.str(), give memory to the Locator.
+
+ // Could do a regular message_enq(), but would have to deal with the
+@@ -2728,10 +2708,9 @@
+ void Server::display_chat_message(LocatorP l,const char* sender,
+ const char* msg) {
+ // Log the chat message, then let Role handle it.
+- strstream logMsg;
+- logMsg << '<' << sender << '>' << msg << ends;
+- message(logMsg.str());
+- delete logMsg.str();
++ stringstream logMsg;
++ logMsg << '<' << sender << '>' << msg;
++ message(logMsg.str().c_str());
+
+ Role::display_chat_message(l,sender,msg);
+ }
+@@ -2851,12 +2830,11 @@
+ udpAddr->sin_port = htons(udpPort);
+
+ // Log the connection.
+- strstream msg;
++ stringstream msg;
+ msg << clientName <<
+ " connected (TCP port " << ntohs(tcpAddr.sin_port) <<
+- ", UDP port " << udpPort << ")" << ends;
+- message(msg.str());
+- delete(msg.str());
++ ", UDP port " << udpPort << ")";
++ message(msg.str().c_str());
+
+ Connection* cn =
+ new Connection(this,errorLocator,
+@@ -2874,7 +2852,7 @@
+ XETP::send_reset(out,manager->get_game_style_type());
+
+ // Say hello to the new client.
+- ostrstream greeting;
++ stringstream greeting;
+ greeting << "Welcome to " << hostName << ".";
+
+ if (get_humans_num() == 1) {
+@@ -2884,10 +2862,8 @@
+ greeting << " There are now "
+ << get_humans_num() << " players.";
+ }
+- greeting << ends;
+ int timeMS = quantaToMS(UI_ARENA_MESSAGE_TIME,manager);
+- XETP::send_arena_message(out,timeMS,greeting.str());
+- delete greeting.str();
++ XETP::send_arena_message(out,timeMS,greeting.str().c_str());
+
+ manager->humans_num_incremented();
+ }
+@@ -2918,18 +2894,16 @@
+ Connection* cm = get_connection(m);
+
+ char* fullName = cn->get_full_client_name();
+- ostrstream str;
++ stringstream str;
+ str << fullName << " has disconnected";
+ if (intel) {
+ str << ", " << kills << " human kills";
+ }
+- str << ends;
+ XETP::send_arena_message(cm->get_udp_out_stream(),
+- timeMS,str.str());
++ timeMS,str.str().c_str());
+
+
+ delete fullName;
+- delete str.str();
+ }
+ }
+
+@@ -3262,8 +3236,8 @@
+ void Server::send_udp_server_pong(IGameManager* manager,LocatorP locator,
+ CMN_SOCKET udpSock,
+ CMN_SOCKADDR_IN* destAddr) {
+- static char* unknownString = "<unknown>";
+- static char* serverString = "<server>";
++ static const char* unknownString = "<unknown>";
++ static const char* serverString = "<server>";
+
+
+ // Temporary stream.
diff --git a/games/xevil/files/patch-cmn::streams.cpp b/games/xevil/files/patch-cmn::streams.cpp
index 7d0ff670e436..09bd066253bc 100644
--- a/games/xevil/files/patch-cmn::streams.cpp
+++ b/games/xevil/files/patch-cmn::streams.cpp
@@ -1,12 +1,35 @@
---- cmn/streams.cpp.orig Wed Jan 19 12:54:32 2000
-+++ cmn/streams.cpp Sat Oct 25 21:44:08 2003
-@@ -31,7 +31,8 @@
+--- cmn/streams.cpp.orig 2012-05-27 06:52:30.000000000 +0900
++++ cmn/streams.cpp 2012-05-27 06:53:11.000000000 +0900
+@@ -31,12 +31,13 @@
#include "utils.h"
#include "neth.h" // needed for recv, send, recvfrom, sendto
-#include <iostream.h>
+#include <iostream>
-+using namespace std;
#include "streams.h"
#include "xetp.h" // yuck, need this for XETP::versionStr
+
+
++using namespace std;
+
+ Checksum GenericStream::compute_checksum(u_char *data,int len) {
+ Checksum c = 0;
+@@ -205,7 +206,7 @@
+
+
+
+-Boolean NetOutStream::write(void *buf,int size) {
++Boolean NetOutStream::write(const void *buf,int size) {
+ if (!isAlive) {
+ return False;
+ }
+@@ -518,7 +519,7 @@
+
+
+
+-Boolean UDPOutStream::write(void *buf,int size) {
++Boolean UDPOutStream::write(const void *buf,int size) {
+ if (!isAlive) {
+ return False;
+ }
diff --git a/games/xevil/files/patch-cmn::utils.cpp b/games/xevil/files/patch-cmn::utils.cpp
index 2b05ca5cf1de..5cfdfd2a410b 100644
--- a/games/xevil/files/patch-cmn::utils.cpp
+++ b/games/xevil/files/patch-cmn::utils.cpp
@@ -1,39 +1,84 @@
---- cmn/utils.cpp.orig 2003-03-19 10:05:12.000000000 +0100
-+++ cmn/utils.cpp 2007-07-31 15:43:42.000000000 +0200
-@@ -30,16 +30,17 @@
+--- cmn/utils.cpp.orig 2012-05-27 06:52:30.000000000 +0900
++++ cmn/utils.cpp 2012-05-27 06:53:11.000000000 +0900
+@@ -30,16 +30,16 @@
// Include Files
#include "stdafx.h"
-#include <iostream.h>
--#include <limits.h>
--#include <string.h>
--#include <ctype.h>
--#include <fstream.h>
+#include <iostream>
-+#include <climits>
-+#include <cstring>
-+#include <cctype>
+ #include <limits.h>
+ #include <string.h>
+ #include <ctype.h>
+-#include <fstream.h>
+#include <fstream>
-+using namespace std;
#if WIN32
#include <strstrea.h>
#endif
#if X11
-#include <strstream.h>
-+#include <strstream>
++#include <sstream>
#endif
#ifdef WIN32
-@@ -605,7 +606,7 @@
+@@ -422,10 +422,8 @@
+
+
+ char* Utils::get_OS_info() {
+- ostrstream ret;
+-
+-
+ #ifdef WIN32
++ stringstream ret;
+ OSVERSIONINFO osInfo;
+ osInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ Boolean set = False;
+@@ -465,12 +463,11 @@
+ Utils::strcmp(osInfo.szCSDVersion," ")) {
+ ret << '(' << osInfo.szCSDVersion << ')';
+ }
+- ret << ends;
+ }
+ }
+
+ if (!set) {
+- ret << "Unknown Win32" << ends;
++ ret << "Unknown Win32";
+ }
+ #endif
+
+@@ -494,20 +491,15 @@
+ if (buffer[strLen - 1] == '\n') {
+ buffer[strLen - 1] = '\0';
+ }
+- ret << buffer << ends;
+- set = True;
++ return strdup(buffer);
+ }
+ }
+ pclose(fp);
+ }
+
+- if (!set) {
+- ret << "Unknown UNIX" << ends;
+- }
++ return strdup("Unknown UNIX");
+ #endif
+
+-
+- return ret.str();
+ }
+
+
+@@ -605,7 +597,7 @@
// Not tested.
out->write_int(len);
for (int n = 0; n < len; n++) {
- out->write_int((int)data[n]);
-+ out->write_int((intptr_t)data[n]);
++ out->write_int((long)data[n]);
}
}
-@@ -761,7 +762,7 @@
+@@ -761,7 +753,7 @@
private:
@@ -42,12 +87,21 @@
/* MODIFIES: index */
/* EFFECTS: Internal helper function. Return the Bucket containing key
or NULL if not found. Set index to the bucket list for key whether
-@@ -944,7 +945,7 @@
+@@ -944,7 +936,7 @@
// Pretty crappy hash function, I know.
// Careful if bucketsNum is a power of 2.
int HashTable::defaultHash(void* key,int bucketsNum) {
- return ((unsigned int)key) % bucketsNum;
-+ return ((unsigned intptr_t)key) % bucketsNum;
++ return ((unsigned long)key) % bucketsNum;
}
+@@ -1024,7 +1016,7 @@
+ #endif
+
+ #if X11
+- cout << str << endl;
++ std::cout << str << std::endl;
+ #endif
+ }
+
diff --git a/games/xevil/files/patch-cmn::world.cpp b/games/xevil/files/patch-cmn::world.cpp
index aaae27303679..eb2b22c4f7a2 100644
--- a/games/xevil/files/patch-cmn::world.cpp
+++ b/games/xevil/files/patch-cmn::world.cpp
@@ -1,12 +1,19 @@
---- cmn/world.cpp.orig Wed Jan 19 21:15:08 2000
-+++ cmn/world.cpp Sat Oct 25 21:45:40 2003
-@@ -35,7 +35,8 @@
+--- cmn/world.cpp.orig 2012-05-27 06:52:30.000000000 +0900
++++ cmn/world.cpp 2012-05-27 06:53:11.000000000 +0900
+@@ -35,7 +35,7 @@
#endif
// Include Files.
-#include <iostream.h>
+#include <iostream>
-+using namespace std;
#include "utils.h"
#include "coord.h"
+@@ -48,6 +48,7 @@
+ // For PhysMover.
+ #include "actual.h"
+
++using namespace std;
+
+ // Defines.
+ #define HANGING_PERCENT 0.40 // The % of the edge hanging off the corner.
diff --git a/games/xevil/files/patch-cmn::xetp.cpp b/games/xevil/files/patch-cmn::xetp.cpp
index f16e557e83d0..ab2a4f22859d 100644
--- a/games/xevil/files/patch-cmn::xetp.cpp
+++ b/games/xevil/files/patch-cmn::xetp.cpp
@@ -1,24 +1,50 @@
---- cmn/xetp.cpp.orig 2000-01-19 12:54:30.000000000 +0100
-+++ cmn/xetp.cpp 2007-07-31 15:51:31.000000000 +0200
-@@ -29,9 +29,10 @@
+--- cmn/xetp.cpp.orig 2012-05-27 06:52:30.000000000 +0900
++++ cmn/xetp.cpp 2012-05-27 06:53:11.000000000 +0900
+@@ -29,9 +29,9 @@
#include "stdafx.h"
-#include <iostream.h>
+#include <iostream>
-+using namespace std;
#if X11
-#include <strstream.h>
-+#include <strstream>
++#include <sstream>
#endif
#if WIN32
#include <strstrea.h>
-@@ -159,7 +160,7 @@
+@@ -53,6 +53,8 @@
+ #include "xetp.h"
+
+
++using namespace std;
++
+
+ void XETP::check_sizes() {
+ XETPBasic::check_sizes();
+@@ -159,7 +161,7 @@
for (n = 0; n < physicals.length(); n++) {
PhysicalP p = (PhysicalP)physicals.get(n);
// computing object_length twice, but who cares.
- _send_object(out,p,turn,(TickType)tickTypes.get(n),
-+ _send_object(out,p,turn,(intptr_t)tickTypes.get(n),
++ _send_object(out,p,turn,(long)tickTypes.get(n),
compute_object_length(p));
}
+@@ -274,7 +276,7 @@
+
+
+
+-void XETP::send_message(OutStreamP out,char *msg) {
++void XETP::send_message(OutStreamP out,const char *msg) {
+ assert(msg);
+ u_int len = strlen(msg);
+
+@@ -293,7 +295,7 @@
+
+
+
+-void XETP::send_arena_message(OutStreamP out,int time,char *msg) {
++void XETP::send_arena_message(OutStreamP out,int time,const char *msg) {
+ assert(msg);
+ u_int len = sizeof(int) + // time
+ strlen(msg); // string body
diff --git a/games/xevil/files/patch-cmn__coord.h b/games/xevil/files/patch-cmn__coord.h
new file mode 100644
index 000000000000..677ad5fb2a67
--- /dev/null
+++ b/games/xevil/files/patch-cmn__coord.h
@@ -0,0 +1,11 @@
+--- cmn/coord.h.orig 2012-05-27 06:52:31.000000000 +0900
++++ cmn/coord.h 2012-05-27 06:53:11.000000000 +0900
+@@ -619,7 +619,7 @@
+ int enemiesInitial; // enemies on first level
+ int enemiesIncr; // this many more enemies each level
+ int enemiesMax; // maximum number of enemies (for levels)
+- char *name; // of this difficulty level
++ const char *name; // of this difficulty level
+ };
+ enum {DIFF_TRIVIAL,DIFF_NORMAL,DIFF_HARD,DIFF_BEND_OVER,
+ DIFFICULTY_LEVELS_NUM, DIFF_NONE=DIFFICULTY_LEVELS_NUM};
diff --git a/games/xevil/files/patch-cmn__intel.h b/games/xevil/files/patch-cmn__intel.h
new file mode 100644
index 000000000000..e5946e814b78
--- /dev/null
+++ b/games/xevil/files/patch-cmn__intel.h
@@ -0,0 +1,83 @@
+--- cmn/intel.h.orig 2012-05-27 06:52:31.000000000 +0900
++++ cmn/intel.h 2012-05-27 06:53:11.000000000 +0900
+@@ -123,7 +123,7 @@
+ // Class Definitions.
+ class Intel {
+ public:
+- Intel(WorldP w,LocatorP l,char *name,
++ Intel(WorldP w,LocatorP l,const char *name,
+ const IntelOptions *ops,ITmask opMask);
+ /* EFFECTS: Create a new intel with the options specified in opMakse that are
+ in ops. ops will never be referenced if opMask is ITnone. lives now
+@@ -293,7 +293,7 @@
+ // Simply buffers input from a user interface.
+ class Human: public Intel {
+ public:
+- Human(WorldP w,LocatorP l,char *name,int lives,
++ Human(WorldP w,LocatorP l,const char *name,int lives,
+ int *sharedLives,ColorNum colorNum);
+ /* NOTE: Uses all default options. intelOptions should be meaningless for
+ a human. If "sharedLives" is non-null, ignore "lives" and share the lives. */
+@@ -346,7 +346,7 @@
+
+ class Machine: public Intel {
+ public:
+- Machine(WorldP w,LocatorP l,char *name,
++ Machine(WorldP w,LocatorP l,const char *name,
+ const IntelOptions *ops,ITmask opMask);
+
+ virtual IntelId get_master_intel_id();
+@@ -464,7 +464,7 @@
+
+ class Enemy: public Machine {
+ public:
+- Enemy(WorldP w,LocatorP l,char *name,
++ Enemy(WorldP w,LocatorP l,const char *name,
+ const IntelOptions *ops,ITmask opMask);
+
+ static void set_reflexes_time(int time) {reflexesTime = time;}
+@@ -491,7 +491,7 @@
+
+ class Neutral: public Machine {
+ public:
+- Neutral(WorldP w,LocatorP l,char *name,
++ Neutral(WorldP w,LocatorP l,const char *name,
+ const IntelOptions *ops,ITmask opMask);
+
+ virtual Boolean is_enemy();
+@@ -502,7 +502,7 @@
+
+ class SealIntel: public Neutral {
+ public:
+- SealIntel(WorldP w,LocatorP l,char *name,const Id &homeId);
++ SealIntel(WorldP w,LocatorP l,const char *name,const Id &homeId);
+
+ virtual Boolean is_seal_intel();
+
+@@ -522,7 +522,7 @@
+
+ class DoppelIntel: public Neutral {
+ public:
+- DoppelIntel(WorldP w,LocatorP l,char *name,
++ DoppelIntel(WorldP w,LocatorP l,const char *name,
+ const IntelOptions *ops,ITmask opMask,
+ IntelP master = NULL);
+
+@@ -572,7 +572,7 @@
+ // in choose_strategy() and go_get_em().
+ class Pet: public DoppelIntel {
+ public:
+- Pet(WorldP w,LocatorP l,char *name,
++ Pet(WorldP w,LocatorP l,const char *name,
+ const IntelOptions *ops,ITmask opMask,
+ IntelP master = NULL);
+
+@@ -583,7 +583,7 @@
+ IT_WEAPON_{some dir}, or to come back to him if command is IT_WEAPON_CENTER.
+ This will also set p to be the new master. */
+
+- static char *mode_string(int mode);
++ static const char *mode_string(int mode);
+ /* NOTE: For debugging. */
+
+
diff --git a/games/xevil/files/patch-cmn__locator.cpp b/games/xevil/files/patch-cmn__locator.cpp
new file mode 100644
index 000000000000..534d959f4036
--- /dev/null
+++ b/games/xevil/files/patch-cmn__locator.cpp
@@ -0,0 +1,10 @@
+--- cmn/locator.cpp.orig 2012-05-27 06:52:30.000000000 +0900
++++ cmn/locator.cpp 2012-05-27 06:53:11.000000000 +0900
+@@ -50,6 +50,7 @@
+
+ #include "bitmaps/locator/locator.bitmaps" // for arrows
+
++using namespace std;
+
+ // When we reach this, start deleting objects.
+ #define OL_LIST_WARN ((int)(OL_LIST_MAX * 0.9))
diff --git a/games/xevil/files/patch-cmn__role.h b/games/xevil/files/patch-cmn__role.h
new file mode 100644
index 000000000000..959454ce1dab
--- /dev/null
+++ b/games/xevil/files/patch-cmn__role.h
@@ -0,0 +1,11 @@
+--- cmn/role.h.orig 2012-05-27 06:52:31.000000000 +0900
++++ cmn/role.h 2012-05-27 06:53:11.000000000 +0900
+@@ -539,7 +539,7 @@
+
+
+ public:
+- Server(Boolean localHuman,char *portName,LocatorP);
++ Server(Boolean localHuman,const char *portName,LocatorP);
+ /* EFFECTS: Create a server that listens for connections on given port.
+ If NULL is passed in, use XETP::DEFAULT_PORT. */
+
diff --git a/games/xevil/files/patch-cmn__streams.h b/games/xevil/files/patch-cmn__streams.h
new file mode 100644
index 000000000000..10ef5721781c
--- /dev/null
+++ b/games/xevil/files/patch-cmn__streams.h
@@ -0,0 +1,29 @@
+--- cmn/streams.h.orig 2012-05-27 06:52:31.000000000 +0900
++++ cmn/streams.h 2012-05-27 06:53:11.000000000 +0900
+@@ -97,7 +97,7 @@
+ public:
+ OutStream(Boolean ownSock) : GenericStream(ownSock) {}
+
+- virtual Boolean write(void *buf,int size) = 0;
++ virtual Boolean write(const void *buf,int size) = 0;
+ /* EFFECTS: Write size number of bytes into buf. Return True if
+ successful. */
+
+@@ -171,7 +171,7 @@
+
+ virtual Boolean alive();
+
+- virtual Boolean write(void *buf,int size);
++ virtual Boolean write(const void *buf,int size);
+
+ virtual void write_char(u_char);
+
+@@ -253,7 +253,7 @@
+
+ virtual void done_packet();
+
+- virtual Boolean write(void *buf,int size);
++ virtual Boolean write(const void *buf,int size);
+
+ void flush();
+
diff --git a/games/xevil/files/patch-cmn__utils.h b/games/xevil/files/patch-cmn__utils.h
new file mode 100644
index 000000000000..e88b3e8d7a3d
--- /dev/null
+++ b/games/xevil/files/patch-cmn__utils.h
@@ -0,0 +1,28 @@
+--- cmn/utils.h.orig 2012-05-27 06:52:31.000000000 +0900
++++ cmn/utils.h 2012-05-27 06:53:11.000000000 +0900
+@@ -159,7 +159,7 @@
+
+ typedef int GameStyleType;
+ // Possible values of GameStyleType.
+-enum {SCENARIOS,LEVELS_ONLY,KILL,DUEL,EXTENDED,TRAINING,LEVELS};
++enum {SCENARIOS,LEVELS_ONLY,KILL,DUEL,EXTENDED,TRAINING,LEVELS,NUM_GAME_STYLES};
+
+
+
+@@ -237,13 +237,13 @@
+ /* EFFECTS: Wrapper for C library strcmp(). Return 0 if strings are the
+ same. */
+
+- static char* strchr(const char* cs,int c)
++ static const char* strchr(const char* cs,int c)
+ {return ::strchr(cs,c);}
+
+- static char* strrchr(const char* cs,int c)
++ static const char* strrchr(const char* cs,int c)
+ {return ::strrchr(cs,c);}
+
+- static char* strstr(const char* cs,const char* ct)
++ static const char* strstr(const char* cs,const char* ct)
+ {return ::strstr(cs,ct);}
+
+ static void strcpy(char* s,const char* ct)
diff --git a/games/xevil/files/patch-cmn__xetp.h b/games/xevil/files/patch-cmn__xetp.h
new file mode 100644
index 000000000000..bfae80558cac
--- /dev/null
+++ b/games/xevil/files/patch-cmn__xetp.h
@@ -0,0 +1,14 @@
+--- cmn/xetp.h.orig 2012-05-27 06:52:31.000000000 +0900
++++ cmn/xetp.h 2012-05-27 06:53:11.000000000 +0900
+@@ -83,9 +83,9 @@
+ static void send_rooms_known(OutStreamP,const Rooms &,
+ int worldVersion,Boolean *map);
+
+- static void send_message(OutStreamP,char *msg);
++ static void send_message(OutStreamP,const char *msg);
+
+- static void send_arena_message(OutStreamP,int timeMS,char *msg);
++ static void send_arena_message(OutStreamP,int timeMS,const char *msg);
+
+ static void send_command(OutStreamP,const IntelId &,ITcommand);
+
diff --git a/games/xevil/files/patch-cmn__xetp_basic.cpp b/games/xevil/files/patch-cmn__xetp_basic.cpp
new file mode 100644
index 000000000000..e8f5531bf2be
--- /dev/null
+++ b/games/xevil/files/patch-cmn__xetp_basic.cpp
@@ -0,0 +1,11 @@
+--- cmn/xetp_basic.cpp.orig 2012-05-27 06:52:30.000000000 +0900
++++ cmn/xetp_basic.cpp 2012-05-27 06:53:11.000000000 +0900
+@@ -33,7 +33,7 @@
+ #include "xetp_basic.h"
+
+
+-char *XETPBasic::versionStr = "XETP1.00";
++const char *XETPBasic::versionStr = "XETP1.00";
+ // 0.10 released with special RedHat version
+ // 0.12 for 2.0b5
+ // 0.15 for 2.0b6
diff --git a/games/xevil/files/patch-cmn__xetp_basic.h b/games/xevil/files/patch-cmn__xetp_basic.h
new file mode 100644
index 000000000000..cee9cd279af9
--- /dev/null
+++ b/games/xevil/files/patch-cmn__xetp_basic.h
@@ -0,0 +1,11 @@
+--- cmn/xetp_basic.h.orig 2012-05-27 06:52:31.000000000 +0900
++++ cmn/xetp_basic.h 2012-05-27 06:53:11.000000000 +0900
+@@ -52,7 +52,7 @@
+ // All values are big-endian
+ enum {HEADER_LENGTH = 3}; // 8
+ enum {VERSION_LENGTH = 8}; // streams.h depends on this value.
+- static char *versionStr;
++ static const char *versionStr;
+
+ // The ':' syntax gives the size in bytes of each component. :String means
+ // use Utils::string_read(), Utils::string_write(), etc.
diff --git a/games/xevil/files/patch-x11::l_agreement_dlg.cpp b/games/xevil/files/patch-x11::l_agreement_dlg.cpp
index 7d454fc70562..be702d9a002b 100644
--- a/games/xevil/files/patch-x11::l_agreement_dlg.cpp
+++ b/games/xevil/files/patch-x11::l_agreement_dlg.cpp
@@ -1,12 +1,10 @@
---- x11/l_agreement_dlg.cpp.orig Wed Jan 19 12:55:04 2000
-+++ x11/l_agreement_dlg.cpp Sat Oct 25 21:46:33 2003
-@@ -31,7 +31,8 @@
+--- x11/l_agreement_dlg.cpp.orig 2012-05-27 06:52:29.000000000 +0900
++++ x11/l_agreement_dlg.cpp 2012-05-27 06:52:59.000000000 +0900
+@@ -31,7 +31,6 @@
#include <X11/Xatom.h>
}
-#include <strstream.h>
-+#include <strstream>
-+using namespace std;
#include "xdata.h"
#include "panel.h"
diff --git a/games/xevil/files/patch-x11::main.cpp b/games/xevil/files/patch-x11::main.cpp
index 7bbf52f13fc6..d80655e1b7c1 100644
--- a/games/xevil/files/patch-x11::main.cpp
+++ b/games/xevil/files/patch-x11::main.cpp
@@ -1,12 +1,34 @@
---- x11/main.cpp.orig Sat Mar 22 20:52:14 2003
-+++ x11/main.cpp Sat Oct 25 21:47:04 2003
-@@ -33,7 +33,8 @@
+--- x11/main.cpp.orig 2012-05-27 06:52:29.000000000 +0900
++++ x11/main.cpp 2012-05-27 06:52:58.000000000 +0900
+@@ -25,6 +25,7 @@
+ #include "utils.h"
+
+ extern "C" {
++#include <stdlib.h>
+ #include <X11/Xutil.h>
+
+ #ifdef OPENWOUND_XOS_STRLEN_HACK
+@@ -33,13 +34,13 @@
#include <X11/Xos.h>
}
-#include <iostream.h>
+#include <iostream>
-+using namespace std;
#include "utils.h"
#include "neth.h"
+ #include "game.h"
+
+-
++GameP g_game;
+
+ class TurnStarter: public ITurnStarter {
+ public:
+@@ -68,6 +69,7 @@
+ Utils::seed_random();
+
+ GameP game = new Game(&argc,argv);
++ g_game = game;
+
+ // assert (clock() != -1);
+
diff --git a/games/xevil/files/patch-x11::panel.cpp b/games/xevil/files/patch-x11::panel.cpp
index fb0cd883ffcf..f75f23f74adb 100644
--- a/games/xevil/files/patch-x11::panel.cpp
+++ b/games/xevil/files/patch-x11::panel.cpp
@@ -1,14 +1,52 @@
---- x11/panel.cpp.orig Sat Mar 22 20:50:44 2003
-+++ x11/panel.cpp Sat Oct 25 21:47:34 2003
-@@ -31,8 +31,9 @@
+--- x11/panel.cpp.orig 2012-05-27 06:52:29.000000000 +0900
++++ x11/panel.cpp 2012-05-27 06:52:58.000000000 +0900
+@@ -31,13 +31,14 @@
#include <X11/Xutil.h>
#include <X11/keysym.h>
}
-#include <iostream.h>
-#include <strstream.h>
+#include <iostream>
-+#include <strstream>
-+using namespace std;
++#include <sstream>
#include "utils.h"
#include "xdata.h"
+ #include "panel.h"
+
++using namespace std;
+
+ #define PANEL_BORDER 1
+ #define PANEL_MARGAIN 2
+@@ -311,15 +312,14 @@
+
+
+ void WritePanel::update_message() {
+- ostrstream tmp;
++ stringstream tmp;
+ if (active) {
+- tmp << prompt << value << "_" << ends;
++ tmp << prompt << value << "_";
+ }
+ else {
+- tmp << prompt << value << ends;
++ tmp << prompt << value;
+ }
+- set_message(tmp.str());
+- delete tmp.str();
++ set_message(tmp.str().c_str());
+ }
+
+
+@@ -524,9 +524,8 @@
+ return;
+ }
+
+- ostrstream tmp;
+- tmp << "CHAT <<" << value << "\nEnter to send, Esc to cancel." << ends;
+- TextPanel::set_message(tmp.str());
+- delete tmp.str();
++ stringstream tmp;
++ tmp << "CHAT <<" << value << "\nEnter to send, Esc to cancel.";
++ TextPanel::set_message(tmp.str().c_str());
+ }
+
diff --git a/games/xevil/files/patch-x11::serverping.cpp b/games/xevil/files/patch-x11::serverping.cpp
index 35808396f183..debc89bafc73 100644
--- a/games/xevil/files/patch-x11::serverping.cpp
+++ b/games/xevil/files/patch-x11::serverping.cpp
@@ -1,14 +1,111 @@
---- x11/serverping.cpp.orig Sat Mar 22 21:55:12 2003
-+++ x11/serverping.cpp Sat Oct 25 21:48:03 2003
-@@ -25,8 +25,9 @@
+--- x11/serverping.cpp.orig 2012-05-27 06:52:29.000000000 +0900
++++ x11/serverping.cpp 2012-05-27 07:12:12.000000000 +0900
+@@ -25,14 +25,15 @@
// code and should be reasonably easy to compile on Windows.
-#include <iostream.h>
-#include <strstream.h>
+#include <iostream>
-+#include <strstream>
-+using namespace std;
++#include <sstream>
#include "utils.h"
#include "streams.h"
#include "xetp_basic.h"
+ #include "neth.h"
+ #include "id.h"
+
++using namespace std;
+
+
+ class ServerPing {
+@@ -113,7 +114,7 @@
+
+
+ char* sString = argv[argc - 1];
+- char* port = Utils::strchr(sString,':');
++ const char* port = Utils::strchr(sString,':');
+ // server:port
+ if (port) {
+ serverName = new char[port - sString + 1];
+@@ -140,10 +141,9 @@
+ error("Error opening client UDP socket.");
+ }
+
+- ostrstream str;
+- str << "Looking up IP address for server " << serverName << ends;
+- message(str.str());
+- delete str.str();
++ stringstream str;
++ str << "Looking up IP address for server " << serverName;
++ message(str.str().c_str());
+
+ // Create server address.
+ memset((void *)&serverAddr,'\0',sizeof(serverAddr));
+@@ -171,10 +171,9 @@
+ client.sin_addr.s_addr = htonl(INADDR_ANY);
+ client.sin_port = htons((u_short)clientPort);
+ if (bind(udpSock,(CMN_SOCKADDR *)&client,sizeof(client)) < 0) {
+- ostrstream str;
+- str << "Could not bind local UDP port " << clientPort << ends;
+- error(str.str());
+- delete str.str();
++ stringstream str;
++ str << "Could not bind local UDP port " << clientPort;
++ error(str.str().c_str());
+ return;
+ }
+
+@@ -197,11 +196,10 @@
+ // Send "count" number of SERVER_PINGs.
+ for (int tries = 0; tries < count; tries++) {
+ // Send the ping.
+- ostrstream msg;
++ stringstream msg;
+ msg << "Sending XETP::SERVER_PING to "
+- << serverName << ':' << serverPort << ends;
+- message(msg.str());
+- delete msg.str();
++ << serverName << ':' << serverPort;
++ message(msg.str().c_str());
+ XETPBasic::send_server_ping(udpOut);
+ // Don't buffer the ping.
+ udpOut->flush();
+@@ -248,11 +246,10 @@
+ }
+
+ // If we get here, we failed to reach the server.
+- ostrstream msg;
++ stringstream msg;
+ msg << "No return from " << serverName << ':' << serverPort << " after "
+- << count << " tries." << ends;
+- error(msg.str());
+- delete msg.str();
++ << count << " tries.";
++ error(msg.str().c_str());
+ }
+
+
+@@ -271,12 +268,9 @@
+
+
+ void ServerPing::error(const char* msg1,const char* msg2) {
+- ostrstream str;
+- str << msg1 << msg2 << ends;
+- error(str.str());
+-
+- // Will never get here, but WTF.
+- delete str.str();
++ stringstream str;
++ str << msg1 << msg2;
++ error(str.str().c_str());
+ }
+
+
+@@ -355,6 +349,7 @@
+
+
+
++int
+ main(int argc,char** argv) {
+ ServerPing ping(argc,argv);
+ ping.go();
diff --git a/games/xevil/files/patch-x11::ui.cpp b/games/xevil/files/patch-x11::ui.cpp
index d9c911d27fa8..ab83dec24000 100644
--- a/games/xevil/files/patch-x11::ui.cpp
+++ b/games/xevil/files/patch-x11::ui.cpp
@@ -1,131 +1,377 @@
---- x11/ui.cpp.orig 2003-03-19 10:05:38.000000000 +0100
-+++ x11/ui.cpp 2007-07-31 16:05:35.000000000 +0200
-@@ -40,8 +40,9 @@
+--- x11/ui.cpp.orig 2012-05-27 06:52:29.000000000 +0900
++++ x11/ui.cpp 2012-05-27 06:52:59.000000000 +0900
+@@ -30,6 +30,7 @@
+ #include "utils.h"
+ extern "C" {
+ #include <string.h>
++#include <stdlib.h>
+ #include <X11/Xutil.h>
+ #ifdef OPENWOUND_XOS_STRLEN_HACK
+ #define _strings_h
+@@ -40,8 +41,8 @@
#include <X11/Xatom.h>
}
-#include <iostream.h>
-#include <strstream.h>
+#include <iostream>
-+#include <strstream>
-+using namespace std;
++#include <sstream>
#include "coord.h"
#include "area.h"
-@@ -930,7 +931,7 @@
+@@ -59,6 +60,7 @@
+ #include "panel.h"
+ #include "viewport.h"
+
++using namespace std;
+
+ // Defines
+ #define DEFAULT_BIG_FONT_NAME "-*-helvetica-*-r-*-*-18-*-*-*-*-*-*-*"
+@@ -226,20 +228,6 @@
+ for (int d = 0; d < xvars.dpyMax; d++) {
+ xvars.alloc_named_color(d,"steelblue");
+ }
+-
+- // Run the license agreement.
+- // Note: The license agreement will not be run if the user runs
+- // "xevil -server -no_ui".
+- // Must be after init_x().
+- Boolean reduceDraw = Viewport::get_reduce_draw();
+- Boolean accepted =
+- LAgreement::check_accepted(largeViewport,smoothScroll,reduceDraw,
+- xvars,0,argc,argv);
+- Viewport::set_reduce_draw(reduceDraw);
+- if (!accepted) {
+- // Should probably let game.cpp call exit.
+- exit(1);
+- }
+
+ // Ick, this should be in init_x(), but we need to call init_x() before
+ // running the License Agreement to get this information.
+@@ -461,21 +449,27 @@
+ }
+ }
+
+- if (down) {
+- // Restart game if space pressed.
+- // This doesn't always work, the otherInput flag might get cleared
+- // before it is used.
+- if (keycode == XKeysymToKeycode(xvars.dpy[dpyNum],XK_space)) {
+- otherInput = True;
++ // If function keys are assigned to movement, weapon or item functions,
++ // then this code will not get executed.
++ if (down && !found) {
++ // Pause Game
++ if (keycode == XKeysymToKeycode(xvars.dpy[dpyNum],XK_F1)) {
++ settingsChanges |= UIpause;
++ settings.pause = True;
+ }
+-
+- if (!found) {
+- // Undocumented pause key feature.
+- // Don't do pause if XK_F1 is used for something else.
+- if (keycode == XKeysymToKeycode(xvars.dpy[dpyNum],XK_F1)) {
+- settingsChanges |= UIpause;
+- settings.pause = True;
+- }
++ // New Game
++ if (keycode == XKeysymToKeycode(xvars.dpy[dpyNum],XK_F2)) {
++ settingsChanges |= UInewGame;
++ }
++ // Change game style
++ if (keycode == XKeysymToKeycode(xvars.dpy[dpyNum],XK_F3)) {
++ settingsChanges |= UIstyle;
++ settings.style = (settings.style + 1) % NUM_GAME_STYLES;
++
++ // Avoid the LEVELS_ONLY option. There was no button before
++ // I got here. Avoiding the ability to set it until I
++ // discover why
++ settings.style += (settings.style == LEVELS_ONLY) ? 1 : 0;
+ }
+ }
+ }
+@@ -865,7 +859,7 @@
+ char *msg;
+ if (msg = locator->message_deq()) {
+ set_message(msg);
+- delete msg;
++ delete [] msg;
+ messageTimer.set(MESSAGE_TIME);
+ }
+ }
+@@ -930,7 +924,7 @@
UiP ui = (UiP)closure;
ui->settingsChanges |= UIenemiesRefill;
// SGI compiler says you can't cast void* to Boolean.
- Boolean val = (Boolean)(int)value;
-+ Boolean val = (Boolean)(intptr_t)value;
++ Boolean val = (Boolean)(long)value;
ui->settings.enemiesRefill = val;
}
-@@ -939,7 +940,7 @@
+@@ -939,7 +933,7 @@
void Ui::menu_controls_CB(void* value,Viewport* vPort,void* closure) {
UiP ui = (UiP)closure;
int dpyNum = vPort->get_dpy_num();
- Boolean val = (Boolean)(int)value;
-+ Boolean val = (Boolean)(intptr_t)value;
++ Boolean val = (Boolean)(long)value;
if (val) {
XMapWindow(ui->xvars.dpy[dpyNum],ui->xdata.controls[dpyNum]);
}
-@@ -955,7 +956,7 @@
+@@ -955,13 +949,13 @@
Viewport* vPort,void* closure) {
UiP ui = (UiP)closure;
int dpyNum = vPort->get_dpy_num();
- Boolean active = (Boolean)(int)value;
-+ Boolean active = (Boolean)(intptr_t)value;
++ Boolean active = (Boolean)(long)value;
if (active) {
ui->lControls[dpyNum].input = ui->lControls[dpyNum].key =
-@@ -994,7 +995,7 @@
+ ui->lControls[dpyNum].which = 0;
+
+- ostrstream str;
++ stringstream str;
+ str << "There are 2 sets of controls for the players on the right and"
+ << "\n"
+ << "left sides of the keyboard, respectively." << "\n"
+@@ -979,10 +973,9 @@
+ << " player enter the "
+ << (ui->lControls[dpyNum].which ? "second" : "first")
+ << " key for <" << ui->keysNames[ui->lControls[dpyNum].key]
+- << ">." << ends;
++ << ">.";
+
+- ui->learnControls[dpyNum]->set_message(str.str());
+- delete str.str();
++ ui->learnControls[dpyNum]->set_message(str.str().c_str());
+ XMapWindow(ui->xvars.dpy[dpyNum],ui->xdata.learnControls[dpyNum]);
+ }
+ else {
+@@ -994,7 +987,7 @@
void Ui::menu_scenarios_CB(void* value,Viewport*,void* closure) {
UiP ui = (UiP)closure;
- Boolean val = (Boolean)(int)value;
-+ Boolean val = (Boolean)(intptr_t)value;
++ Boolean val = (Boolean)(long)value;
if (val) {
ui->settingsChanges |= UIstyle;
ui->settings.style = SCENARIOS;
-@@ -1005,7 +1006,7 @@
+@@ -1005,7 +998,7 @@
void Ui::menu_levels_CB(void* value,Viewport*,void* closure) {
UiP ui = (UiP)closure;
- Boolean val = (Boolean)(int)value;
-+ Boolean val = (Boolean)(intptr_t)value;
++ Boolean val = (Boolean)(long)value;
if (val) {
ui->settingsChanges |= UIstyle;
ui->settings.style = LEVELS;
-@@ -1016,7 +1017,7 @@
+@@ -1016,7 +1009,7 @@
void Ui::menu_kill_CB(void* value,Viewport*,void* closure) {
UiP ui = (UiP)closure;
- Boolean val = (Boolean)(int)value;
-+ Boolean val = (Boolean)(intptr_t)value;
++ Boolean val = (Boolean)(long)value;
if (val) {
ui->settingsChanges |= UIstyle;
ui->settings.style = KILL;
-@@ -1027,7 +1028,7 @@
+@@ -1027,7 +1020,7 @@
void Ui::menu_duel_CB(void* value,Viewport*,void* closure) {
UiP ui = (UiP)closure;
- Boolean val = (Boolean)(int)value;
-+ Boolean val = (Boolean)(intptr_t)value;
++ Boolean val = (Boolean)(long)value;
if (val) {
ui->settingsChanges |= UIstyle;
ui->settings.style = DUEL;
-@@ -1038,7 +1039,7 @@
+@@ -1038,7 +1031,7 @@
void Ui::menu_extended_CB(void* value,Viewport*,void* closure) {
UiP ui = (UiP)closure;
- Boolean val = (Boolean)(int)value;
-+ Boolean val = (Boolean)(intptr_t)value;
++ Boolean val = (Boolean)(long)value;
if (val) {
ui->settingsChanges |= UIstyle;
ui->settings.style = EXTENDED;
-@@ -1049,7 +1050,7 @@
+@@ -1049,7 +1042,7 @@
void Ui::menu_training_CB(void* value,Viewport*,void* closure) {
UiP ui = (UiP)closure;
- Boolean val = (Boolean)(int)value;
-+ Boolean val = (Boolean)(intptr_t)value;
++ Boolean val = (Boolean)(long)value;
if (val) {
ui->settingsChanges |= UIstyle;
ui->settings.style = TRAINING;
-@@ -1070,7 +1071,7 @@
+@@ -1070,7 +1063,7 @@
void Ui::menu_cooperative_CB(void* value,Viewport*,void* closure) {
UiP ui = (UiP)closure;
ui->settingsChanges |= UIcooperative;
- Boolean val = (Boolean)(int)value;
-+ Boolean val = (Boolean)(intptr_t)value;
++ Boolean val = (Boolean)(long)value;
ui->settings.cooperative = val;
}
-@@ -1079,7 +1080,7 @@
+@@ -1079,7 +1072,7 @@
void Ui::menu_help_CB(void* value,Viewport* vPort,void* closure) {
UiP ui = (UiP)closure;
int dpyNum = vPort->get_dpy_num();
- Boolean active = (Boolean)(int)value;
-+ Boolean active = (Boolean)(intptr_t)value;
++ Boolean active = (Boolean)(long)value;
if (active) {
XMapWindow(ui->xvars.dpy[dpyNum],ui->xdata.help[dpyNum]);
-@@ -1094,7 +1095,7 @@
+@@ -1094,7 +1087,7 @@
void Ui::status_weapon_CB(void* value,Viewport* vPort,void*) {
// Some mouse controls.
// UiP ui = (UiP)closure;
- int button = (int)value;
-+ intptr_t button = (intptr_t)value;
++ long button = (long)value;
switch (button) {
case Button1:
-@@ -1113,7 +1114,7 @@
+@@ -1113,7 +1106,7 @@
void Ui::status_item_CB(void* value,Viewport* vPort,void*) {
// UiP ui = (UiP)closure;
- int button = (int)value;
-+ intptr_t button = (intptr_t)value;
++ long button = (long)value;
switch (button) {
case Button1:
+@@ -1167,14 +1160,14 @@
+ return;
+ }
+
+- ostrstream str;
++ stringstream str;
+ str << (ui->lControls[dpyNum].input ? "Left" : "Right")
+ << " player: The "
+ << (ui->lControls[dpyNum].which ? "second" : "first") << " key for <"
+ << ui->keysNames[ui->lControls[dpyNum].key] << "> is "
+ << XKeysymToString(XKeycodeToKeysym(ui->xvars.dpy[dpyNum],
+ event->xkey.keycode,0))
+- << "." << "\n" << "\n";
++ << ".\n\n";
+ ui->keycodes[dpyNum][ui->lControls[dpyNum].input]
+ [ui->lControls[dpyNum].key][ui->lControls[dpyNum].which] =
+ event->xkey.keycode;
+@@ -1222,21 +1215,18 @@
+ << " player enter the "
+ << (ui->lControls[dpyNum].which ? "second" : "first")
+ << " key for <" << keysNames[ui->lControls[dpyNum].key]
+- << ">." << ends;
++ << ">.";
+
+ // Add message in front of str.str().
+- ostrstream fullStr;
++ stringstream fullStr;
+ if (ui->lControls[dpyNum].input == UI_KEYS_LEFT) {
+ fullStr << "You may dismiss this dialog now if you only want to" << "\n"
+- << "set the controls for one player."
+- << "\n" << "\n";
++ << "set the controls for one player.\n\n";
+ }
+- fullStr << str.str() << ends;
+- delete str.str();
++ fullStr << str.str();
+
+
+- ui->learnControls[dpyNum]->set_message(fullStr.str());
+- delete fullStr.str();
++ ui->learnControls[dpyNum]->set_message(fullStr.str().c_str());
+
+ ui->controls_redraw(dpyNum);
+ }
+@@ -1537,7 +1527,7 @@
+ Line::set_text_columns(HELP_COLS);
+ Page page(NULL,helpMessage);
+ const PtrList& lines = page.get_lines();
+- ostrstream message;
++ stringstream message;
+ for (int n = 0; n < lines.length(); n++) {
+ Line* line = (Line*)lines.get(n);
+ char* text = line->alloc_text();
+@@ -1545,7 +1535,6 @@
+ message << text << '\n';
+ delete [] text;
+ }
+- message << ends;
+
+
+ for (int dpyNum = 0; dpyNum < xvars.dpyMax; dpyNum++) {
+@@ -1564,10 +1553,8 @@
+ new TextPanel(dpyNum,xvars,xdata.help[dpyNum],pos,size);
+ assert(help[dpyNum]);
+
+- help[dpyNum]->set_message(message.str());
++ help[dpyNum]->set_message(message.str().c_str());
+ } // dpyNum
+-
+- delete message.str();
+ }
+
+
+@@ -1621,7 +1608,7 @@
+ // Loop through all keys.
+ for (int n = 0; n < UI_KEYS_MAX; n++) {
+ // String for right side.
+- strstream str0;
++ stringstream str0;
+ str0 << keysNames[n] << ": " << XKeysymToString(keymaps[0][n][0][0]);
+ if (keymaps[0][n][0][1] && strlen(XKeysymToString(keymaps[0][n][0][1])))
+ str0 << ", " << XKeysymToString(keymaps[0][n][0][1]);
+@@ -1631,10 +1618,9 @@
+ && strlen(XKeysymToString(keymaps[0][n][1][1])))
+ str0 << ", " << XKeysymToString(keymaps[0][n][1][1]);
+ }
+- str0 << ends;
+
+ // String for left side.
+- strstream str1;
++ stringstream str1;
+ str1 << keysNames[n] << ": " << XKeysymToString(keymaps[1][n][0][0]);
+ if (keymaps[1][n][0][1] && strlen(XKeysymToString(keymaps[1][n][0][1]))) {
+ str1 << ", " << XKeysymToString(keymaps[1][n][0][1]);
+@@ -1645,7 +1631,6 @@
+ && strlen(XKeysymToString(keymaps[1][n][1][1])))
+ str1 << ", " << XKeysymToString(keymaps[1][n][1][1]);
+ }
+- str1 << ends;
+
+ // Draw key on left side.
+ if (n != IT_CHAT) { // Chat meaningless for left player.
+@@ -1653,16 +1638,14 @@
+ xvars.fontSize[dpyNum].width,
+ xvars.font[dpyNum]->max_bounds.ascent
+ + p * xvars.fontSize[dpyNum].height,
+- str1.str(),strlen(str1.str()));
++ str1.str().c_str(),str1.str().length());
+ }
+ // Draw on right side.
+ XDrawString(xvars.dpy[dpyNum],xdata.controls[dpyNum],xvars.gc[dpyNum],
+ xvars.fontSize[dpyNum].width * (CONTROLS_COLS / 2 + 1),
+ xvars.font[dpyNum]->max_bounds.ascent
+ + (p++) * xvars.fontSize[dpyNum].height,
+- str0.str(),strlen(str0.str()));
+- delete str0.str();
+- delete str1.str();
++ str0.str().c_str(),str0.str().length());
+ }
+ p++;
+
+@@ -1693,7 +1676,7 @@
+
+
+
+-char *Ui::keysNames[UI_KEYS_MAX] = {
++const char *Ui::keysNames[UI_KEYS_MAX] = {
+ "center",
+ "right",
+ "down_right",
+@@ -1752,7 +1735,7 @@
+
+
+
+-char* Ui::helpMessage =
++const char* Ui::helpMessage =
+ "For full instructions, including NETWORK PLAY, see "
+ "http://www.xevil.com/docs/instructions.html\n"
+ "\n"
diff --git a/games/xevil/files/patch-x11::viewport.cpp b/games/xevil/files/patch-x11::viewport.cpp
index 6aeef5d4d29f..774b267e3e00 100644
--- a/games/xevil/files/patch-x11::viewport.cpp
+++ b/games/xevil/files/patch-x11::viewport.cpp
@@ -1,21 +1,294 @@
---- x11/viewport.cpp.orig 2000-01-19 12:54:14.000000000 +0100
-+++ x11/viewport.cpp 2007-07-31 15:59:37.000000000 +0200
-@@ -44,7 +44,8 @@
+--- x11/viewport.cpp.orig 2012-05-27 06:52:29.000000000 +0900
++++ x11/viewport.cpp 2012-05-27 06:52:59.000000000 +0900
+@@ -44,8 +44,9 @@
#include <X11/Xos.h>
#include <X11/keysym.h>
}
-#include <strstream.h>
-+#include <strstream>
-+using namespace std;
++#include <sstream>
++using namespace std;
#define TICK_BORDER_WIDTH 5 // border width big enough for a tick mark.
-@@ -1632,7 +1633,7 @@
+ #define TICK_WIDTH 3
+@@ -60,14 +61,14 @@
+ #define COL_SHIFT 4
+
+ // Number of characters across for each menu button.
+-#define QUIT_LINE_LENGTH 5
+-#define NEW_GAME_LINE_LENGTH 9
++#define QUIT_LINE_LENGTH 4
++#define NEW_GAME_LINE_LENGTH 13
+ #define HUMANS_NUM_LINE_LENGTH 9
+ #define ENEMIES_NUM_LINE_LENGTH 11
+ #define ENEMIES_REFILL_LINE_LENGTH 13
+ #define CONTROLS_LINE_LENGTH 13
+ #define LEARN_CONTROLS_LINE_LENGTH 12
+-#define STYLE_LINE_LENGTH 11
++#define STYLE_LINE_LENGTH 16
+ #define SCENARIOS_LINE_LENGTH 9
+ #define LEVELS_LINE_LENGTH 6
+ #define KILL_LINE_LENGTH 16
+@@ -1056,20 +1057,18 @@
+
+ void Viewport::set_menu_humans_num(int val) {
+ assert(menusNum > menuHumansNum);
+- ostrstream str;
+- str << val << ends;
+- ((WritePanel *)menus[menuHumansNum])->set_value(str.str());
+- delete str.str();
++ stringstream str;
++ str << val;
++ ((WritePanel *)menus[menuHumansNum])->set_value(str.str().c_str());
+ }
+
+
+
+ void Viewport::set_menu_enemies_num(int val) {
+ assert(menusNum > menuEnemiesNum);
+- ostrstream str;
+- str << val << ends;
+- ((WritePanel *)menus[menuEnemiesNum])->set_value(str.str());
+- delete str.str();
++ stringstream str;
++ str << val;
++ ((WritePanel *)menus[menuEnemiesNum])->set_value(str.str().c_str());
+ }
+
+
+@@ -1128,10 +1127,9 @@
+
+ void Viewport::set_quanta(Quanta quanta) {
+ assert(menusNum > menuQuanta);
+- ostrstream str;
+- str << quanta << ends;
+- ((WritePanel *)menus[menuQuanta])->set_value(str.str());
+- delete str.str();
++ stringstream str;
++ str << quanta;
++ ((WritePanel *)menus[menuQuanta])->set_value(str.str().c_str());
+ }
+
+
+@@ -1144,33 +1142,27 @@
+
+
+ void Viewport::set_humans_playing(int val) {
+- ostrstream msg;
++ stringstream msg;
+ if (val == 1) {
+- msg << "1 Human" << ends;
++ msg << "1 Human";
+ }
+ else {
+- msg << val << " Humans" << ends;
++ msg << val << " Humans";
+ }
+- char *msg_str = msg.str();
+-
+- humansPlaying->set_message(msg_str);
+- delete msg_str;
++ humansPlaying->set_message(msg.str().c_str());
+ }
+
+
+
+ void Viewport::set_enemies_playing(int val) {
+- ostrstream msg;
++ stringstream msg;
+ if (val == 1) {
+- msg << "1 Enemy" << ends;
++ msg << "1 Enemy";
+ }
+ else {
+- msg << val << " Enemies" << ends;
++ msg << val << " Enemies";
+ }
+- char *msg_str = msg.str();
+-
+- enemiesPlaying->set_message(msg_str);
+- delete msg_str;
++ enemiesPlaying->set_message(msg.str().c_str());
+ }
+
+
+@@ -1632,7 +1624,7 @@
// Would be much better to put the radio-button logic in the Panel classes.
if (pClosure->radio) {
// SGI compiler says you can't cast void* to Boolean.
- Boolean bValue = (Boolean)(int)value;
-+ Boolean bValue = (Boolean)(intptr_t)value;
++ Boolean bValue = (Boolean)(long)value;
if (!bValue) {
((TogglePanel*)panel)->set_value(True);
}
+@@ -1701,7 +1693,7 @@
+ pos.y += xvars.fontSize[dpyNum].height;
+
+ for (int n = 0; n < DIFFICULTY_LEVELS_NUM; n++) {
+- ostrstream str;
++ stringstream str;
+ str << "[" << n;
+ if (n == DIFF_NORMAL) {
+ str << ",space] ";
+@@ -1709,10 +1701,9 @@
+ else {
+ str << "] ";
+ }
+- str << difficultyLevels[n].name << ends;
++ str << difficultyLevels[n].name;
+ pos.y += xvars.fontSize[dpyNum].height;
+- draw_string(pos,str.str());
+- delete str.str();
++ draw_string(pos,str.str().c_str());
+ }
+
+ XSetForeground(xvars.dpy[dpyNum],xvars.gc[dpyNum],
+@@ -1733,7 +1724,7 @@
+
+
+
+-void Viewport::draw_string(const Pos &pos,char *msg) {
++void Viewport::draw_string(const Pos &pos,const char *msg) {
+ XDrawString(xvars.dpy[dpyNum],arena,
+ xvars.gc[dpyNum],
+ pos.x,pos.y + xvars.font[dpyNum]->max_bounds.ascent,
+@@ -1930,7 +1921,7 @@
+ new ButtonPanel(dpyNum,xvars,toplevel,
+ pos,newGameUnit,
+ Viewport::panel_callback,panelClosures.get(menuNewGame),
+- "New Game");
++ "New Game (F2)");
+ assert(p);
+ p->set_background(menuBg,False);
+ pos.x += newGameUnit.width;
+@@ -2016,7 +2007,7 @@
+ new TextPanel(dpyNum,xvars,toplevel,
+ pos,styleUnit,
+ NULL,NULL,
+- "Game style:");
++ "Game style: (F3)");
+ assert(p);
+ // p->set_background(menuBg,False);
+ pos.x += styleUnit.width;
+@@ -2194,33 +2185,24 @@
+ }
+
+ const IntelStatus *status = intel->get_intel_status();
++ statuses[statusName]->set_message(status->name);
++
++ statuses[statusClassName]->set_message(status->className);
+
+- ostrstream name;
+- name << status->name << ends;
+- statuses[statusName]->set_message(name.str());
+- delete name.str();
+-
+- ostrstream className;
+- className << status->className << ends;
+- statuses[statusClassName]->set_message(className.str());
+- delete className.str();
+-
+- ostrstream health;
++ stringstream health;
+ if (status->health == -1) {
+- health << "Dead" << ends;
++ health << "Dead";
+ }
+ else {
+- health << status->health << " Health" << ends;
++ health << status->health << " Health";
+ }
+- statuses[statusHealth]->set_message(health.str());
+- delete health.str();
++ statuses[statusHealth]->set_message(health.str().c_str());
+
+- ostrstream mass;
+- mass << status->mass << " Mass" << ends;
+- statuses[statusMass]->set_message(mass.str());
+- delete mass.str();
++ stringstream mass;
++ mass << status->mass << " Mass";
++ statuses[statusMass]->set_message(mass.str().c_str());
+
+- ostrstream weapon;
++ stringstream weapon;
+ if (status->weaponClassId == A_None) {
+ weapon << "No Weapon";
+ }
+@@ -2230,62 +2212,56 @@
+ if (status->ammo != PH_AMMO_UNLIMITED) {
+ weapon << " (" << status->ammo << ")";
+ }
+- weapon << ends;
+ statuses[statusWeapon]->
+ set_foreground(status->weaponReady ?
+ xvars.green[dpyNum] : xvars.red[dpyNum],False);
+- statuses[statusWeapon]->set_message(weapon.str());
+- delete weapon.str();
++ statuses[statusWeapon]->set_message(weapon.str().c_str());
+
+- ostrstream item;
++ stringstream item;
+ if (status->itemClassId == A_None) {
+ item << "No Item";
+ }
+ else {
+ item << status->item << " (" << status->itemCount << ")";
+ }
+- item << ends;
+- statuses[statusItem]->set_message(item.str());
+- delete item.str();
++ statuses[statusItem]->set_message(item.str().c_str());
+
+- ostrstream livesHKills;
++ stringstream livesHKills;
+ if (styleInfo->get_game_style_type() == EXTENDED) {
+ // Takes soups into account.
+ livesHKills << (status->humanKills - status->soups)
+- << " Human Kills" << ends;
++ << " Human Kills";
+ }
+ else {
+ if (status->lives == IT_INFINITE_LIVES) {
+ // Does this case ever happen? I don't think so.
+- livesHKills << "Unlimited Lives" << ends;
++ livesHKills << "Unlimited Lives";
+ }
+ else {
+ if (status->lives == 1) {
+- livesHKills << "1 Life" << ends;
++ livesHKills << "1 Life";
+ }
+ else {
+- livesHKills << status->lives << " Lives" << ends;
++ livesHKills << status->lives << " Lives";
+ }
+ }
+ }
+- statuses[statusLivesHKills]->set_message(livesHKills.str());
+- delete livesHKills.str();
++ statuses[statusLivesHKills]->set_message(livesHKills.str().c_str());
+
+- ostrstream killsMKills;
++ stringstream killsMKills;
+ if (styleInfo->get_game_style_type() == EXTENDED) {
+- killsMKills << status->enemyKills << " Machine Kills" << ends;
++ killsMKills << status->enemyKills << " Machine Kills";
+ }
+ else {
+ int kills = status->humanKills + status->enemyKills;
+ if (kills == 1) {
+- killsMKills << "1 Kill" << ends;
++ killsMKills << "1 Kill";
+ }
+ else {
+- killsMKills << kills << " Kills" << ends;
++ killsMKills << kills << " Kills";
+ }
+ }
+- statuses[statusKillsMKills]->set_message(killsMKills.str());
+- delete killsMKills.str();
++ statuses[statusKillsMKills]->set_message(killsMKills.str().c_str());
+ }
+
+
diff --git a/games/xevil/files/patch-x11::xdata.cpp b/games/xevil/files/patch-x11::xdata.cpp
index 71a6cf73e5b3..fd1052042688 100644
--- a/games/xevil/files/patch-x11::xdata.cpp
+++ b/games/xevil/files/patch-x11::xdata.cpp
@@ -1,12 +1,101 @@
---- x11/xdata.cpp.orig Wed Jan 19 12:54:14 2000
-+++ x11/xdata.cpp Sat Oct 25 21:49:26 2003
-@@ -30,7 +30,8 @@
+--- x11/xdata.cpp.orig 2012-05-27 06:52:29.000000000 +0900
++++ x11/xdata.cpp 2012-05-27 06:52:59.000000000 +0900
+@@ -1,4 +1,5 @@
+ /*
++ * WK - note to self - search for xpmcreate
+ * XEvil(TM) Copyright (C) 1994,2000 Steve Hardt and Michael Judge
+ * http://www.xevil.com
+ * satan@xevil.com
+@@ -30,11 +31,12 @@
#include "xdata.h"
#include "area.h"
-#include <iostream.h>
+#include <iostream>
-+using namespace std;
#include <X11/Xutil.h>
#include <X11/xpm.h>
#include <X11/Xatom.h>
+
++using namespace std;
+
+
+ // Means always allocate some color, even if it's really, really bad.
+@@ -47,9 +49,16 @@
+ int dpyNum,const Size& size,
+ const char* title,
+ long eventMask) {
++
++ // Get Size of screen, so we can center Window
++ XWindowAttributes root_window_attributes;
++ XGetWindowAttributes(dpy[dpyNum],root[dpyNum], &root_window_attributes);
++ int left = (root_window_attributes.width - size.width) / 2;
++ int top = (root_window_attributes.height - size.height) / 3;
++
+ // Creates with 0 border width.
+ Window toplevel =
+- XCreateSimpleWindow(dpy[dpyNum],root[dpyNum],0,0,
++ XCreateSimpleWindow(dpy[dpyNum],root[dpyNum],left,top,
+ size.width,size.height,
+ 0,windowBorder[dpyNum],
+ windowBg[dpyNum]);
+@@ -90,7 +99,9 @@
+
+ XClassHint class_hints;
+ class_hints.res_name = argv[0];
+- class_hints.res_class = "XEvil";
++
++ static char res_class[] = "XEvil";
++ class_hints.res_class = res_class;
+
+ XSetWMProperties(dpy[dpyNum],toplevel,
+ &windowName,&iconName,argv,argc,
+@@ -185,14 +196,14 @@
+
+
+ Boolean Xvars::load_pixmap(Drawable* pixmap,Drawable* mask,
+- int dpyNum,char** xpmBits) {
++ int dpyNum, const char** xpmBits) {
+ return load_pixmap(pixmap,mask,dpyNum,xpmBits,is_stretched());
+ }
+
+
+
+ Boolean Xvars::load_pixmap(Drawable* pixmap,Drawable* mask,
+- int dpyNum,char** xpmBits,Boolean fullSize) {
++ int dpyNum, const char** xpmBits,Boolean fullSize) {
+ // Just load XPM as is.
+ if (fullSize) {
+ XpmAttributes attr;
+@@ -200,9 +211,9 @@
+ attr.closeness = XPM_CLOSENESS;
+ attr.alloc_close_colors = True;
+
+- int val =
++ int val =
+ XpmCreatePixmapFromData(dpy[dpyNum],root[dpyNum],
+- xpmBits,
++ const_cast<char **> (xpmBits),
+ pixmap,mask,
+ &attr);
+ XpmFreeAttributes(&attr);
+@@ -212,7 +223,7 @@
+ ret = False;
+ }
+
+- return ret;
++ return ret;
+ }
+
+
+@@ -231,9 +242,8 @@
+
+ // Perhaps should use XpmReturnAllocPixels, neither gives the transparent
+ // value.
+- int val =
+- XpmCreateImageFromData(dpy[dpyNum],
+- xpmBits,
++ int val = XpmCreateImageFromData(dpy[dpyNum],
++ const_cast<char **> (xpmBits),
+ &srcImage,(mask ? &srcMask : (XImage**)NULL),
+ &attr);
+ srcSize.width = attr.width;
diff --git a/games/xevil/files/patch-x11__draw.cpp b/games/xevil/files/patch-x11__draw.cpp
new file mode 100644
index 000000000000..816c5aabb9cc
--- /dev/null
+++ b/games/xevil/files/patch-x11__draw.cpp
@@ -0,0 +1,100 @@
+--- x11/draw.cpp.orig 2012-05-27 06:52:29.000000000 +0900
++++ x11/draw.cpp 2012-05-27 06:52:59.000000000 +0900
+@@ -34,6 +34,7 @@
+ // in Xvars instead.
+ #include "viewport.h"
+
++using namespace std;
+
+
+ // Draw functions for World
+@@ -327,7 +328,7 @@
+ Boolean val =
+ xvars.load_pixmap(&xdata.blockPixmaps[dpyNum][n],
+ mask,dpyNum,
+- (char**)blocksBits[n]);
++ (const char**)blocksBits[n]);
+ if (!val) {
+ cerr << "Failed to load block " << n << endl;
+ }
+@@ -352,7 +353,7 @@
+ Boolean val =
+ xvars.load_pixmap(&xdata.posterPixmaps[dpyNum][n],
+ &xdata.posterMasks[dpyNum][n],
+- dpyNum,(char**)posters[n].id);
++ dpyNum,(const char**)posters[n].id);
+ if (!val) {
+ cerr << "Failed to load poster " << n << endl;
+ }
+@@ -363,7 +364,7 @@
+ for (n = 0; n < W_ALL_DOORS_NUM; n++) {
+ Boolean val =
+ xvars.load_pixmap(&xdata.doorPixmaps[dpyNum][n],NULL,dpyNum,
+- (char**)doorPixmapBits[n]);
++ (const char**)doorPixmapBits[n]);
+ if (!val) {
+ cerr << "Failed to load door block " << n << endl;
+ }
+@@ -376,7 +377,7 @@
+ xvars.load_pixmap(&xdata.moverSquarePixmaps[dpyNum][n],
+ &xdata.moverSquareMasks[dpyNum][n],
+ dpyNum,
+- (char**)moverSquarePixmapBits[n]);
++ (const char**)moverSquarePixmapBits[n]);
+ if (!val) {
+ cerr << "Failed to mover square " << n << endl;
+ }
+@@ -400,7 +401,7 @@
+ xvars.load_pixmap(&xdata.moverPixmaps[dpyNum][n],
+ &xdata.moverMasks[dpyNum][n],
+ dpyNum,
+- (char**)moverPixmapBits[n]);
++ (const char**)moverPixmapBits[n]);
+ if (!val) {
+ cerr << "Failed to load mover " << n << endl;
+ }
+@@ -411,7 +412,7 @@
+ for (n = 0; n < W_ALL_BACKGROUNDS_NUM; n++) {
+ Boolean val =
+ xvars.load_pixmap(&xdata.backgroundPixmaps[dpyNum][n],NULL,dpyNum,
+- (char**)backgrounds[n].id);
++ (const char**)backgrounds[n].id);
+ if (!val) {
+ cerr << "Failed to load background " << n << endl;
+ }
+@@ -422,7 +423,7 @@
+ for (n = 0; n < W_ALL_OUTSIDES_NUM; n++) {
+ Boolean val =
+ xvars.load_pixmap(&xdata.outsidePixmaps[dpyNum][n],NULL,dpyNum,
+- (char**)outsides[n].id);
++ (const char**)outsides[n].id);
+ if (!val) {
+ cerr << "Failed to load outside " << n << endl;
+ }
+@@ -689,7 +690,7 @@
+ assert(tickPixmapBits[tt][hp] != PH_AUTO_GEN);
+ xvars.load_pixmap(&xdata.tickPixmaps[dpyNum][tt][hp],
+ &xdata.tickMasks[dpyNum][tt][hp],
+- dpyNum,(char**)tickPixmapBits[tt][hp]);
++ dpyNum,(const char**)tickPixmapBits[tt][hp]);
+ }
+ }
+ }
+@@ -1020,7 +1021,7 @@
+ for (dpyNum = 0; dpyNum < xvars.dpyMax; dpyNum++) {
+ Boolean val = xvars.load_pixmap(&xdata.pixmap[dpyNum],
+ &xdata.mask[dpyNum],
+- dpyNum,(char**)fireBits);
++ dpyNum,(const char**)fireBits);
+ if (!val) {
+ cerr << "Failed to load fire graphics." << endl;
+ }
+@@ -1292,7 +1293,7 @@
+ Boolean val =
+ xvars.load_pixmap(&movingXdata.pixmaps[dpyNum][n][m],
+ &movingXdata.masks[dpyNum][n][m],
+- dpyNum,(char**)mc.pixmapBits[n][m]);
++ dpyNum,(const char**)mc.pixmapBits[n][m]);
+ if (!val) {
+ cerr << "load_pixmap() failed for "
+ << mc.physicalContext.className
diff --git a/games/xevil/files/patch-x11__ui.h b/games/xevil/files/patch-x11__ui.h
new file mode 100644
index 000000000000..3e170cf8a198
--- /dev/null
+++ b/games/xevil/files/patch-x11__ui.h
@@ -0,0 +1,20 @@
+--- x11/ui.h.orig 2012-05-27 06:52:31.000000000 +0900
++++ x11/ui.h 2012-05-27 06:52:59.000000000 +0900
+@@ -338,7 +338,7 @@
+
+
+ // Variables.
+- static char *keysNames[UI_KEYS_MAX];
++ static const char *keysNames[UI_KEYS_MAX];
+
+ char **argv; // Warning: Exposing the rep.
+ int argc;
+@@ -402,7 +402,7 @@
+ // The callbacks to export to the Viewport.
+ static ViewportCallback viewportCallbacks[VIEWPORT_CB_NUM];
+
+- static char* helpMessage;
++ static const char* helpMessage;
+ };
+
+ #endif
diff --git a/games/xevil/files/patch-x11__viewport.h b/games/xevil/files/patch-x11__viewport.h
new file mode 100644
index 000000000000..e918e8394a1e
--- /dev/null
+++ b/games/xevil/files/patch-x11__viewport.h
@@ -0,0 +1,11 @@
+--- x11/viewport.h.orig 2012-05-27 06:52:31.000000000 +0900
++++ x11/viewport.h 2012-05-27 06:52:59.000000000 +0900
+@@ -348,7 +348,7 @@
+ /* NOTE: Will draw everything if redrawArena is true, else just what has
+ changed. */
+
+- void draw_string(const Pos &pos,char *msg);
++ void draw_string(const Pos &pos,const char *msg);
+ /* EFFECTS: Draw string msg using current GC on arena with upper left of
+ character at position pos. */
+
diff --git a/games/xevil/files/patch-x11__xdata.h b/games/xevil/files/patch-x11__xdata.h
new file mode 100644
index 000000000000..4b4e40557f1e
--- /dev/null
+++ b/games/xevil/files/patch-x11__xdata.h
@@ -0,0 +1,28 @@
+--- x11/xdata.h.orig 2012-05-27 06:52:31.000000000 +0900
++++ x11/xdata.h 2012-05-27 06:52:58.000000000 +0900
+@@ -74,7 +74,7 @@
+
+ typedef XEvent *CMN_EVENTDATA;
+
+-typedef char *CMN_COLOR;
++typedef const char *CMN_COLOR;
+
+
+
+@@ -132,14 +132,14 @@
+ transformations. Use scratch for all scratch calculations. */
+
+ Boolean load_pixmap(Drawable* pixmap,Drawable* mask,
+- int dpyNum,char** xpmBits);
++ int dpyNum, const char** xpmBits);
+ /* MODIFIES: pixmap, mask */
+ /* EFFECTS: Load an XPM pixmap and mask from xpmBits. Only load mask if
+ non-NULL. Reduce pixmap size by a factor of 2 if
+ !xvars.is_stretched(). */
+
+ Boolean load_pixmap(Drawable* pixmap,Drawable* mask,
+- int dpyNum,char** xpmBits,Boolean fullSize);
++ int dpyNum, const char** xpmBits,Boolean fullSize);
+ /* EFFECTS: Same as above load_pixmap() except caller explicitly
+ specifies whether pixmap is fullSize or reduced by a factor of 2. */
+ /* NOTE: This method can be called before Xvars::stretch is set. */
diff --git a/games/xevil/pkg-descr b/games/xevil/pkg-descr
index 36482349b77a..b7c7dfce94c1 100644
--- a/games/xevil/pkg-descr
+++ b/games/xevil/pkg-descr
@@ -8,7 +8,4 @@ player, for example, may spend the rest of time as "Satan's Earwax
Remover", while a good one might achieve a prestigious title such as
"VP of Hell Marketing" or even "Lead Software Engineer of Hell".
-The XEvil 2.X Instruction Manual is located in
-/usr/X11R6/share/doc/xevil/instructions
-
WWW: http://www.xevil.com/
diff --git a/games/xevil/pkg-plist b/games/xevil/pkg-plist
deleted file mode 100644
index 9793171f97d2..000000000000
--- a/games/xevil/pkg-plist
+++ /dev/null
@@ -1,10 +0,0 @@
-bin/xevil
-%%PORTDOCS%%%%DOCSDIR%%/instructions/UNIXSetControls.gif
-%%PORTDOCS%%%%DOCSDIR%%/instructions/UNIXShowControls.gif
-%%PORTDOCS%%%%DOCSDIR%%/instructions/UNIXmenu.gif
-%%PORTDOCS%%%%DOCSDIR%%/instructions/instructions.html
-%%PORTDOCS%%%%DOCSDIR%%/instructions/keysdlg.gif
-%%PORTDOCS%%%%DOCSDIR%%/instructions/optionsdlg.gif
-%%PORTDOCS%%%%DOCSDIR%%/readme.txt
-%%PORTDOCS%%@dirrm %%DOCSDIR%%/instructions
-%%PORTDOCS%%@dirrm %%DOCSDIR%%