diff --git a/code/nel/include/nel/misc/mem_stream.h b/code/nel/include/nel/misc/mem_stream.h index a9e8aacfc..4222e1672 100644 --- a/code/nel/include/nel/misc/mem_stream.h +++ b/code/nel/include/nel/misc/mem_stream.h @@ -210,7 +210,7 @@ public: * \return the new offset regarding from the origin. * \see ESeekNotSupported SeekOrigin seek */ - virtual sint32 getPos () const throw(EStream) + virtual sint32 getPos () const { return sint32(_Buffer.Pos); } diff --git a/code/nel/include/nel/misc/types_nl.h b/code/nel/include/nel/misc/types_nl.h index 71702bce5..6431701fe 100644 --- a/code/nel/include/nel/misc/types_nl.h +++ b/code/nel/include/nel/misc/types_nl.h @@ -79,6 +79,9 @@ # elif _MSC_VER >= 1600 # define NL_COMP_VC10 # define NL_COMP_VC_VERSION 100 +# ifdef _HAS_CPP0X +# undef _HAS_CPP0X // VC++ 2010 doesn't implement C++11 stuff we need +# endif # elif _MSC_VER >= 1500 # define NL_COMP_VC9 # define NL_COMP_VC_VERSION 90 @@ -409,8 +412,16 @@ typedef unsigned int uint; // at least 32bits (depend of processor) #define NL_DEFAULT_MEMORY_ALIGNMENT 16 #define NL_ALIGN_SSE2 NL_ALIGN(NL_DEFAULT_MEMORY_ALIGNMENT) -#ifndef NL_CPU_X86_64 +#ifdef NL_CPU_X86_64 // on x86_64, new and delete are already aligned on 16 bytes +#elif (defined(NL_COMP_VC) && defined(NL_DEBUG)) +// don't use aligned memory if debugging with VC++ in 32 bits +#else +// use aligned memory in all other cases +#define NL_USE_ALIGNED_MEMORY_OPERATORS +#endif + +#ifdef NL_USE_ALIGNED_MEMORY_OPERATORS #ifdef NL_NO_EXCEPTION_SPECS extern void *operator new(size_t size); @@ -422,9 +433,9 @@ extern void *operator new(size_t size) throw(std::bad_alloc); extern void *operator new[](size_t size) throw(std::bad_alloc); extern void operator delete(void *p) throw(); extern void operator delete[](void *p) throw(); -#endif +#endif /* NL_NO_EXCEPTION_SPECS */ -#endif +#endif /* NL_USE_ALIGNED_MEMORY_OPERATORS */ #else /* NL_HAS_SSE2 */ diff --git a/code/nel/include/nel/net/module.h b/code/nel/include/nel/net/module.h index 0b5b158d2..05cd48fed 100644 --- a/code/nel/include/nel/net/module.h +++ b/code/nel/include/nel/net/module.h @@ -780,7 +780,7 @@ namespace NLNET bool initModule(const TParsedCommandLine &initInfo); void plugModule(IModuleSocket *moduleSocket); - void unplugModule(IModuleSocket *moduleSocket) throw (EModuleNotPluggedHere); + void unplugModule(IModuleSocket *moduleSocket); void getPluggedSocketList(std::vector &resultList); void invokeModuleOperation(IModuleProxy *destModule, const NLNET::CMessage &opMsg, NLNET::CMessage &resultMsg); void _onModuleUp(IModuleProxy *removedProxy); diff --git a/code/nel/src/3d/driver/direct3d/driver_direct3d.h b/code/nel/src/3d/driver/direct3d/driver_direct3d.h index 6621ab6cb..51c21bbc9 100644 --- a/code/nel/src/3d/driver/direct3d/driver_direct3d.h +++ b/code/nel/src/3d/driver/direct3d/driver_direct3d.h @@ -849,7 +849,7 @@ public: // Mode initialisation, requests virtual bool init (uintptr_t windowIcon = 0, emptyProc exitFunc = 0); - virtual bool setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool resizeable + virtual bool setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool resizeable); virtual bool release(); virtual bool setMode(const GfxMode& mode); virtual bool getModes(std::vector &modes); diff --git a/code/nel/src/3d/water_height_map.cpp b/code/nel/src/3d/water_height_map.cpp index 5f67ffce3..6fe88a8bc 100644 --- a/code/nel/src/3d/water_height_map.cpp +++ b/code/nel/src/3d/water_height_map.cpp @@ -677,7 +677,7 @@ void CWaterHeightMap::setWaves(float intensity, float period, uint radius, bool void CWaterHeightMap::serial(NLMISC::IStream &f) { f.xmlPushBegin("WaterHeightMap"); - f.xmlSetAttrib ("NAME") ; + f.xmlSetAttrib ("NAME"); f.serial (_Name); f.xmlPushEnd(); (void)f.serialVersion(0); diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index c289d2135..0b1460bb3 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -459,7 +459,7 @@ namespace NLGUI #endif // Display cached image while downloading new - if (type != TImageType::OverImage && CFile::fileExists(dest)) + if (type != OverImage && CFile::fileExists(dest)) { setImage(img, dest, type); setImageSize(img, style); @@ -4713,7 +4713,7 @@ namespace NLGUI if (overBitmap != normalBitmap) { over = localImageName(overBitmap); - addImageDownload(overBitmap, ctrlButton, style, TImageType::OverImage); + addImageDownload(overBitmap, ctrlButton, style, OverImage); } } diff --git a/code/nel/src/misc/class_registry.cpp b/code/nel/src/misc/class_registry.cpp index 91c603c90..c703e45d0 100644 --- a/code/nel/src/misc/class_registry.cpp +++ b/code/nel/src/misc/class_registry.cpp @@ -49,7 +49,7 @@ void CClassRegistry::release() } // ====================================================================================================== -IClassable *CClassRegistry::create(const string &className) throw(ERegistry) +IClassable *CClassRegistry::create(const string &className) { init(); @@ -72,7 +72,7 @@ IClassable *CClassRegistry::create(const string &className) throw(ERegistry) } // ====================================================================================================== -void CClassRegistry::registerClass(const string &className, IClassable* (*creator)(), const string &typeidCheck) throw(ERegistry) +void CClassRegistry::registerClass(const string &className, IClassable* (*creator)(), const string &typeidCheck) { init(); diff --git a/code/nel/src/misc/common.cpp b/code/nel/src/misc/common.cpp index db605f4f1..599f3cfb2 100644 --- a/code/nel/src/misc/common.cpp +++ b/code/nel/src/misc/common.cpp @@ -80,7 +80,7 @@ extern "C" long _ftol2( double dblSource ) { return _ftol( dblSource ); } #endif // !NL_COMP_MINGW -#if defined(NL_HAS_SSE2) && !defined(NL_CPU_X86_64) +#ifdef NL_USE_ALIGNED_MEMORY_OPERATORS #ifdef NL_NO_EXCEPTION_SPECS void *operator new(size_t size) diff --git a/code/nel/tools/3d/object_viewer/particle_workspace.cpp b/code/nel/tools/3d/object_viewer/particle_workspace.cpp index 43be30812..1a289d2b0 100644 --- a/code/nel/tools/3d/object_viewer/particle_workspace.cpp +++ b/code/nel/tools/3d/object_viewer/particle_workspace.cpp @@ -357,7 +357,7 @@ void CParticleWorkspace::setName(const std::string &name) //*********************************************************************************************** -CParticleWorkspace::CNode *CParticleWorkspace::addNode(const std::string &filenameWithFullPath) throw( NLMISC::EStream) +CParticleWorkspace::CNode *CParticleWorkspace::addNode(const std::string &filenameWithFullPath) { nlassert(_OV); // Check that file is not already inserted diff --git a/code/ryzom/client/src/interface_v3/chat_text_manager.cpp b/code/ryzom/client/src/interface_v3/chat_text_manager.cpp index e21872018..a9a682bf1 100644 --- a/code/ryzom/client/src/interface_v3/chat_text_manager.cpp +++ b/code/ryzom/client/src/interface_v3/chat_text_manager.cpp @@ -187,7 +187,21 @@ static inline bool isUrlTag(const ucstring &s, ucstring::size_type index, ucstri if (isUrl && i > 0 && !markdown) { // '}' is in the list because of color tags, ie "@{FFFF}http://..." - const vector chars {' ', '"', '\'', '(', '[', '}'}; +#ifdef NL_ISO_CPP0X_AVAILABLE + const vector chars{ ' ', '"', '\'', '(', '[', '}' }; +#else + static std::vector chars; + + if (chars.empty()) + { + chars.push_back(' '); + chars.push_back('"'); + chars.push_back('\''); + chars.push_back('('); + chars.push_back('['); + chars.push_back('}'); + } +#endif isUrl = std::find(chars.begin(), chars.end(), s[i - 1]) != chars.end(); } return isUrl; diff --git a/code/ryzom/client/src/item_group_manager.cpp b/code/ryzom/client/src/item_group_manager.cpp index e72f2d730..fddba873f 100644 --- a/code/ryzom/client/src/item_group_manager.cpp +++ b/code/ryzom/client/src/item_group_manager.cpp @@ -83,8 +83,8 @@ void CItemGroup::addItem(sint32 createTime, sint32 serial, SLOT_EQUIPMENT::TSlot nldebug("Not adding duplicate item, createTime: %d, serial: %d", createTime, serial); //In this case, we are adding the duplicate item for a 2 hands item //If it's saved as a left hand item, save it as a right hand item instead (so we have only 1 correct item) - if(Items[i].slot == SLOT_EQUIPMENT::TSlotEquipment::HANDL && slot == SLOT_EQUIPMENT::TSlotEquipment::HANDR) - Items[i].slot = SLOT_EQUIPMENT::TSlotEquipment::HANDR; + if(Items[i].slot == SLOT_EQUIPMENT::HANDL && slot == SLOT_EQUIPMENT::HANDR) + Items[i].slot = SLOT_EQUIPMENT::HANDR; return; } } @@ -389,7 +389,7 @@ CItemGroup CItemGroupManager::migrateGroup(CItemGroup group) //Get all matching items from all inventory CItemGroup out; out.name = group.name; - for (int i=0; i < INVENTORIES::TInventory::NUM_ALL_INVENTORY; i++) + for (int i=0; i < INVENTORIES::NUM_ALL_INVENTORY; i++) { INVENTORIES::TInventory inventory = (INVENTORIES::TInventory)i; std::vector items = matchingItems(&group, inventory); @@ -501,7 +501,7 @@ bool CItemGroupManager::moveGroup(std::string name, INVENTORIES::TInventory dst) std::string moveParams = "to=lists|nblist=1|listsheet0=" + toDbPath(dst); // Grab all matching item from all available inventory and put it in dst - for (int i=0; i< INVENTORIES::TInventory::NUM_ALL_INVENTORY; i ++) + for (int i=0; i< INVENTORIES::NUM_ALL_INVENTORY; i ++) { INVENTORIES::TInventory inventory = (INVENTORIES::TInventory)i; if (inventory != dst && pIM->isInventoryAvailable(inventory)) @@ -531,7 +531,7 @@ bool CItemGroupManager::equipGroup(std::string name, bool pullBefore) return false; } - if(pullBefore) moveGroup(name, INVENTORIES::TInventory::bag); + if(pullBefore) moveGroup(name, INVENTORIES::bag); //Start by unequipping all slot that user wants to unequip for(int i=0; i < group->removeBeforeEquip.size(); i++) { @@ -547,6 +547,7 @@ bool CItemGroupManager::equipGroup(std::string name, bool pullBefore) uint32 maxEquipTime = 0; +#ifdef NL_ISO_CPP0X_AVAILABLE std::map possiblyDual = { {ITEM_TYPE::ANKLET, false}, @@ -554,8 +555,17 @@ bool CItemGroupManager::equipGroup(std::string name, bool pullBefore) {ITEM_TYPE::EARING, false}, {ITEM_TYPE::RING, false}, }; +#else + std::map possiblyDual; + + possiblyDual[ITEM_TYPE::ANKLET] = false; + possiblyDual[ITEM_TYPE::BRACELET] = false; + possiblyDual[ITEM_TYPE::EARING] = false; + possiblyDual[ITEM_TYPE::RING] = false; +#endif + std::vector duals; - std::vector items = matchingItems(group, INVENTORIES::TInventory::bag); + std::vector items = matchingItems(group, INVENTORIES::bag); for(int i=0; i < items.size(); i++) { CInventoryItem item = items[i]; @@ -713,19 +723,19 @@ std::string CItemGroupManager::toDbPath(INVENTORIES::TInventory inventory) { switch(inventory) { - case INVENTORIES::TInventory::bag: + case INVENTORIES::bag: return LIST_BAG_TEXT; break; - case INVENTORIES::TInventory::pet_animal1: + case INVENTORIES::pet_animal1: return LIST_PA0_TEXT; break; - case INVENTORIES::TInventory::pet_animal2: + case INVENTORIES::pet_animal2: return LIST_PA1_TEXT; break; - case INVENTORIES::TInventory::pet_animal3: + case INVENTORIES::pet_animal3: return LIST_PA2_TEXT; break; - case INVENTORIES::TInventory::pet_animal4: + case INVENTORIES::pet_animal4: return LIST_PA3_TEXT; break; - case INVENTORIES::TInventory::player_room: + case INVENTORIES::player_room: return LIST_ROOM_TEXT;break; - case INVENTORIES::TInventory::guild: + case INVENTORIES::guild: return ClientCfg.ItemGroupAllowGuild ? LIST_GUILD_TEXT : ""; break; default: return ""; diff --git a/code/ryzom/server/src/ai_service/ai_script_comp.cpp b/code/ryzom/server/src/ai_service/ai_script_comp.cpp index d076e6832..69c4c9bab 100644 --- a/code/ryzom/server/src/ai_service/ai_script_comp.cpp +++ b/code/ryzom/server/src/ai_service/ai_script_comp.cpp @@ -83,7 +83,7 @@ std::string CFightSelectFilter::toString() const -CFightScriptComp *CFightSelectFilterReader::create (const std::string &inStr) throw (ReadFightActionException) +CFightScriptComp *CFightSelectFilterReader::create (const std::string &inStr) { std::vector params; explodeSubStrings(inStr, params, -1); @@ -151,7 +151,7 @@ public: CFightOnceReader() {} virtual ~CFightOnceReader() {} - CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException) + CFightScriptComp *create (const std::string &inStr) { vector params; explodeSubStrings(inStr, params, -1); @@ -229,7 +229,7 @@ public: CFightTimedFilterReader() {} virtual ~CFightTimedFilterReader() {} - CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException) + CFightScriptComp *create (const std::string &inStr) { vector params; explodeSubStrings(inStr, params, -1); @@ -302,7 +302,7 @@ public: CFightHPLessFilterReader() {} virtual ~CFightHPLessFilterReader() {} - CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException) + CFightScriptComp *create (const std::string &inStr) { vector params; explodeSubStrings(inStr, params, -1); @@ -372,7 +372,7 @@ public: CFightHPMoreFilterReader() {} virtual ~CFightHPMoreFilterReader() {} - CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException) + CFightScriptComp *create (const std::string &inStr) { vector params; explodeSubStrings(inStr, params, -1); @@ -443,7 +443,7 @@ public: CFightRandomFilterReader() {} virtual ~CFightRandomFilterReader() {} - CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException) + CFightScriptComp *create (const std::string &inStr) { vector params; explodeSubStrings(inStr, params, -1); @@ -523,7 +523,7 @@ public: CFightSendActionReader() {} virtual ~CFightSendActionReader() {} - CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException) + CFightScriptComp *create (const std::string &inStr) { vector strings; explodeSubStrings(inStr, strings, -1); @@ -588,7 +588,7 @@ public: CFightSendSelfActionReader() {} virtual ~CFightSendSelfActionReader() {} - CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException) + CFightScriptComp *create (const std::string &inStr) { vector strings; explodeSubStrings(inStr, strings, -1); @@ -647,7 +647,7 @@ public: CFightAggroBlockReader() {} virtual ~CFightAggroBlockReader() {} - CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException) + CFightScriptComp *create (const std::string &inStr) { vector strings; explodeSubStrings(inStr, strings, -1); @@ -705,7 +705,7 @@ public: CFightAggroChangeReader() {} virtual ~CFightAggroChangeReader() {} - CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException) + CFightScriptComp *create (const std::string &inStr) { return new CFightAggroChange(); } @@ -751,7 +751,7 @@ public: CFightDamageCoefReader() {} virtual ~CFightDamageCoefReader() {} - CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException) + CFightScriptComp *create (const std::string &inStr) { vector strings; explodeSubStrings(inStr, strings, -1); @@ -818,7 +818,7 @@ public: CFightGroupDamageCoefReader() {} virtual ~CFightGroupDamageCoefReader() {} - CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException) + CFightScriptComp *create (const std::string &inStr) { vector strings; explodeSubStrings(inStr, strings, -1); @@ -871,7 +871,7 @@ public: CFightDamageSpeedCoefReader() {} virtual ~CFightDamageSpeedCoefReader() {} - CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException) + CFightScriptComp *create (const std::string &inStr) { vector strings; explodeSubStrings(inStr, strings, -1); @@ -933,7 +933,7 @@ public: CFightSetRandomTargetReader() {} virtual ~CFightSetRandomTargetReader() {} - CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException) + CFightScriptComp *create (const std::string &inStr) { vector strings; explodeSubStrings(inStr, strings, -1); @@ -1003,7 +1003,7 @@ public: CFightMultReader() {} virtual ~CFightMultReader() {} - CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException) + CFightScriptComp *create (const std::string &inStr) { vector params; explodeSubStrings(inStr, params, -1); @@ -1075,7 +1075,7 @@ CFightScriptCompReader *CFightScriptCompReader::getScriptReader (const string &s return &(*(it->second)); } -CFightScriptComp *CFightScriptCompReader::createScriptComp (const string &str) throw (ReadFightActionException) +CFightScriptComp *CFightScriptCompReader::createScriptComp (const string &str) { string scriptCompName; { diff --git a/code/ryzom/server/src/ai_service/ai_script_comp.h b/code/ryzom/server/src/ai_service/ai_script_comp.h index 0b02cc722..a35253d66 100644 --- a/code/ryzom/server/src/ai_service/ai_script_comp.h +++ b/code/ryzom/server/src/ai_service/ai_script_comp.h @@ -51,12 +51,12 @@ public: {} virtual ~CFightScriptCompReader() {} - virtual CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException) = 0; + virtual CFightScriptComp *create (const std::string &inStr) = 0; virtual std::string getName () const =0; static CFightScriptCompReader *getScriptReader (const std::string &str); - static CFightScriptComp *createScriptComp (const std::string &str) throw (ReadFightActionException); + static CFightScriptComp *createScriptComp (const std::string &str) protected: private: }; @@ -116,7 +116,7 @@ public: CFightSelectFilterReader() {} virtual ~CFightSelectFilterReader() {} - CFightScriptComp *create (const std::string &inStr) throw (ReadFightActionException); + CFightScriptComp *create (const std::string &inStr) std::string getName () const { return std::string("SELECT"); diff --git a/code/ryzom/server/src/ai_service/event_reaction.h b/code/ryzom/server/src/ai_service/event_reaction.h index 1f92d3047..57dcf22d0 100644 --- a/code/ryzom/server/src/ai_service/event_reaction.h +++ b/code/ryzom/server/src/ai_service/event_reaction.h @@ -90,7 +90,7 @@ public: // the following routine shouldn't be needed it should be superceded by a better alternative // in the event manager template - bool testCompatibility(CStateInstance *const stateInstance, const TState *const state) const; + bool testCompatibility(const CStateInstance *stateInstance, const TState *state) const protected: // protected data --------------------------------------------------- diff --git a/code/ryzom/server/src/ai_service/event_reaction_include.h b/code/ryzom/server/src/ai_service/event_reaction_include.h index 3c44b03dc..04fd2c16f 100644 --- a/code/ryzom/server/src/ai_service/event_reaction_include.h +++ b/code/ryzom/server/src/ai_service/event_reaction_include.h @@ -28,7 +28,7 @@ #include "continent.h"*/ template -bool CAIEventReaction::testCompatibility(CStateInstance *const stateInstance, const TState *const state) const +bool CAIEventReaction::testCompatibility(const CStateInstance *stateInstance, const TState *state) const { if (!stateInstance) return false; diff --git a/code/ryzom/server/src/input_output_service/chat_manager.h b/code/ryzom/server/src/input_output_service/chat_manager.h index 658a72d81..a64b68d52 100644 --- a/code/ryzom/server/src/input_output_service/chat_manager.h +++ b/code/ryzom/server/src/input_output_service/chat_manager.h @@ -101,7 +101,7 @@ public : * Get the client infos * \param id is the client character id */ - CChatClient& getClient( const TDataSetRow& id ); //throw (EChatClient); + CChatClient& getClient( const TDataSetRow& id ); /** * Return a reference on the static database