You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(47) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(140) |
Feb
(98) |
Mar
(152) |
Apr
(104) |
May
(71) |
Jun
(94) |
Jul
(169) |
Aug
(83) |
Sep
(47) |
Oct
(134) |
Nov
(7) |
Dec
(20) |
2004 |
Jan
(41) |
Feb
(14) |
Mar
(42) |
Apr
(47) |
May
(68) |
Jun
(143) |
Jul
(65) |
Aug
(29) |
Sep
(40) |
Oct
(34) |
Nov
(33) |
Dec
(97) |
2005 |
Jan
(29) |
Feb
(30) |
Mar
(9) |
Apr
(37) |
May
(13) |
Jun
(31) |
Jul
(22) |
Aug
(23) |
Sep
|
Oct
(37) |
Nov
(34) |
Dec
(117) |
2006 |
Jan
(48) |
Feb
(6) |
Mar
(2) |
Apr
(71) |
May
(10) |
Jun
(16) |
Jul
(7) |
Aug
(1) |
Sep
(14) |
Oct
(17) |
Nov
(25) |
Dec
(26) |
2007 |
Jan
(8) |
Feb
(2) |
Mar
(7) |
Apr
(26) |
May
|
Jun
(12) |
Jul
(30) |
Aug
(14) |
Sep
(9) |
Oct
(4) |
Nov
(7) |
Dec
(6) |
2008 |
Jan
(10) |
Feb
(10) |
Mar
(6) |
Apr
(8) |
May
|
Jun
(10) |
Jul
(18) |
Aug
(15) |
Sep
(16) |
Oct
(5) |
Nov
(3) |
Dec
(10) |
2009 |
Jan
(11) |
Feb
(2) |
Mar
|
Apr
(15) |
May
(31) |
Jun
(18) |
Jul
(11) |
Aug
(26) |
Sep
(52) |
Oct
(17) |
Nov
(4) |
Dec
|
2010 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <sv...@ww...> - 2005-12-19 05:29:31
|
Author: mkrose Date: 2005-12-18 21:29:22 -0800 (Sun, 18 Dec 2005) New Revision: 1778 Modified: trunk/CSP/csp/csplib/data/InterfaceRegistry.h trunk/CSP/csp/csplib/net/ReliablePacket.h trunk/CSP/csp/csplib/util/HashUtility.h trunk/CSP/csp/cspsim/battlefield/GlobalBattlefield.h Log: More export sugar and ref cleanups. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1778 Modified: trunk/CSP/csp/csplib/data/InterfaceRegistry.h =================================================================== --- trunk/CSP/csp/csplib/data/InterfaceRegistry.h 2005-12-19 05:18:51 UTC (rev 1777) +++ trunk/CSP/csp/csplib/data/InterfaceRegistry.h 2005-12-19 05:29:22 UTC (rev 1778) @@ -47,7 +47,7 @@ * class at startup. Interfaces can be accessed by name to provide dynamic object * creation and variable assignment. See @ref InterfaceDetails for details. */ -class InterfaceRegistry: public Singleton<InterfaceRegistry> { +class CSPLIB_EXPORT InterfaceRegistry: public Singleton<InterfaceRegistry> { friend class Singleton<InterfaceRegistry>; friend class InterfaceProxy; Modified: trunk/CSP/csp/csplib/net/ReliablePacket.h =================================================================== --- trunk/CSP/csp/csplib/net/ReliablePacket.h 2005-12-19 05:18:51 UTC (rev 1777) +++ trunk/CSP/csp/csplib/net/ReliablePacket.h 2005-12-19 05:29:22 UTC (rev 1778) @@ -49,8 +49,6 @@ std::string m_PacketData; public: - typedef Ref<ReliablePacket> Ref; - /** Construct an empty instance; use assign to initialize it. */ ReliablePacket(): m_Id(0), m_Confirmed(true), m_Attempts(0), m_NextTime(0.0) { } @@ -128,8 +126,8 @@ /** Functor used to order reliable packets in a priority queue by the * scheduled time for the next retry attempt. */ - struct Order : public std::binary_function<Ref, Ref, bool> { - inline bool operator()(const Ref& __x, const Ref& __y) const { + struct Order : public std::binary_function<Ref<ReliablePacket>, Ref<ReliablePacket>, bool> { + inline bool operator()(const Ref<ReliablePacket>& __x, const Ref<ReliablePacket>& __y) const { return __x->nextTime() > __y->nextTime(); } }; Modified: trunk/CSP/csp/csplib/util/HashUtility.h =================================================================== --- trunk/CSP/csp/csplib/util/HashUtility.h 2005-12-19 05:18:51 UTC (rev 1777) +++ trunk/CSP/csp/csplib/util/HashUtility.h 2005-12-19 05:29:22 UTC (rev 1778) @@ -243,7 +243,7 @@ }; -extern std::ostream & operator<<(std::ostream &o, const hasht &x); +extern CSPLIB_EXPORT std::ostream & operator<<(std::ostream &o, const hasht &x); // 32-bit fingerprint functions. Modified: trunk/CSP/csp/cspsim/battlefield/GlobalBattlefield.h =================================================================== --- trunk/CSP/csp/cspsim/battlefield/GlobalBattlefield.h 2005-12-19 05:18:51 UTC (rev 1777) +++ trunk/CSP/csp/cspsim/battlefield/GlobalBattlefield.h 2005-12-19 05:29:22 UTC (rev 1778) @@ -50,7 +50,6 @@ class UnitContact: public SimObject { Path m_Path; public: - typedef Ref<UnitContact> Ref; UnitContact(SimObject::TypeId type, Path const &path, SimObject::ObjectId id): SimObject(type), m_Path(path) { setId(id); setContact(); @@ -71,20 +70,19 @@ class GlobalBattlefield: public Battlefield { unsigned int m_NextId; - typedef PeerId PeerId; typedef std::map<PeerId, ClientData> ClientDataMap; template <class MSG> class ClientResponse { - typename MSG::Ref m_Response; + Ref<MSG> m_Response; public: - ClientResponse(NetworkMessage::Ref const &request): m_Response(new MSG()) { + ClientResponse(Ref<NetworkMessage> const &request): m_Response(new MSG()) { m_Response->setReplyTo(request); m_Response->setReliable(); m_Response->setRoutingType(ROUTE_COMMAND); } - inline typename MSG::Ref const &operator->() { return m_Response; } - inline void send(MessageQueue::Ref const &queue) { + inline Ref<MSG> const &operator->() { return m_Response; } + inline void send(Ref<MessageQueue> const &queue) { queue->queueMessage(m_Response); } }; @@ -99,7 +97,7 @@ public: ContactWrapper(Unit const &u, PeerId owner): UnitWrapper(u, owner) { } ContactWrapper(ObjectId id, Path const &path, PeerId owner): UnitWrapper(id, path, owner) { } - UnitContact::Ref contact() { return static_cast<UnitContact*>(object().get()); } + Ref<UnitContact> contact() { return static_cast<UnitContact*>(object().get()); } inline bool isUpdating(int peer) { return m_UpdateCount.find(peer) != m_UpdateCount.end(); } @@ -145,7 +143,7 @@ assert(m_NetworkServer.isNull()); assert(server.valid()); m_NetworkServer = server; - DispatchHandler::Ref dispatch = new DispatchHandler(server->queue()); + Ref<DispatchHandler> dispatch = new DispatchHandler(server->queue()); bindCommandDispatch(dispatch); server->routeToHandler(ROUTE_COMMAND, dispatch); } @@ -174,22 +172,22 @@ announceExit(id); } - void sendClientCommand(NetworkMessage::Ref const &command, PeerId client_id) { + void sendClientCommand(Ref<NetworkMessage> const &command, PeerId client_id) { command->setDestination(client_id); command->setRoutingType(ROUTE_COMMAND); command->setReliable(); m_NetworkServer->queue()->queueMessage(command, client_id); } - void bindCommandDispatch(DispatchHandler::Ref const &dispatch) { + void bindCommandDispatch(Ref<DispatchHandler> const &dispatch) { dispatch->registerHandler(this, &GlobalBattlefield::onJoinRequest); dispatch->registerHandler(this, &GlobalBattlefield::onIdAllocationRequest); dispatch->registerHandler(this, &GlobalBattlefield::onNotifyUnitMotion); dispatch->registerHandler(this, &GlobalBattlefield::onRegisterUnit); } - PlayerJoin::Ref makeJoin(const PeerId id, bool local) { - PlayerJoin::Ref join = new PlayerJoin(); + Ref<PlayerJoin> makeJoin(const PeerId id, bool local) { + Ref<PlayerJoin> join = new PlayerJoin(); join->setRoutingType(ROUTE_COMMAND); join->setReliable(); ClientData &data = m_ClientData[id]; @@ -205,22 +203,22 @@ void announceJoin(const PeerId id) { ClientData &new_client_data = m_ClientData[id]; - PlayerJoin::Ref local_join = makeJoin(id, true); - PlayerJoin::Ref remote_join = makeJoin(id, false); + Ref<PlayerJoin> local_join = makeJoin(id, true); + Ref<PlayerJoin> remote_join = makeJoin(id, false); for (ClientDataMap::const_iterator iter = m_ClientData.begin(); iter != m_ClientData.end(); ++iter) { // don't announce to ourself if (iter->first == id) continue; // if the external ips match, these hosts are probably on a LAN and should communicate via their // internal interfaces; otherwise use the external ip. - PlayerJoin::Ref join; + Ref<PlayerJoin> join; bool local = (iter->second.external_ip_addr == new_client_data.external_ip_addr); m_NetworkServer->queue()->queueMessage(local ? local_join : remote_join, iter->first); } } void announceExit(const PeerId id) { - PlayerQuit::Ref msg = new PlayerQuit(); + Ref<PlayerQuit> msg = new PlayerQuit(); msg->setRoutingType(ROUTE_COMMAND); msg->set_peer_id(id); for (ClientDataMap::const_iterator iter = m_ClientData.begin(); iter != m_ClientData.end(); ++iter) { @@ -237,7 +235,7 @@ const PeerId id = iter->first; if (id == new_id) continue; bool local = (iter->second.external_ip_addr == new_client_data.external_ip_addr); - PlayerJoin::Ref join = makeJoin(id, local); + Ref<PlayerJoin> join = makeJoin(id, local); m_NetworkServer->queue()->queueMessage(join, new_id); } } @@ -472,7 +470,7 @@ if (from->owner() != to->owner()) { CSPLOG(INFO, BATTLEFIELD) << "sending add unit " << from->unit()->id() << " to client " << to->owner(); { // tell OWNER[to] to expect updates from OWNER[from] - CommandAddUnit::Ref msg = new CommandAddUnit(); + Ref<CommandAddUnit> msg = new CommandAddUnit(); msg->set_unit_id(from->id()); msg->set_unit_class(Path(from->unit()->getObjectPath())); msg->set_unit_type(static_cast<const uint8>(from->unit()->type())); @@ -482,7 +480,7 @@ sendClientCommand(msg, to->owner()); } { // tell OWNER[from] to update OWNER[to] - CommandUpdatePeer::Ref msg = new CommandUpdatePeer(); + Ref<CommandUpdatePeer> msg = new CommandUpdatePeer(); msg->set_unit_id(from->id()); msg->set_peer_id(to->owner()); sendClientCommand(msg, from->owner()); @@ -501,12 +499,12 @@ if (from->owner() != to->owner()) { CSPLOG(INFO, BATTLEFIELD) << "sending remove unit " << from->unit()->id() << " to client " << to->owner(); { - CommandRemoveUnit::Ref msg = new CommandRemoveUnit(); + Ref<CommandRemoveUnit> msg = new CommandRemoveUnit(); msg->set_unit_id(from->id()); sendClientCommand(msg, to->owner()); } { - CommandUpdatePeer::Ref msg = new CommandUpdatePeer(); + Ref<CommandUpdatePeer> msg = new CommandUpdatePeer(); msg->set_unit_id(from->id()); msg->set_peer_id(to->owner()); msg->set_stop(true); |
Author: mkrose Date: 2005-12-18 21:18:51 -0800 (Sun, 18 Dec 2005) New Revision: 1777 Removed: trunk/CSP/csp/csplib/data/SConscript trunk/CSP/csp/csplib/net/SConscript trunk/CSP/csp/csplib/numeric/SConscript trunk/CSP/csp/csplib/spatial/SConscript trunk/CSP/csp/csplib/thread/SConscript trunk/CSP/csp/csplib/util/SConscript Modified: trunk/CSP/csp/SConstruct trunk/CSP/csp/csplib/SConscript trunk/CSP/csp/cspsim/SConscript trunk/CSP/csp/modules/SConscript trunk/CSP/csp/modules/chunklod/SConscript trunk/CSP/csp/modules/demeter/SConscript trunk/CSP/csp/tools/build.py Log: More build system updates. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1777 Diff omitted (57988 bytes). |
From: <sv...@ww...> - 2005-12-16 09:26:16
|
Author: mkrose Date: 2005-12-16 01:26:06 -0800 (Fri, 16 Dec 2005) New Revision: 1776 Modified: trunk/CSP/csp/csplib/SConscript trunk/CSP/csp/csplib/csplib.i trunk/CSP/csp/csplib/data/DataArchive.cpp trunk/CSP/csp/csplib/data/LUT.h trunk/CSP/csp/csplib/util/Math.h trunk/CSP/csp/csplib/util/Testing.h trunk/CSP/csp/csplib/util/Trace.cpp trunk/CSP/csp/csplib/util/Trace.h trunk/CSP/csp/csplib/util/Verify.h trunk/CSP/csp/cspsim/BaseScreen.h trunk/CSP/csp/cspsim/CSPSim.cpp trunk/CSP/csp/cspsim/CSPSim.h trunk/CSP/csp/cspsim/DataRecorder.h trunk/CSP/csp/cspsim/Export.h trunk/CSP/csp/cspsim/ObjectModel.h trunk/CSP/csp/cspsim/ScreenInfo.cpp trunk/CSP/csp/cspsim/ScreenInfo.h trunk/CSP/csp/cspsim/f16/F16Engine.cpp trunk/CSP/csp/cspsim/glDiagnostics.cpp trunk/CSP/csp/cspsim/hud/Text.cpp trunk/CSP/csp/cspsim/theater/ElevationCorrection.h trunk/CSP/csp/cspsim/theater/LayoutTransform.h trunk/CSP/csp/modules/chunklod/ChunkLod trunk/CSP/csp/modules/chunklod/MultiTextureDetails trunk/CSP/csp/modules/demeter/Terrain.cpp trunk/CSP/csp/modules/demeter/Terrain.h Log: Mac OS X build fixes, Windows compile warning fixes, and miscellaneous cleanup. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1776 Diff omitted (22119 bytes). |
From: <sv...@ww...> - 2005-12-16 09:18:26
|
Author: mkrose Date: 2005-12-16 01:18:19 -0800 (Fri, 16 Dec 2005) New Revision: 1775 Modified: trunk/CSP/csp/tools/csp.bootstrap Log: Add a version number to the bootstrap script to allow newer versions to be installed without requiring an explicit override. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1775 Modified: trunk/CSP/csp/tools/csp.bootstrap =================================================================== --- trunk/CSP/csp/tools/csp.bootstrap 2005-12-16 09:17:06 UTC (rev 1774) +++ trunk/CSP/csp/tools/csp.bootstrap 2005-12-16 09:18:19 UTC (rev 1775) @@ -26,10 +26,10 @@ """ import os -import os.path import sys -import string +BOOTSTRAP_VERSION = 2 + # save the path old_path = sys.path[:] @@ -80,6 +80,8 @@ print 'Unable to bootstrap a csp module space from the current working directory.' raise +csp.BOOTSTRAP_VERSION = BOOTSTRAP_VERSION + # restore the path sys.path = [CSP_PATH] + old_path |
From: <sv...@ww...> - 2005-12-16 09:17:14
|
Author: mkrose Date: 2005-12-16 01:17:06 -0800 (Fri, 16 Dec 2005) New Revision: 1774 Added: trunk/CSP/csp/tools/setup.py Removed: trunk/CSP/csp/setup.py Log: Move the setup script to the tools directory and convert it to a module (it will be made available through scons). Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1774 Deleted: trunk/CSP/csp/setup.py =================================================================== --- trunk/CSP/csp/setup.py 2005-12-16 09:15:46 UTC (rev 1773) +++ trunk/CSP/csp/setup.py 2005-12-16 09:17:06 UTC (rev 1774) @@ -1,120 +0,0 @@ -#!/usr/bin/env python -# -# Combat Simulator Project Workspace Setup Script -# Copyright (C) 2004 The Combat Simulator Project -# http://csp.sourceforge.net -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - -""" -Combat Simulator Project - Workspace Setup Script - -Installs a stub module csp.py into the Python site-packages directory, -allowing csp and its submodules to be imported from the current client -workspace without modifying the default Python module path. - -Also prepares the build environment for the current platform. (Not -fully implemented yet.) - -Usage: %(prog)s [flags] -""" - -import sys -import os -import os.path -import commands -from distutils import sysconfig -from distutils import file_util -from distutils import util -from distutils import log -from base import app # (csp.base) - -log.set_verbosity(log.INFO) - - -def InstallLoader(force): - """Install tools/csp.bootstrap as csp.py in Python site-packages.""" - site_packages = sysconfig.get_python_lib() - target = os.path.join(site_packages, 'csp.py') - if os.path.exists(target) and not force: - print 'Error: unable to import csp, but csp.py exists in site-packages.' - print 'Use --force to overwrite.' - sys.exit(1) - source = os.path.join('tools', 'csp.bootstrap') - log.info('installing bootstrap loader') - try: - file_util.copy_file(source, target) - except file_util.DistutilsFileError, e: - print e - sys.exit(1) - log.info('byte compiling bootstrap loader') - util.byte_compile(target) - - -def CheckSCons(): - status, output = commands.getstatusoutput('scons --version') - return status == 0 - -def TestBootstrapModule(): - try: - import csp - return 1 - except ImportError: - return 0 - -def IsUnix(): - return os.name == 'posix' - - -def main(args): - print 'Combat Simulator Project - Workspace Setup Script' - - do_install = app.options.force - nothing_to_do = 1 - - if not TestBootstrapModule(): - do_install = 1 - - if do_install: - InstallLoader(app.options.force) - if not TestBootstrapModule(): - print 'ERROR: bootstrap csp module installation failed.' - return 1 - nothing_to_do = 0 - - if IsUnix() and not CheckSCons(): - print - print 'WARNING: SCons software construction tool (scons) not found.' - print - print 'SCons is required to build csp on non-Windows platforms. See ' - print 'http://scons.sf.net for more information and to download installable' - print 'packages. You may also be able to install the latest version of' - print 'SCons for your distribution using a package tool such as apt-get' - print '(e.g. "apt-get install scons").' - return 1 - - if IsUnix(): - print 'Setup complete. Run "scons <target>" to build csp, or see the README' - print 'file for more information.' - else: - print 'Setup complete. Open the project files in VisualStudio to build' - print 'csp, or see the README file for more information.' - - return 0 - - -app.addOption('-f', '--force', action='store_true', default=False, help='force reinstall') -app.start() Copied: trunk/CSP/csp/tools/setup.py (from rev 1748, trunk/CSP/csp/setup.py) =================================================================== --- trunk/CSP/csp/setup.py 2005-12-11 06:35:43 UTC (rev 1748) +++ trunk/CSP/csp/tools/setup.py 2005-12-16 09:17:06 UTC (rev 1774) @@ -0,0 +1,117 @@ +# Combat Simulator Project - Workspace Setup Utilities +# Copyright (C) 2004 The Combat Simulator Project +# http://csp.sourceforge.net +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +""" +Installs a stub module csp.py into the Python site-packages directory, +allowing csp and its submodules to be imported from the current client +workspace without modifying the default Python module path. + +Also prepares the build environment for the current platform. (Not +fully implemented yet.) + +This module is used by the scons build environment. See the top-level +README for details. +""" + +import sys +import os +import os.path +import commands +import logging +from distutils import sysconfig +from distutils import file_util +from distutils import util + + +class BootstrapInstaller: + BOOTSTRAP = os.path.join(os.path.dirname(__file__), 'csp.bootstrap') + + class MustForceOverwrite(Exception): pass + + def __init__(self, log=None): + self._log = log + self._checkModuleSource() + self._testBootstrapModule() + + def _info(self, msg): + if self._log: self._log.info(msg) + + def _warning(self, msg): + if self._log: self._log.warning(msg) + + def _error(self, msg): + if self._log: self._log.error(msg) + + def _checkModuleSource(self): + """Check the the bootstrap loader source file exists and extract the version number.""" + self._source_version = 0 + if os.path.exists(BootstrapInstaller.BOOTSTRAP): + self._info('Found source module %s' % BootstrapInstaller.BOOTSTRAP) + for line in open(BootstrapInstaller.BOOTSTRAP): + if line.startswith('BOOTSTRAP_VERSION ='): + self._source_version = int(line.split('=')[1].strip()) + break + if not self._source_version: + self._warning('BOOTSTRAP_VERSION not found in source module') + else: + self._warning('Bootstrap loader module %s not found' % BootstrapInstaller.BOOTSTRAP) + + def _testBootstrapModule(self): + """Test if the bootstrap module is installed and extract the version number.""" + self._installed_version = 0 + try: + import csp + self._installed_version = getattr(csp, 'BOOTSTRAP_VERSION', 1) + except ImportError: + pass + + def install(self, force): + """Install tools/csp.bootstrap as csp.py in Python site-packages.""" + + if self._installed_version: + self._info('Found installed bootstrap loader version %d' % self._installed_version) + + if not self._source_version: + self._error('Unable to install bootstrap loader %s' % BootstrapInstaller.BOOTSTRAP) + return 0 + + site_packages = sysconfig.get_python_lib() + target = os.path.join(site_packages, 'csp.py') + if os.path.exists(target) and (self._installed_version >= self._source_version and not force): + self._error('Unable to install bootstrap loader; %s already exists.' % target) + return 0 + + source = BootstrapInstaller.BOOTSTRAP + self._info('Installing bootstrap loader version %d to %s' % (self._source_version, target)) + try: + file_util.copy_file(source, target) + except file_util.DistutilsFileError, e: + self._error('Error installing bootstrap loader: %s' % e) + self._error('Note that you may need root/admin privileges to install the loader.') + return 0 + + self._info('Byte compiling bootstrap loader') + util.byte_compile(target) + return 1 + + +def SetupClientWorkspace(force=0, log=None): + installer = BootstrapInstaller(log) + return installer.install(force) + |
From: <sv...@ww...> - 2005-12-16 09:15:58
|
Author: mkrose Date: 2005-12-16 01:15:46 -0800 (Fri, 16 Dec 2005) New Revision: 1773 Modified: trunk/CSP/csp/tools/build.py Log: Add basic build support for platform-specific configurations. Also includes a small fix to allow transitions between local and distributed builds without invalidating build signatures. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1773 Modified: trunk/CSP/csp/tools/build.py =================================================================== --- trunk/CSP/csp/tools/build.py 2005-12-13 05:18:40 UTC (rev 1772) +++ trunk/CSP/csp/tools/build.py 2005-12-16 09:15:46 UTC (rev 1773) @@ -87,6 +87,8 @@ def Extension(fn): return os.path.splitext(fn)[1] +def GetCurrentScript(): + return SCons.Script.SConscript.stack[-1].sconscript class SourceList(object): _header_ext = ('.h', '.hh', '.hpp', '.hxx') @@ -537,7 +539,8 @@ conf.AddTests({'CheckCommandVersion': CheckCommandVersion}) conf.AddTests({'CheckPkgConfig': CheckPkgConfig}) # override -Q - SCons.SConf.SetProgressDisplay(SCons.Util.display) + if hasattr(SCons.SConf, 'SetProgressDisplay'): + Scons.SConf.SetProgressDisplay(SCons.Util.display) return conf @@ -567,7 +570,50 @@ config(env) WriteConfig(env) +def _CustomizeForPlatform(env, platform_settings): + assert isinstance(platform_settings, PlatformSettings) + SetConfig(env, platform_settings.config) + platform_settings.customize(env) +def CopyEnvironment(env, vars): + for var in vars: + if os.environ.has_key(var): + env['ENV'][var] = os.environ[var] + +def CustomizeForPlatform(env, settings): + if hasattr(settings, '__bases__'): + settings = settings() + script = GetCurrentScript() + platform = sys.platform.lower() + + configs = [] + customizations = [] + for item in dir(settings): + if item.startswith('config_'): + configs.append((item[len('config_'):], getattr(settings, item))) + elif item.startswith('customize_'): + customizations.append((item[len('customize_'):], getattr(settings, item))) + + run_config = getattr(settings, 'config_default', None) + run_customization = getattr(settings, 'customize_default', None) + if not platform.startswith('win'): + if run_config is None: + run_config = getattr(settings, 'config_linux', None) + if run_customization is None: + run_customization = getattr(settings, 'customize_linux', None) + for target, method in configs: + if platform.startswith(target): + run_config = method + break + for target, method in customizations: + if platform.startswith(target): + run_customization = method + break + if run_config is not None: + SetConfig(env, run_config) + if run_customization is not None: + run_customization(env) + def RemoveFlags(env, **kw): """ Remove flags from environment variables. The specified environment @@ -596,7 +642,7 @@ if not distcc: print 'Concurrent build requested, but distcc not found.' return - CXX = '%s %s' % (distcc, CXX) + CXX = '$( %s $) %s' % (distcc, CXX) # distcc needs access to configuration in the home directory env['ENV']['HOME'] = os.environ.get('HOME', '') env.Replace(CXX=CXX) @@ -634,6 +680,8 @@ if distributed and ssoptions.get('num_jobs') > 1: SetDistributed(env) AddPhonyTarget(env, 'config') + SConsEnvironment.CustomizeForPlatform = CustomizeForPlatform + SConsEnvironment.CopyEnvironment = CopyEnvironment SConsEnvironment.SetConfig = SetConfig SConsEnvironment.Documentation = MakeDocumentation SConsEnvironment.RemoveFlags = RemoveFlags @@ -661,6 +709,8 @@ def UnsupportedPlatform(self): print 'Platform "%s" not supported' % self._platform sys.exit(1) + def AddOption(self, *arg, **kw): + self._opts.Add(*arg, **kw) def __setattr__(self, key, value): if key.startswith('_'): self.__dict__[key] = value @@ -670,6 +720,7 @@ env = SCons.Environment.Environment(**self._dict) GlobalSetup(env, default_message=self._default_message, config=self._config) env.Help(self._help + self._opts.GenerateHelpText(env)) + self._opts.Update(env) return env @@ -691,11 +742,15 @@ def AddSwigBuild(env): - env['SWIGCOM'] = '$SWIG $SWIGFLAGS $SWIGINCLUDES -o $TARGET $SOURCE' - builder = Builder(action = '$SWIG $SWIGFLAGS $SWIGINCLUDES -o ${TARGETS[0]} $SOURCE', emitter = EmitSwig) + env['SWIGCOM'] = '$SWIG $SWIGFLAGS $_SWIGINCFLAGS -o $TARGET $SOURCE' + env['SWIGINCPREFIX'] = '-I' + env['SWIGINCSUFFIX'] = '$INCSUFFIX' + env['SWIGCXXFLAGS'] = '$CXXFLAGS' + env['_SWIGINCFLAGS'] = '$( ${_concat(SWIGINCPREFIX, SWIGINCLUDES, SWIGINCSUFFIX, __env__, RDirs)} $)' + builder = Builder(action = '$SWIG $SWIGFLAGS $_SWIGINCFLAGS -o ${TARGETS[0]} $SOURCE', emitter = EmitSwig) env.Append(BUILDERS = {'Swig': builder}) def wrapper_builder(env, target = None, source = SCons.Builder._null, **kw): - kw.setdefault('CXXFLAGS', env.get('SWIGCXXFLAGS', env.get('CXXFLAGS', ''))) + kw.setdefault('CXXFLAGS', env['SWIGCXXFLAGS']) return env.SharedObject(target, source, **kw) env.Append(BUILDERS = {'SwigWrapper': wrapper_builder }) @@ -782,7 +837,7 @@ def AddVisualStudioProject(env): def VisualStudioProject(env, target, source): - if IsWindows(env): + if IsWindows(env) and hasattr(env, 'MSVSProject'): if isinstance(target, list): target = target[0] project_base = os.path.splitext(os.path.basename(target.name))[0] if project_base.startswith('_'): project_base = project_base[1:] |
From: <sv...@ww...> - 2005-12-13 05:18:47
|
Author: mkrose Date: 2005-12-12 21:18:40 -0800 (Mon, 12 Dec 2005) New Revision: 1772 Modified: trunk/CSP/csp/data/xml/theater/balkan/airbase.xml trunk/CSP/csp/data/xml/theater/balkan/lightpylon.xml Log: Fix xml paths after renaming. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1772 Modified: trunk/CSP/csp/data/xml/theater/balkan/airbase.xml =================================================================== --- trunk/CSP/csp/data/xml/theater/balkan/airbase.xml 2005-12-13 04:26:44 UTC (rev 1771) +++ trunk/CSP/csp/data/xml/theater/balkan/airbase.xml 2005-12-13 05:18:40 UTC (rev 1772) @@ -154,19 +154,19 @@ <Float name="orientation">1.57</Float> </Object> <Object class="FeatureLayout"> - <Path name="model">Lightpylon1</Path> + <Path name="model">lightpylon</Path> <Float name="x">405</Float> <Float name="y">-190</Float> <Float name="orientation">-1.57</Float> </Object> <Object class="FeatureLayout"> - <Path name="model">Lightpylon1</Path> + <Path name="model">lightpylon</Path> <Float name="x">408</Float> <Float name="y">-380</Float> <Float name="orientation">-1.57</Float> </Object> <Object class="FeatureLayout"> - <Path name="model">Lightpylon1</Path> + <Path name="model">lightpylon</Path> <Float name="x">405</Float> <Float name="y">-572</Float> <Float name="orientation">-1.57</Float> Modified: trunk/CSP/csp/data/xml/theater/balkan/lightpylon.xml =================================================================== --- trunk/CSP/csp/data/xml/theater/balkan/lightpylon.xml 2005-12-13 04:26:44 UTC (rev 1771) +++ trunk/CSP/csp/data/xml/theater/balkan/lightpylon.xml 2005-12-13 05:18:40 UTC (rev 1772) @@ -1,6 +1,6 @@ <?xml version="1.0" standalone="no"?> <Object class="FeatureObjectModel"> - <Path name="model">Lightpylon1.model</Path> + <Path name="model">lightpylon.model</Path> <Int name="hit_points">30</Int> </Object> |
From: <sv...@ww...> - 2005-12-13 04:26:53
|
Author: mkrose Date: 2005-12-12 20:26:44 -0800 (Mon, 12 Dec 2005) New Revision: 1771 Modified: trunk/CSP/csp/cspsim/hud/Text.cpp Log: Fix compile error under windows. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1771 Modified: trunk/CSP/csp/cspsim/hud/Text.cpp =================================================================== --- trunk/CSP/csp/cspsim/hud/Text.cpp 2005-12-13 04:24:47 UTC (rev 1770) +++ trunk/CSP/csp/cspsim/hud/Text.cpp 2005-12-13 04:26:44 UTC (rev 1771) @@ -38,7 +38,7 @@ CSP_NAMESPACE void StandardFormatter::format(char *buffer, int len, float value) { - std::snprintf(buffer, len, m_Format.c_str(), value); + snprintf(buffer, len, m_Format.c_str(), value); } CSP_NAMESPACE_END |
From: <sv...@ww...> - 2005-12-13 04:24:56
|
Author: mkrose Date: 2005-12-12 20:24:47 -0800 (Mon, 12 Dec 2005) New Revision: 1770 Modified: trunk/CSP/csp/cspsim/EventMapIndex.cpp trunk/CSP/csp/cspsim/EventMapIndex.h Log: Reduce header dependencies. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1770 Modified: trunk/CSP/csp/cspsim/EventMapIndex.cpp =================================================================== --- trunk/CSP/csp/cspsim/EventMapIndex.cpp 2005-12-13 04:23:45 UTC (rev 1769) +++ trunk/CSP/csp/cspsim/EventMapIndex.cpp 2005-12-13 04:24:47 UTC (rev 1770) @@ -24,6 +24,7 @@ #include <csp/cspsim/EventMapIndex.h> +#include <csp/cspsim/Config.h> //#include <osgDB/FileUtils> //#include <osgDB/FileNameUtils> Modified: trunk/CSP/csp/cspsim/EventMapIndex.h =================================================================== --- trunk/CSP/csp/cspsim/EventMapIndex.h 2005-12-13 04:23:45 UTC (rev 1769) +++ trunk/CSP/csp/cspsim/EventMapIndex.h 2005-12-13 04:24:47 UTC (rev 1770) @@ -27,7 +27,6 @@ #include <csp/cspsim/HID.h> -#include <csp/cspsim/Config.h> #include <csp/cspsim/EventMapping.h> #include <csp/csplib/util/HashUtility.h> |
From: <sv...@ww...> - 2005-12-13 04:23:51
|
Author: mkrose Date: 2005-12-12 20:23:45 -0800 (Mon, 12 Dec 2005) New Revision: 1769 Modified: trunk/CSP/csp/csplib/data/LUT.h Log: Possible fix for warnings when using double precision floats to index into single precision lookup tables under windows. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1769 Modified: trunk/CSP/csp/csplib/data/LUT.h =================================================================== --- trunk/CSP/csp/csplib/data/LUT.h 2005-12-13 04:23:30 UTC (rev 1768) +++ trunk/CSP/csp/csplib/data/LUT.h 2005-12-13 04:23:45 UTC (rev 1769) @@ -218,7 +218,8 @@ public: /** Specify another coordinate. */ - inline WRAP<N,T> &operator[](T x); + template <typename Y> + inline WRAP<N,T> &operator[](Y y); /** Coerce the return value. */ @@ -515,9 +516,10 @@ * * @param x The first coordinate to sample. */ - inline WRAP<N,X> operator[](X x) const { + template <typename Y> + inline WRAP<N,X> operator[](Y y) const { this->checkInterpolated(); - return WRAP<N,X>(this, x); + return WRAP<N,X>(this, static_cast<X>(y)); } /** Test if the table contains no data. @@ -707,8 +709,9 @@ * the coordinates are set. */ template <int N, typename X> -inline WRAP<N,X> &WRAP<N,X>::operator[](X x) { - m_Vec(x); +template <typename Y> +inline WRAP<N,X> &WRAP<N,X>::operator[](Y y) { + m_Vec(static_cast<X>(y)); if (++m_N == N && m_Bind) { m_Value = m_Bind->getValue(m_Vec); } |
From: <sv...@ww...> - 2005-12-13 04:23:37
|
Author: mkrose Date: 2005-12-12 20:23:30 -0800 (Mon, 12 Dec 2005) New Revision: 1768 Modified: trunk/CSP/csp/cspsim/LogoScreen.cpp Log: Dynamically load logo images during startup rather than using a hardcoded list. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1768 Modified: trunk/CSP/csp/cspsim/LogoScreen.cpp =================================================================== --- trunk/CSP/csp/cspsim/LogoScreen.cpp 2005-12-13 04:19:48 UTC (rev 1767) +++ trunk/CSP/csp/cspsim/LogoScreen.cpp 2005-12-13 04:23:30 UTC (rev 1768) @@ -36,6 +36,7 @@ #include <osg/LightSource> #include <osg/Texture2D> #include <osgDB/ReadFile> +#include <osgDB/Registry> #include <osgUtil/SceneView> #include <ctime> @@ -61,44 +62,32 @@ ImageList::size_type m_CurrPos; double m_PrevTime; void setValue() { - m_Texture->setImage(m_ImageList[m_CurrPos].get()); + if (!m_ImageList.empty()) { + m_Texture->setImage(m_ImageList[m_CurrPos].get()); + } } public: ImageUpdateCallback(osg::Texture2D *texture, double delay): - m_Texture(texture), - m_Delay(delay), - m_PrevTime(0.0) { - // serialized? - typedef std::vector<std::string> StrVec; - StrVec file_name; - file_name.push_back("Logo/CSPLogo.jpg"); - file_name.push_back("Logo/moonrise1.jpg"); - file_name.push_back("Logo/crescent.jpg"); - file_name.push_back("Logo/sunlight2.jpg"); - file_name.push_back("Logo/sunset4.jpg"); - file_name.push_back("Logo/console2.jpg"); - file_name.push_back("Logo/TLabMultitex.jpg"); - file_name.push_back("Logo/landing-2.jpg"); - file_name.push_back("Logo/vista.jpg"); - file_name.push_back("Logo/ground-fog.jpg"); - file_name.push_back("Logo/fx2.jpg"); - + m_Texture(texture), + m_Delay(delay), + m_PrevTime(0.0) + { std::string image_path = getDataPath("ImagePath"); - StrVec::const_iterator iEnd = file_name.end(); - for (StrVec::const_iterator i = file_name.begin();i!=iEnd;++i) { - std::string path = ospath::join(image_path, *i); - osg::ref_ptr<osg::Image> image = osgDB::readImageFile(path); - if (!image.valid()) { - std::string err = "Unable to load bitmap " + path; - std::cerr << err << std::endl; - throw DataError(err); + std::string logo_path = ospath::join(image_path, "logo"); + ospath::DirectoryContents dir = ospath::getDirectoryContents(logo_path); + for (unsigned i = 0; i < dir.size(); ++i) { + std::string ext = ospath::getFileExtension(dir[i]); + std::cout << ext << "\n"; + if (osgDB::Registry::instance()->getReaderWriterForExtension(ext)) { + std::string path = ospath::join("logo", dir[i]); + std::cout << path << "\n"; + osg::ref_ptr<osg::Image> image = osgDB::readImageFile(path); + if (image.valid()) m_ImageList.push_back(image); } - else - m_ImageList.push_back(image); } - if (!file_name.empty()) { + if (!m_ImageList.empty()) { srand(static_cast<unsigned int>(time(0))); - m_CurrPos = rand() % file_name.size(); + m_CurrPos = rand() % m_ImageList.size(); setValue(); } } @@ -109,8 +98,10 @@ // record time m_PrevTime = currTime; // advance the current positon, wrap round if required. - ++m_CurrPos %= m_ImageList.size(); - setValue(); + if (!m_ImageList.empty()) { + ++m_CurrPos %= m_ImageList.size(); + setValue(); + } //} } } @@ -232,20 +223,20 @@ void LogoScreen::run() { /*static int i = 0; setDone(false); - while (!done()) { + while (!done()) { //bar.block(2); - // wait for all cull and draw threads to complete. - sync(); - // update the scene by traversing it with the the update visitor which will - // call all node update callbacks and animations. + // wait for all cull and draw threads to complete. + sync(); + // update the scene by traversing it with the the update visitor which will + // call all node update callbacks and animations. if (++i == 10) setDone(true); - update(); - // fire off the cull and draw traversals of the scene. - frame(); + update(); + // fire off the cull and draw traversals of the scene. + frame(); //bar.block(2); - } - // wait for all cull and draw threads to complete before exit. - sync();*/ + } + // wait for all cull and draw threads to complete before exit. + sync();*/ } void LogoScreen::stop() { @@ -253,74 +244,5 @@ } -/* -#ifdef WIN32 -#include <windows.h> -#endif - -#include <iostream> -#include <GL/gl.h> // Header File For The OpenGL32 Library -#include <GL/glu.h> // Header File For The GLu32 Library - -#include <SDL/SDL.h> - - -LogoScreen::LogoScreen(int width, int height) -{ - m_width = width; - m_height = height; -} - -LogoScreen::~LogoScreen() -{ -} - -void LogoScreen::onInit() -{ - std::string image_path = getDataPath("ImagePath"); - std::string path = simdata::ospath::join(image_path, "CSPLogo.bmp"); - m_image = SDL_LoadBMP(path.c_str()); - if (m_image == NULL) { - throw csp::DataError("Unable to load bitmap " + path); - } -} - -void LogoScreen::onExit() -{ - if (m_image) { - SDL_FreeSurface(m_image); - } -} - -void LogoScreen::onRender() -{ - if (!m_image) return; - - SDL_Rect src, dest; - - src.x = 0; - src.y = 0; - src.w = m_image->w; - src.h = m_image->h; - - dest.x = 0; - dest.y = 0; - dest.w = m_image->w; - dest.h = m_image->h; - - glViewport(0, 0, m_width, m_height); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(0.0, m_width, 0.0, m_height, -1.0, 1.0); - - // this centers the bitmap in case its a different size then the screen. - glRasterPos2i( ((m_width - m_image->w) >> 1), - m_height - ((m_height - m_image->h) >> 1) ); - glPixelZoom(1.0,-1.0); - - glDrawPixels(m_image->w, m_image->h, GL_RGB, GL_UNSIGNED_BYTE, m_image->pixels); -} -*/ - CSP_NAMESPACE_END |
From: <sv...@ww...> - 2005-12-13 04:20:01
|
Author: mkrose Date: 2005-12-12 20:19:48 -0800 (Mon, 12 Dec 2005) New Revision: 1767 Added: trunk/CSP/csp/data/images/environment.png trunk/CSP/csp/data/images/environment.png.COPYING trunk/CSP/csp/data/images/f16/COPYING trunk/CSP/csp/data/images/logo/ trunk/CSP/csp/data/images/logo/csp.png trunk/CSP/csp/data/images/m2k/COPYING trunk/CSP/csp/data/images/moon.png trunk/CSP/csp/data/images/moon.png.COPYING trunk/CSP/csp/data/images/trees/ trunk/CSP/csp/data/images/trees/tree0.png trunk/CSP/csp/data/images/trees/tree2.png trunk/CSP/csp/data/images/trees/tree5.png trunk/CSP/csp/data/images/trees/tree6.png Removed: trunk/CSP/csp/data/balkans_demeter/ trunk/CSP/csp/data/images/f16/f16-lak.tga trunk/CSP/csp/data/images/trees/tree0.png trunk/CSP/csp/data/images/trees/tree2.png trunk/CSP/csp/data/images/trees/tree5.png trunk/CSP/csp/data/images/trees/tree6.png Modified: trunk/CSP/csp/data/images/f16/T7.tga trunk/CSP/csp/data/models/aircraft/f16/f16dj-cockpit.osg trunk/CSP/csp/data/models/stores/missiles/aim9/aim9.osg Log: Port and upgrade images. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1767 Diff omitted (59093 bytes). |
From: <sv...@ww...> - 2005-12-11 21:46:50
|
Author: mkrose Date: 2005-12-11 13:46:43 -0800 (Sun, 11 Dec 2005) New Revision: 1766 Added: trunk/CSP/csp/tools/data/__init__.py Log: Make tools/data a package. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1766 Added: trunk/CSP/csp/tools/data/__init__.py =================================================================== |
From: <sv...@ww...> - 2005-12-11 20:18:51
|
Author: mkrose Date: 2005-12-11 12:18:45 -0800 (Sun, 11 Dec 2005) New Revision: 1765 Modified: trunk/CSP/csp/csplib/spatial/QuadTree.h Log: Yet more export fixups for windows. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1765 Modified: trunk/CSP/csp/csplib/spatial/QuadTree.h =================================================================== --- trunk/CSP/csp/csplib/spatial/QuadTree.h 2005-12-11 20:04:34 UTC (rev 1764) +++ trunk/CSP/csp/csplib/spatial/QuadTree.h 2005-12-11 20:18:45 UTC (rev 1765) @@ -374,9 +374,9 @@ void dump(std::ostream &os) const; }; -extern std::ostream & operator << (std::ostream &os, QuadTree const &q); -extern std::ostream & operator << (std::ostream &os, Point const &p); -extern std::ostream & operator << (std::ostream &os, Region const &r); +extern CSPLIB_EXPORT std::ostream & operator << (std::ostream &os, QuadTree const &q); +extern CSPLIB_EXPORT std::ostream & operator << (std::ostream &os, Point const &p); +extern CSPLIB_EXPORT std::ostream & operator << (std::ostream &os, Region const &r); } // namespace spatial |
From: <sv...@ww...> - 2005-12-11 20:04:43
|
Author: mkrose Date: 2005-12-11 12:04:34 -0800 (Sun, 11 Dec 2005) New Revision: 1764 Modified: trunk/CSP/csp/cspsim/CSPSim.h Log: Test to try to fix a few remaning unresolved symbols under win. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1764 Modified: trunk/CSP/csp/cspsim/CSPSim.h =================================================================== --- trunk/CSP/csp/cspsim/CSPSim.h 2005-12-11 19:41:45 UTC (rev 1763) +++ trunk/CSP/csp/cspsim/CSPSim.h 2005-12-11 20:04:34 UTC (rev 1764) @@ -53,6 +53,7 @@ #ifndef __CSPSIM_H__ #define __CSPSIM_H__ +#include <csp/cspsim/Export.h> #include <csp/csplib/util/Ref.h> #include <csp/csplib/util/ScopedPointer.h> #include <csp/csplib/data/Date.h> @@ -85,7 +86,7 @@ * direct access to shared simulation state. Do not abuse this access point; * minimizing dependence on the CSPSim instance is a Good Thing. */ -class CSPSim { +class CSP_EXPORT CSPSim { public: static CSPSim *theSim; |
From: <sv...@ww...> - 2005-12-11 19:41:54
|
Author: mkrose Date: 2005-12-11 11:41:45 -0800 (Sun, 11 Dec 2005) New Revision: 1763 Modified: trunk/CSP/csp/csplib/net/NetworkNode.h trunk/CSP/csp/csplib/numeric/NumericalMethod.h trunk/CSP/csp/csplib/numeric/VectorField.h Log: More import/export fixes for windows. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1763 Modified: trunk/CSP/csp/csplib/net/NetworkNode.h =================================================================== --- trunk/CSP/csp/csplib/net/NetworkNode.h 2005-12-11 19:17:16 UTC (rev 1762) +++ trunk/CSP/csp/csplib/net/NetworkNode.h 2005-12-11 19:41:45 UTC (rev 1763) @@ -27,6 +27,7 @@ #include <csp/csplib/net/NetBase.h> +#include <csp/csplib/util/Export.h> #include <csp/csplib/util/Uniform.h> #ifdef _WIN32 @@ -55,8 +56,7 @@ /** Class representing a remote host address (ip address and receive port) * @ingroup net */ -class NetworkNode -{ +class CSPLIB_EXPORT NetworkNode { private: ost::InetHostAddress m_addr; ost::tpport_t m_port; Modified: trunk/CSP/csp/csplib/numeric/NumericalMethod.h =================================================================== --- trunk/CSP/csp/csplib/numeric/NumericalMethod.h 2005-12-11 19:17:16 UTC (rev 1762) +++ trunk/CSP/csp/csplib/numeric/NumericalMethod.h 2005-12-11 19:41:45 UTC (rev 1763) @@ -31,6 +31,7 @@ #include <string> #include <vector> +#include <csp/csplib/util/Export.h> #include <csp/csplib/numeric/Vector.h> #define USE_VALARRAY_ARITHMETIC @@ -50,7 +51,7 @@ /** * Abstract base class for numerical solvers of dynamical systems. */ -class NumericalMethod { +class CSPLIB_EXPORT NumericalMethod { protected: /** * State of a numerical method @@ -148,7 +149,7 @@ //================================================================= -class RungeKutta: public NumericalMethod { +class CSPLIB_EXPORT RungeKutta: public NumericalMethod { Vectord const &rk4(Vectord const &y, Vectord const &dyx, double x, double h) const; Vectord const &rkqc(Vectord &y, Vectord &dydx, double &x, double htry, double eps, Vectord const &yscal, double &hdid, double &hnext); Vectord const &odeint(Vectord const &ystart, double x1, double x2, double eps, double h1, double hmin, unsigned int &nok, unsigned int &nbad); @@ -179,7 +180,7 @@ //================================================================= -class RungeKuttaCK: public NumericalMethod { +class CSPLIB_EXPORT RungeKuttaCK: public NumericalMethod { Vectord const &rkck(Vectord const &y, Vectord const &dyx, double x, double h, Vectord &yerr) const; Vectord const &rkqs(Vectord &y, Vectord &dydx, double &x, double htry, double eps, Vectord const &yscal, double &hdid, double &hnext); Vectord const &odeint(Vectord const &ystart, double x1, double x2, double eps, double h1, double hmin, unsigned int &nok, unsigned int &nbad); @@ -216,7 +217,7 @@ * problems with rapidly varying right-hand sides, ACM Transactions on Mathematical * Software, Vol. 16, No. 3, Sept 1990, pp. 201-222. */ -class RKCK_VS_VO: public NumericalMethod { +class CSPLIB_EXPORT RKCK_VS_VO: public NumericalMethod { /** * Evaluate the approximated solution at a+h (entire step size) * control is defered to vrkf to adjust step size and order. Modified: trunk/CSP/csp/csplib/numeric/VectorField.h =================================================================== --- trunk/CSP/csp/csplib/numeric/VectorField.h 2005-12-11 19:17:16 UTC (rev 1762) +++ trunk/CSP/csp/csplib/numeric/VectorField.h 2005-12-11 19:41:45 UTC (rev 1763) @@ -25,6 +25,7 @@ #ifndef __CSPSIM_VECTORFIELD_H__ #define __CSPSIM_VECTORFIELD_H__ +#include <csp/csplib/util/Export.h> #include <csp/csplib/util/Namespace.h> #include <csp/csplib/numeric/Vector.h> @@ -39,7 +40,7 @@ * field describing the kinetic parameters of a dynamical * system. */ -class VectorField { +class CSPLIB_EXPORT VectorField { protected: typedef size_t size_type; size_type const m_Dimension; |
From: <sv...@ww...> - 2005-12-11 19:17:24
|
Author: mkrose Date: 2005-12-11 11:17:16 -0800 (Sun, 11 Dec 2005) New Revision: 1762 Modified: trunk/CSP/csp/csplib/util/Dispatch.h trunk/CSP/csp/csplib/util/LocalUpdate.h trunk/CSP/csp/csplib/util/Modules.h trunk/CSP/csp/csplib/util/SimpleConfig.h trunk/CSP/csp/csplib/util/SynchronousUpdate.h Log: More import/export fixes for windows. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1762 Modified: trunk/CSP/csp/csplib/util/Dispatch.h =================================================================== --- trunk/CSP/csp/csplib/util/Dispatch.h 2005-12-11 19:03:29 UTC (rev 1761) +++ trunk/CSP/csp/csplib/util/Dispatch.h 2005-12-11 19:17:16 UTC (rev 1762) @@ -66,7 +66,9 @@ #define __CSPLIB_UTIL_DISPATCH_H__ +#include <csp/csplib/util/Export.h> #include <csp/csplib/util/Namespace.h> +// TODO move to net (util/* shouldn't depend on net/*) #include <csp/csplib/net/TaggedRecord.h> CSP_NAMESPACE @@ -92,7 +94,7 @@ * Inherit from this class and use the MESSAGE_DISPATCH macros to * bind handlers to specific message types. */ -class MessageDispatcher { +class CSPLIB_EXPORT MessageDispatcher { public: virtual bool dispatchMessage(Ref<TaggedRecord> const &record) { Modified: trunk/CSP/csp/csplib/util/LocalUpdate.h =================================================================== --- trunk/CSP/csp/csplib/util/LocalUpdate.h 2005-12-11 19:03:29 UTC (rev 1761) +++ trunk/CSP/csp/csplib/util/LocalUpdate.h 2005-12-11 19:17:16 UTC (rev 1762) @@ -25,6 +25,7 @@ #ifndef __CSPLIB_UTIL_LOCALUPDATE_H__ #define __CSPLIB_UTIL_LOCALUPDATE_H__ +#include <csp/csplib/util/Export.h> #include <csp/csplib/util/Namespace.h> #include <vector> #include <sigc++/slot.h> @@ -80,7 +81,7 @@ * }; * @endcode */ -class LocalUpdate { +class CSPLIB_EXPORT LocalUpdate { public: LocalUpdate(): m_Time(0), m_Next(0) { } ~LocalUpdate(); Modified: trunk/CSP/csp/csplib/util/Modules.h =================================================================== --- trunk/CSP/csp/csplib/util/Modules.h 2005-12-11 19:03:29 UTC (rev 1761) +++ trunk/CSP/csp/csplib/util/Modules.h 2005-12-11 19:17:16 UTC (rev 1762) @@ -25,6 +25,7 @@ #ifndef __CSPLIB_UTIL_MODULES_H__ #define __CSPLIB_UTIL_MODULES_H__ +#include <csp/csplib/util/Export.h> #include <csp/csplib/util/Namespace.h> #include <csp/csplib/util/Properties.h> #include <string> @@ -34,7 +35,7 @@ /** Interface for loading shared libraries at runtime. Works only on systems * that support dynamic loading. */ -class ModuleLoader: public NonConstructable { +class CSPLIB_EXPORT ModuleLoader: public NonConstructable { public: /** Load a new module from the specified path. Returns true on success. Modified: trunk/CSP/csp/csplib/util/SimpleConfig.h =================================================================== --- trunk/CSP/csp/csplib/util/SimpleConfig.h 2005-12-11 19:03:29 UTC (rev 1761) +++ trunk/CSP/csp/csplib/util/SimpleConfig.h 2005-12-11 19:17:16 UTC (rev 1762) @@ -39,6 +39,7 @@ #include <iostream> #include <fstream> +#include <csp/csplib/util/Export.h> #include <csp/csplib/util/HashUtility.h> CSP_NAMESPACE @@ -49,7 +50,7 @@ * The error message will automatically be dumped to stderr when the object * is destroyed unless the clear() method is called. */ -class Error { +class CSPLIB_EXPORT Error { public: /** * Set the error message. @@ -62,9 +63,7 @@ * Maybe a little too fancy, but the clear() is needed so that * multiple automatic copies yield only a single error message. */ - Error(const Error &e): m_msg(e.m_msg), - m_fullerror(e.m_fullerror), - m_display(e.m_display) { e.clear(); } + Error(const Error &e): m_msg(e.m_msg), m_fullerror(e.m_fullerror), m_display(e.m_display) { e.clear(); } /** * Display the error message on stderr unless clear() has been called. @@ -99,7 +98,7 @@ /** * Thrown by SimpleConfig to report errors. */ -class ConfigError: public Error { +class CSPLIB_EXPORT ConfigError: public Error { public: /** * Set the error information. @@ -143,7 +142,7 @@ * This will often be created as a global object so that configuration * data can be accessed and saved throughout the program. */ -class SimpleConfig { +class CSPLIB_EXPORT SimpleConfig { public: /** Modified: trunk/CSP/csp/csplib/util/SynchronousUpdate.h =================================================================== --- trunk/CSP/csp/csplib/util/SynchronousUpdate.h 2005-12-11 19:03:29 UTC (rev 1761) +++ trunk/CSP/csp/csplib/util/SynchronousUpdate.h 2005-12-11 19:17:16 UTC (rev 1762) @@ -27,6 +27,7 @@ #define __CSPLIB_UTIL_SYNCHRONOUSUPDATE_H__ +#include <csp/csplib/util/Export.h> #include <csp/csplib/util/Namespace.h> #include <csp/csplib/util/Ref.h> |
From: <sv...@ww...> - 2005-12-11 19:03:36
|
Author: mkrose Date: 2005-12-11 11:03:29 -0800 (Sun, 11 Dec 2005) New Revision: 1761 Modified: trunk/CSP/csp/csplib/net/NetBase.h trunk/CSP/csp/csplib/spatial/QuadTree.h Log: More win32 export fixes. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1761 Modified: trunk/CSP/csp/csplib/net/NetBase.h =================================================================== --- trunk/CSP/csp/csplib/net/NetBase.h 2005-12-11 18:59:05 UTC (rev 1760) +++ trunk/CSP/csp/csplib/net/NetBase.h 2005-12-11 19:03:29 UTC (rev 1761) @@ -37,6 +37,7 @@ #define __CSPLIB_NET_NETBASE_H__ #include <csp/csplib/util/Endian.h> +#include <csp/csplib/util/Export.h> #include <csp/csplib/util/Uniform.h> #include <cassert> #include <ostream> Modified: trunk/CSP/csp/csplib/spatial/QuadTree.h =================================================================== --- trunk/CSP/csp/csplib/spatial/QuadTree.h 2005-12-11 18:59:05 UTC (rev 1760) +++ trunk/CSP/csp/csplib/spatial/QuadTree.h 2005-12-11 19:03:29 UTC (rev 1761) @@ -47,6 +47,7 @@ #ifndef __CSPLIB_SPATIAL_QUADTREE_H__ #define __CSPLIB_SPATIAL_QUADTREE_H__ +#include <csp/csplib/util/Export.h> #include <csp/csplib/util/Namespace.h> #include <csp/csplib/util/Uniform.h> @@ -63,7 +64,7 @@ /** A simple 2D point class, using usigned 32-bit integer coordinates. */ -class Point { +class CSPLIB_EXPORT Point { uint32 _x, _y; public: @@ -107,7 +108,7 @@ /** A simple 2D rectangular region class, using unsigned 32-bit integer * coordinates. */ -class Region { +class CSPLIB_EXPORT Region { uint32 _x0, _y0, _x1, _y1; public: @@ -224,7 +225,7 @@ * be deleted via a subclass pointer, since Child does not define a virtual * destructor. */ -class Child { +class CSPLIB_EXPORT Child { int _id; Point _point; public: @@ -281,7 +282,7 @@ /** Helper class for passing tree configuration data down to subnodes * when traversing the tree. */ -class TreeConstraint { +class CSPLIB_EXPORT TreeConstraint { const uint32 _max_depth; const uint32 _leaf_limit; public: @@ -315,7 +316,7 @@ /** A 2D spatial index over 32-bit integer coordinates. */ -class QuadTree { +class CSPLIB_EXPORT QuadTree { Node *_root; TreeConstraint _constraint; |
From: <sv...@ww...> - 2005-12-11 18:59:17
|
Author: mkrose Date: 2005-12-11 10:59:05 -0800 (Sun, 11 Dec 2005) New Revision: 1760 Modified: trunk/CSP/csp/csplib/net/ClientServer.h trunk/CSP/csp/csplib/net/DispatchCache.h trunk/CSP/csp/csplib/net/DispatchHandler.h trunk/CSP/csp/csplib/net/MessageHandler.h trunk/CSP/csp/csplib/net/MessageQueue.h trunk/CSP/csp/csplib/net/NetRandom.h trunk/CSP/csp/csplib/net/NetworkInterface.h trunk/CSP/csp/csplib/net/PacketDecoder.h trunk/CSP/csp/csplib/net/PacketHandler.h trunk/CSP/csp/csplib/net/PacketQueue.h trunk/CSP/csp/csplib/net/PacketSource.h trunk/CSP/csp/csplib/net/PeerInfo.h trunk/CSP/csp/csplib/net/RecordCodec.h trunk/CSP/csp/csplib/net/ReliablePacket.h trunk/CSP/csp/csplib/net/RoutingHandler.h trunk/CSP/csp/csplib/net/Sockets.h trunk/CSP/csp/csplib/net/StopWatch.h trunk/CSP/csp/csplib/net/TaggedRecord.h Log: Add win export qualifiers. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1760 Diff omitted (13065 bytes). |
From: <sv...@ww...> - 2005-12-11 18:34:34
|
Author: mkrose Date: 2005-12-11 10:34:25 -0800 (Sun, 11 Dec 2005) New Revision: 1759 Modified: trunk/CSP/csp/csplib/util/StringTools.h Log: Add missing include. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1759 Modified: trunk/CSP/csp/csplib/util/StringTools.h =================================================================== --- trunk/CSP/csp/csplib/util/StringTools.h 2005-12-11 18:30:50 UTC (rev 1758) +++ trunk/CSP/csp/csplib/util/StringTools.h 2005-12-11 18:34:25 UTC (rev 1759) @@ -25,6 +25,7 @@ #ifndef __CSPLIB_UTIL_STRINGTOOLS_H__ #define __CSPLIB_UTIL_STRINGTOOLS_H__ +#include <csp/csplib/util/Export.h> #include <csp/csplib/util/Namespace.h> #include <string> #include <deque> |
From: <sv...@ww...> - 2005-12-11 18:31:06
|
Author: mkrose Date: 2005-12-11 10:30:50 -0800 (Sun, 11 Dec 2005) New Revision: 1758 Modified: trunk/CSP/csp/csplib/net/DispatchManager.h trunk/CSP/csp/csplib/net/DispatchTarget.h trunk/CSP/csp/csplib/util/LogStream.cpp trunk/CSP/csp/csplib/util/StringTools.h trunk/CSP/csp/csplib/util/SynchronousUpdate.h Log: Fix win32 exports. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1758 Modified: trunk/CSP/csp/csplib/net/DispatchManager.h =================================================================== --- trunk/CSP/csp/csplib/net/DispatchManager.h 2005-12-11 17:44:03 UTC (rev 1757) +++ trunk/CSP/csp/csplib/net/DispatchManager.h 2005-12-11 18:30:50 UTC (rev 1758) @@ -58,7 +58,7 @@ * the most common object/handler pairs for immediate dispatch. * @ingroup net */ -class DispatchManager: public Referenced { +class CSPLIB_EXPORT DispatchManager: public Referenced { public: /** Construct a new DispatchManager. * Modified: trunk/CSP/csp/csplib/net/DispatchTarget.h =================================================================== --- trunk/CSP/csp/csplib/net/DispatchTarget.h 2005-12-11 17:44:03 UTC (rev 1757) +++ trunk/CSP/csp/csplib/net/DispatchTarget.h 2005-12-11 18:30:50 UTC (rev 1758) @@ -71,7 +71,7 @@ * methods to specific message types. * @ingroup net */ -class DispatchTarget { +class CSPLIB_EXPORT DispatchTarget { friend class DispatchManager; protected: /** This method is called by DispatchManager::dispatch to pass a Modified: trunk/CSP/csp/csplib/util/LogStream.cpp =================================================================== --- trunk/CSP/csp/csplib/util/LogStream.cpp 2005-12-11 17:44:03 UTC (rev 1757) +++ trunk/CSP/csp/csplib/util/LogStream.cpp 2005-12-11 18:30:50 UTC (rev 1758) @@ -241,7 +241,7 @@ unlock(); } -void fatal(std::string const &msg) { +void CSPLIB_EXPORT fatal(std::string const &msg) { std::cerr << "CSP fatal error:" << std::endl; std::cerr << msg << std::endl; // use abort() instead of exit() to trigger the SIGABRT handler (if installed) Modified: trunk/CSP/csp/csplib/util/StringTools.h =================================================================== --- trunk/CSP/csp/csplib/util/StringTools.h 2005-12-11 17:44:03 UTC (rev 1757) +++ trunk/CSP/csp/csplib/util/StringTools.h 2005-12-11 18:30:50 UTC (rev 1758) @@ -34,16 +34,16 @@ /** Convert a string to uppercase (in place). */ -void ConvertStringToUpper(std::string &str); +void CSPLIB_EXPORT ConvertStringToUpper(std::string &str); /** Convert a string to lowercase (in place). */ -void ConvertStringToLower(std::string &str); +void CSPLIB_EXPORT ConvertStringToLower(std::string &str); /** Tokenize a string, placing the tokens into a deque. */ -class StringTokenizer: public std::deque<std::string> { +class CSPLIB_EXPORT StringTokenizer: public std::deque<std::string> { public: typedef std::deque<std::string>::iterator iterator; typedef std::deque<std::string>::const_iterator const_iterator; @@ -51,13 +51,13 @@ }; /** Remove leading and trailing whitespace, or other characters if specified. */ -std::string TrimString(std::string const &str, std::string const &chars = " \n\r\t"); +std::string CSPLIB_EXPORT TrimString(std::string const &str, std::string const &chars = " \n\r\t"); /** Remove leading whitespace, or other characters if specified. */ -std::string LeftTrimString(std::string const &str, std::string const &chars = " \n\r\t"); +std::string CSPLIB_EXPORT LeftTrimString(std::string const &str, std::string const &chars = " \n\r\t"); /** Remove trailing whitespace, or other characters if specified. */ -std::string RightTrimString(std::string const &str, std::string const &chars = " \n\n\t"); +std::string CSPLIB_EXPORT RightTrimString(std::string const &str, std::string const &chars = " \n\n\t"); CSP_NAMESPACE_END Modified: trunk/CSP/csp/csplib/util/SynchronousUpdate.h =================================================================== --- trunk/CSP/csp/csplib/util/SynchronousUpdate.h 2005-12-11 17:44:03 UTC (rev 1757) +++ trunk/CSP/csp/csplib/util/SynchronousUpdate.h 2005-12-11 18:30:50 UTC (rev 1758) @@ -42,7 +42,7 @@ class UpdateMaster; -class UpdateTarget { +class CSPLIB_EXPORT UpdateTarget { friend class UpdateProxy; private: /// A proxy for connecting to an UpdateMaster. @@ -96,7 +96,7 @@ -class UpdateProxy: public Referenced { +class CSPLIB_EXPORT UpdateProxy: public Referenced { friend class UpdateMaster; friend class UpdateTarget; @@ -191,7 +191,7 @@ * often as UpdateMaster::update is called, and this interval will also * determine the granularity of delayed callback intervals. */ -class UpdateMaster { +class CSPLIB_EXPORT UpdateMaster { /// Binary predicate for prioritizing delayed update callbacks. struct UpdatePriority: public std::binary_function<UpdateProxy::Ref,UpdateProxy::Ref,bool> { |
From: <sv...@ww...> - 2005-12-11 17:44:15
|
Author: mkrose Date: 2005-12-11 09:44:03 -0800 (Sun, 11 Dec 2005) New Revision: 1757 Modified: trunk/CSP/csp/cspsim/hud/Text.cpp Log: Fix win compile error. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1757 Modified: trunk/CSP/csp/cspsim/hud/Text.cpp =================================================================== --- trunk/CSP/csp/cspsim/hud/Text.cpp 2005-12-11 11:20:11 UTC (rev 1756) +++ trunk/CSP/csp/cspsim/hud/Text.cpp 2005-12-11 17:44:03 UTC (rev 1757) @@ -31,6 +31,10 @@ #include <osgText/Text> #include <cstdio> +#if !defined(__GNUC__) && !defined(snprintf) +#define snprintf _snprintf +#endif + CSP_NAMESPACE void StandardFormatter::format(char *buffer, int len, float value) { |
From: <sv...@ww...> - 2005-12-11 11:20:25
|
Author: mkrose Date: 2005-12-11 03:20:11 -0800 (Sun, 11 Dec 2005) New Revision: 1756 Modified: trunk/CSP/csp/csplib/data/Date.h trunk/CSP/csp/csplib/data/InterfaceRegistry.h trunk/CSP/csp/csplib/data/Quat.h trunk/CSP/csp/csplib/data/swig/Enum.i trunk/CSP/csp/csplib/data/test/test_Object.cpp trunk/CSP/csp/csplib/swig/vector.i Log: Remove lingering simdata references. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1756 Modified: trunk/CSP/csp/csplib/data/Date.h =================================================================== --- trunk/CSP/csp/csplib/data/Date.h 2005-12-11 09:40:15 UTC (rev 1755) +++ trunk/CSP/csp/csplib/data/Date.h 2005-12-11 11:20:11 UTC (rev 1756) @@ -692,14 +692,6 @@ return j + t; } - /** Get the (accurate) Mean Sidereal time. - * - * @deprecated This routine now calls getMST and remains - * only for backwards compatibility. It may - * be removed in a future version of SimData. - */ - //double getAccurateMST(radian_t longitude=0.0L) const; - /** Get the Mean Sidereal time. * * @param longitude The local longitude in radians. Modified: trunk/CSP/csp/csplib/data/InterfaceRegistry.h =================================================================== --- trunk/CSP/csp/csplib/data/InterfaceRegistry.h 2005-12-11 09:40:15 UTC (rev 1755) +++ trunk/CSP/csp/csplib/data/InterfaceRegistry.h 2005-12-11 11:20:11 UTC (rev 1756) @@ -100,7 +100,7 @@ /** Add an interface to the registry. * * Interfaces are registered automatically by the XML definition macros - * (@c CSP_XML_BEGIN and @c SIMDATA_XML_END). + * (@c CSP_XML_BEGIN and @c CSP_XML_END). */ void addInterface(const char *name, hasht id, InterfaceProxy *proxy); Modified: trunk/CSP/csp/csplib/data/Quat.h =================================================================== --- trunk/CSP/csp/csplib/data/Quat.h 2005-12-11 09:40:15 UTC (rev 1755) +++ trunk/CSP/csp/csplib/data/Quat.h 2005-12-11 11:20:11 UTC (rev 1756) @@ -463,5 +463,5 @@ CSP_NAMESPACE_END -#endif // __SIMDATA_QUAT_H__ +#endif // __CSPLIB_DATA_QUAT_H__ Modified: trunk/CSP/csp/csplib/data/swig/Enum.i =================================================================== --- trunk/CSP/csp/csplib/data/swig/Enum.i 2005-12-11 09:40:15 UTC (rev 1755) +++ trunk/CSP/csp/csplib/data/swig/Enum.i 2005-12-11 11:20:11 UTC (rev 1756) @@ -36,7 +36,7 @@ CSP(EnumLink)* ptr = new CSP(EnumLink)((($1_type &)$1)[i]); PyTuple_SetItem($result, i, SWIG_NewPointerObj((void *) ptr, - $descriptor(simdata::EnumLink *), 1)); + $descriptor(csp::EnumLink *), 1)); } }" @@ -69,7 +69,7 @@ %include "csp/csplib/data/Enum.h" -#define CSP_ENUM_WRAP1(T) \ +#define CSP_ENUM_WRAP1(T) \ %typemap(in) CSP(Enum)<T> * (int __index, std::string __string, CSP(EnumLink) *__enumlink) \ "{ \ __index = -1; \ @@ -82,7 +82,7 @@ __string = std::string(PyString_AsString($input)); \ } else \ if ((SWIG_ConvertPtr($input,(void **) &$1, $1_descriptor, 0 )) == -1) { \ - if ((SWIG_ConvertPtr($input,(void **) &__enumlink, SWIGTYPE_p_simdata__EnumLink, 0 )) == -1) { \ + if ((SWIG_ConvertPtr($input,(void **) &__enumlink, SWIGTYPE_p_csp__EnumLink, 0 )) == -1) { \ PyErr_SetString(PyExc_TypeError, \"string or enum expected\"); \ } \ } \ @@ -105,7 +105,7 @@ }"; #define CSP_ENUM_WRAP(NAME, T) \ - %template(NAME) simdata::Enum<T>; \ + %template(NAME) csp::Enum<T>; \ CSP_ENUM_WRAP1(T) \ CSP_ENUM_WRAP2(T) Modified: trunk/CSP/csp/csplib/data/test/test_Object.cpp =================================================================== --- trunk/CSP/csp/csplib/data/test/test_Object.cpp 2005-12-11 09:40:15 UTC (rev 1755) +++ trunk/CSP/csp/csplib/data/test/test_Object.cpp 2005-12-11 11:20:11 UTC (rev 1756) @@ -1,8 +1,6 @@ -/* SimData: Data Infrastructure for Simulations +/* Combat Simulator Project * Copyright (C) 2003 Mark Rose <mk...@us...> * - * This file is part of SimData. - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -152,7 +150,7 @@ CSP_TESTCASE(Serialize) { // FIXME using tmpfile would be much better but DataArchive doesn't accept open // stream descriptors. - const std::string tmpfile("/tmp/simdata.tmptest.dar"); + const std::string tmpfile("/tmp/csplib.tmptest.dar"); { TestObject obj1; SubObject2 obj2; Modified: trunk/CSP/csp/csplib/swig/vector.i =================================================================== --- trunk/CSP/csp/csplib/swig/vector.i 2005-12-11 09:40:15 UTC (rev 1755) +++ trunk/CSP/csp/csplib/swig/vector.i 2005-12-11 11:20:11 UTC (rev 1756) @@ -1,8 +1,6 @@ -/* SimData: Data Infrastructure for Simulations +/* Combat Simulator Project * Copyright (C) 2002 Mark Rose <mk...@us...> * - * This file is part of SimData. - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -18,11 +16,11 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __SIMDATA_VECTOR_TEMPLATES__ -#define __SIMDATA_VECTOR_TEMPLATES__ +#ifndef __CSPLIB_VECTOR_TEMPLATES__ +#define __CSPLIB_VECTOR_TEMPLATES__ -#define new_vector(a, b) \ - %template(simdata_vector_##a) std::vector< b >; +#define new_vector(a, b) \ + %template(csplib_vector_##a) std::vector< b >; -#endif // __SIMDATA_VECTOR_TEMPLATES__ +#endif // __CSPLIB_VECTOR_TEMPLATES__ |
From: <sv...@ww...> - 2005-12-11 09:40:26
|
Author: mkrose Date: 2005-12-11 01:40:15 -0800 (Sun, 11 Dec 2005) New Revision: 1755 Modified: trunk/CSP/csp/csplib/util/LogStream.cpp trunk/CSP/csp/csplib/util/Testing.h Log: More win32 cleanups. Fix conversion warnings and import/export errors. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1755 Modified: trunk/CSP/csp/csplib/util/LogStream.cpp =================================================================== --- trunk/CSP/csp/csplib/util/LogStream.cpp 2005-12-11 09:36:03 UTC (rev 1754) +++ trunk/CSP/csp/csplib/util/LogStream.cpp 2005-12-11 09:40:15 UTC (rev 1755) @@ -55,7 +55,7 @@ // available on win32. This implementation should also be faster. void logTime(const time_t t, char *buffer, bool date, bool time) { if (date) { - time_t days = t / 86400; + const uint32 days = static_cast<uint32>(t / 86400); // Taken from glib; originally from the Calendar FAQ. Offset adjusted for // the unix epoch (rather than the Julian Period starting 1 Jan 4713 BC). @@ -77,7 +77,7 @@ if (time) *buffer++ = ' '; } if (time) { - time_t secs = t % 86400; + int secs = static_cast<int>(t % 86400); int hour = secs / 3600; int min = (secs % 3600) / 60; int sec = secs % 60; Modified: trunk/CSP/csp/csplib/util/Testing.h =================================================================== --- trunk/CSP/csp/csplib/util/Testing.h 2005-12-11 09:36:03 UTC (rev 1754) +++ trunk/CSP/csp/csplib/util/Testing.h 2005-12-11 09:40:15 UTC (rev 1755) @@ -243,14 +243,14 @@ */ class CSPLIB_EXPORT TestRegistry: public NonConstructable { public: - static CSPLIB_EXPORT bool loadTestModule(const char *module); - static CSPLIB_EXPORT bool runAll(); - static CSPLIB_EXPORT bool runOnePath(const char *path); - static CSPLIB_EXPORT bool runOneTest(const char *test); - static CSPLIB_EXPORT void addTestRunner(TestRunner *runner); + static bool loadTestModule(const char *module); + static bool runAll(); + static bool runOnePath(const char *path); + static bool runOneTest(const char *test); + static void addTestRunner(TestRunner *runner); private: - static CSPLIB_EXPORT bool _runTests(std::vector<TestRunner*> const &tests); + static bool _runTests(std::vector<TestRunner*> const &tests); struct TestData; static TestData &data(); }; |
From: <sv...@ww...> - 2005-12-11 09:36:15
|
Author: mkrose Date: 2005-12-11 01:36:03 -0800 (Sun, 11 Dec 2005) New Revision: 1754 Modified: trunk/CSP/csp/csplib/thread/AtomicCounter.h trunk/CSP/csp/csplib/util/LogStream.cpp Log: Replace gmtime_r call, which doesn't exist on win32. Also fix a couple warnings under win32. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1754 Modified: trunk/CSP/csp/csplib/thread/AtomicCounter.h =================================================================== --- trunk/CSP/csp/csplib/thread/AtomicCounter.h 2005-12-11 07:20:54 UTC (rev 1753) +++ trunk/CSP/csp/csplib/thread/AtomicCounter.h 2005-12-11 09:36:03 UTC (rev 1754) @@ -68,14 +68,14 @@ * will always return true (unless the count overflows or is otherwise * decremented past zero). */ - inline bool operator++() { return ++__count; } + inline bool operator++() { return (++__count != 0); } /** Decrement the counter. * * @returns true if the pre-decremented count is non-zero, * regardless of the actual value; false otherwise. */ - inline bool operator--() { return --__count; } + inline bool operator--() { return (--__count != 0); } /** Return the counter value. */ Modified: trunk/CSP/csp/csplib/util/LogStream.cpp =================================================================== --- trunk/CSP/csp/csplib/util/LogStream.cpp 2005-12-11 07:20:54 UTC (rev 1753) +++ trunk/CSP/csp/csplib/util/LogStream.cpp 2005-12-11 09:36:03 UTC (rev 1754) @@ -45,6 +45,49 @@ namespace { typedef std::map<std::string, LogStream *> LogStreamRegistry; LogStreamRegistry *NamedLogStreamRegistry = 0; + + inline void writeDigits(char *&buffer, int value) { + *buffer++ = '0' + value / 10; + *buffer++ = '0' + value % 10; + } + + // Replaced gmtime_r and strftime with logTime, mainly because gmtime_r isn't + // available on win32. This implementation should also be faster. + void logTime(const time_t t, char *buffer, bool date, bool time) { + if (date) { + time_t days = t / 86400; + + // Taken from glib; originally from the Calendar FAQ. Offset adjusted for + // the unix epoch (rather than the Julian Period starting 1 Jan 4713 BC). + const uint32 A = days + 2440588 + 32045; + const uint32 B = (4 *(A + 36524)) / 146097 - 1; + const uint32 C = A - (146097*B) / 4; + const uint32 D = (4 * (C + 365)) / 1461 - 1; + const uint32 E = C - ((1461 * D) / 4); + const uint32 M = (5 * (E - 1) + 2) / 153; + + int year = static_cast<int>(100 * B + D - 4800 + (M/10)); + int month = static_cast<int>(M + 3 - 12 * (M/10)); + int day = static_cast<int>(E - (153 * M + 2) / 5); + + writeDigits(buffer, year / 100); + writeDigits(buffer, year % 100); + writeDigits(buffer, month); + writeDigits(buffer, day); + if (time) *buffer++ = ' '; + } + if (time) { + time_t secs = t % 86400; + int hour = secs / 3600; + int min = (secs % 3600) / 60; + int sec = secs % 60; + writeDigits(buffer, hour); + writeDigits(buffer, min); + writeDigits(buffer, sec); + } + *buffer = 0; + } + } @@ -80,17 +123,8 @@ } if (flags & (LogStream::cTimestamp|LogStream::cDatestamp)) { const time_t now = time(0); - struct tm gmt; - gmtime_r(&now, &gmt); char time_stamp[32]; - switch (flags & (LogStream::cTimestamp|LogStream::cDatestamp)) { - case LogStream::cTimestamp: - strftime(time_stamp, 32, "%H%M%S", &gmt); break; - case LogStream::cDatestamp: - strftime(time_stamp, 32, "%Y%m%d", &gmt); break; - default: - strftime(time_stamp, 32, "%Y%m%d %H%M%S", &gmt); - } + logTime(now, time_stamp, (flags & LogStream::cTimestamp) != 0, (flags & LogStream::cDatestamp) != 0); m_buffer << time_stamp << ' '; } #ifndef CSP_NOTHREADS |