From 7ffb0a94f480c7c3770e405db2afe3437b468dff Mon Sep 17 00:00:00 2001 From: TTimo Date: Sun, 6 Aug 2017 17:22:08 -0500 Subject: [PATCH] wip removing old STLPort and cleaning up to std:: --- config.py | 1 - contrib/bobtoolz/DPatch.cpp | 2 +- contrib/bobtoolz/StdAfx.h | 2 +- include/gtkr_list.h | 23 -------- include/gtkr_vector.h | 23 -------- include/stl_check.h | 65 ----------------------- libs/synapse.h | 21 ++++---- libs/synapse/synapse.cpp | 40 +++++++------- plugins/model/cpicomodel.cpp | 2 +- plugins/model/cpicomodel.h | 6 +-- plugins/model/remap.cpp | 6 +-- plugins/surface/surfacedialog.cpp | 4 +- plugins/surface_idtech2/surfacedialog.cpp | 4 +- radiant/mainframe.cpp | 2 +- radiant/mainframe.h | 4 +- radiant/pluginmanager.cpp | 20 +++---- radiant/pluginmanager.h | 6 +-- radiant/pmesh.cpp | 16 +++--- radiant/preferences.cpp | 20 +++---- radiant/preferences.h | 9 ++-- 20 files changed, 82 insertions(+), 194 deletions(-) delete mode 100644 include/gtkr_list.h delete mode 100644 include/gtkr_vector.h delete mode 100644 include/stl_check.h diff --git a/config.py b/config.py index dce2faad..1556d0da 100644 --- a/config.py +++ b/config.py @@ -232,7 +232,6 @@ class Config: env.Append( CCFLAGS = baseflags ) env.Append( CXXFLAGS = baseflags + [ '-fpermissive', '-fvisibility-inlines-hidden' ] ) env.Append( CPPPATH = [ 'include', 'libs' ] ) - env.Append( CPPDEFINES = [ 'Q_NO_STLPORT' ] ) if ( config == 'debug' ): env.Append( CFLAGS = [ '-g' ] ) env.Append( CXXFLAGS = [ '-g' ] ) diff --git a/contrib/bobtoolz/DPatch.cpp b/contrib/bobtoolz/DPatch.cpp index aa0d52b7..245adb1c 100644 --- a/contrib/bobtoolz/DPatch.cpp +++ b/contrib/bobtoolz/DPatch.cpp @@ -335,7 +335,7 @@ void DPatch::Transpose(){ Invert(); } -list DPatch::Split( bool rows, bool cols ){ +std::list DPatch::Split( bool rows, bool cols ){ list patchList; int i; int x, y; diff --git a/contrib/bobtoolz/StdAfx.h b/contrib/bobtoolz/StdAfx.h index 3e8832dc..37fd8d39 100644 --- a/contrib/bobtoolz/StdAfx.h +++ b/contrib/bobtoolz/StdAfx.h @@ -151,6 +151,6 @@ extern _QEREntityTable g_EntityTable; #define MAX_ROUND_ERROR 0.05 -#include "gtkr_list.h" +#include #endif diff --git a/include/gtkr_list.h b/include/gtkr_list.h deleted file mode 100644 index 767c7f8e..00000000 --- a/include/gtkr_list.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - Copyright (C) 1999-2007 id Software, Inc. and contributors. - For a list of contributors, see the accompanying CONTRIBUTORS file. - - This file is part of GtkRadiant. - - GtkRadiant 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. - - GtkRadiant 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 GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include -#include "stl_check.h" diff --git a/include/gtkr_vector.h b/include/gtkr_vector.h deleted file mode 100644 index c7394cac..00000000 --- a/include/gtkr_vector.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - Copyright (C) 1999-2007 id Software, Inc. and contributors. - For a list of contributors, see the accompanying CONTRIBUTORS file. - - This file is part of GtkRadiant. - - GtkRadiant 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. - - GtkRadiant 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 GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include -#include "stl_check.h" diff --git a/include/stl_check.h b/include/stl_check.h deleted file mode 100644 index b08142bd..00000000 --- a/include/stl_check.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - Copyright (C) 1999-2007 id Software, Inc. and contributors. - For a list of contributors, see the accompanying CONTRIBUTORS file. - - This file is part of GtkRadiant. - - GtkRadiant 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. - - GtkRadiant 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 GtkRadiant; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/*! - This header is used to make sure the STL we are using is what we expect - this allows to catch some weird errors early at compile time - */ - -// TODO: finish complete cleanup and removal of STLPort usage traces -#ifndef Q_NO_STLPORT -#define Q_NO_STLPORT -#endif - -#ifdef Q_NO_STLPORT - -// not using STLPort (gcc 3.x build) -using namespace std; - -#else - -#ifndef _STLPORT_VERSION -#error "Can't find _STLPORT_VERSION, check you are compiling against STLPort" -#endif - -#if !defined( _STLP_DONT_USE_EXCEPTIONS ) -#error exc -#endif - -#if !defined( _STLP_NO_NAMESPACES ) -#error namespace -#endif - -#if !defined( _STLP_NO_IOSTREAMS ) -#error io -#endif - -// now check a few more things (paranoid) -// if you use our custom STLPort distribution it should be alright though -#if !defined( _STLP_DONT_USE_EXCEPTIONS ) || !defined( _STLP_NO_NAMESPACES ) || !defined( _STLP_NO_IOSTREAMS ) -#error "There is something broken in your STLPort config" -#endif - -#ifdef _WIN32 -#pragma warning(disable : 4786) -#endif - -#endif diff --git a/libs/synapse.h b/libs/synapse.h index 71b83cdf..a98006ac 100644 --- a/libs/synapse.h +++ b/libs/synapse.h @@ -77,8 +77,9 @@ #include "libxml/parser.h" #include "irefcount.h" -#include "gtkr_list.h" -#include "gtkr_vector.h" + +#include +#include #include "str.h" @@ -197,7 +198,7 @@ class CSynapseAPIManager : public IRefCounted EAPIManagerType mType; // the list of APIs we have obtained (SYN_REQUIRE_ANY) -vector< APIDescriptor_t * > mAPIs; +std::vector< APIDescriptor_t * > mAPIs; /*! pattern for matching the major version NOTE: only supported for now: exact match @@ -289,15 +290,15 @@ bool mbActive; /*! we store APIDescriptor_t*, the module fills that in at startup */ -vector mAPIDescriptors; +std::vector mAPIDescriptors; /*! managers for multiple APIs management mManagersMatch are managers with loose matching / undefined number of APIs mManagersList are managers with a fixed list of required interfaces */ -vector mManagersMatch; -vector mManagersList; +std::vector mManagersMatch; +std::vector mManagersList; protected: friend class CSynapseServer; @@ -492,13 +493,13 @@ virtual ~CSynapseClientSlot() { } */ class CSynapseServer : public IRefCounted { -list mSearchPaths; -list mClients; +std::list mSearchPaths; +std::list mClients; /*! used for resolve operations */ -list mStack; +std::list mStack; /*! set this when mStack is modified with new stuff to resolve NOTE: if this hack becomes too tricky to use we could just encapsulate mStack @@ -552,7 +553,7 @@ void TryPushStack( APIDescriptor_t * ); \param iSlot is an mClients iterator, invalid when the function returns as the item will have been removed from the list \return the iterator after erase call so that the caller iteration can continue */ -list::iterator ShutdownClient( list::iterator iSlot ); +std::list::iterator ShutdownClient( std::list::iterator iSlot ); /*! \brief actual implementation of the Resolve function diff --git a/libs/synapse/synapse.cpp b/libs/synapse/synapse.cpp index 74cc07f3..09ec65bd 100644 --- a/libs/synapse/synapse.cpp +++ b/libs/synapse/synapse.cpp @@ -126,7 +126,7 @@ bool CSynapseServer::Initialize( const char* conf_file, PFN_SYN_PRINTF_VA pf ){ } } - for ( list::iterator iPath = mSearchPaths.begin(); iPath != mSearchPaths.end(); iPath++ ) + for ( std::list::iterator iPath = mSearchPaths.begin(); iPath != mSearchPaths.end(); iPath++ ) { const char* path = *iPath; @@ -290,7 +290,7 @@ PFN_SYN_PRINTF_VA CSynapseServer::Get_Syn_Printf(){ } void CSynapseServer::TryPushStack( APIDescriptor_t *pAPI ){ - list::iterator iAPI; + std::list::iterator iAPI; for ( iAPI = mStack.begin(); iAPI != mStack.end(); iAPI++ ) { if ( ( *iAPI ) == pAPI ) { @@ -301,7 +301,7 @@ void CSynapseServer::TryPushStack( APIDescriptor_t *pAPI ){ mbStackChanged = true; } -list::iterator CSynapseServer::ShutdownClient( list::iterator iSlot ){ +std::list::iterator CSynapseServer::ShutdownClient( std::list::iterator iSlot ){ CSynapseClientSlot *pClientSlot = &( *iSlot ); if ( pClientSlot->mpClient->IsActive() ) { // this should not happen except during core shutdown (i.e. editor is shutting down) @@ -314,7 +314,7 @@ list::iterator CSynapseServer::ShutdownClient( listmpClient->GetAPIDescriptor( i ); // search this API in mStack - list< APIDescriptor_t *>::iterator iStack = mStack.begin(); + std::list< APIDescriptor_t *>::iterator iStack = mStack.begin(); while ( iStack != mStack.end() ) { if ( *iStack == pAPI ) { @@ -327,7 +327,7 @@ list::iterator CSynapseServer::ShutdownClient( listmbTableInitDone ) { // even if non active, some SYN_REQUIRE may have been filled up // look for the corresponding SYN_PROVIDE and decref - list< APIDescriptor_t *>::iterator iStackRequire = mStack.begin(); + std::list< APIDescriptor_t *>::iterator iStackRequire = mStack.begin(); APIDescriptor_t *pMatchAPI; while ( iStackRequire != mStack.end() ) { @@ -400,7 +400,7 @@ void CSynapseServer::PushRequired( CSynapseClient *pClient ){ { CSynapseAPIManager *pManager = pClient->GetManagerMatch( i ); // start matching all known SYN_PROVIDE APIs against this manager - list::iterator iClientSlot; + std::list::iterator iClientSlot; for ( iClientSlot = mClients.begin(); iClientSlot != mClients.end(); iClientSlot++ ) { CSynapseClient *pScanClient = ( *iClientSlot ). @@ -428,7 +428,7 @@ void CSynapseServer::PushRequired( CSynapseClient *pClient ){ int CSynapseServer::FindActiveMajorClient( const char * major, APIDescriptor_t ** ret ) const { Syn_Printf( "checking if we have a single active client for major \"%s\"\n", major ); *ret = NULL; - list::const_iterator iClient; + std::list::const_iterator iClient; for ( iClient = mClients.begin(); iClient != mClients.end(); iClient++ ) { CSynapseClient *pClient = ( *iClient ).mpClient; if ( !pClient->IsActive() ) { @@ -507,7 +507,7 @@ int CSynapseServer::MatchAPI( const char* major1, const char* minor1, const char bool CSynapseServer::ResolveAPI( APIDescriptor_t* pAPI ){ //Syn_Printf("In ResolveAPI %s %p '%s' '%s'\n", APITypeName[pAPI->mType], pAPI, pAPI->major_name, pAPI->minor_name); // loop through active clients, search for a client providing what we are looking for - list::iterator iClient; + std::list::iterator iClient; for ( iClient = mClients.begin(); iClient != mClients.end(); iClient++ ) { // walk through interfaces on this client for a match @@ -557,7 +557,7 @@ bool CSynapseServer::ResolveAPI( APIDescriptor_t* pAPI ){ } bool CSynapseServer::DoResolve( CSynapseClient *pClient ){ - list::iterator iSlot; + std::list::iterator iSlot; for ( iSlot = mClients.begin(); iSlot != mClients.end(); iSlot++ ) { if ( ( *iSlot ).mpClient == pClient ) { @@ -585,7 +585,7 @@ bool CSynapseServer::DoResolve( CSynapseClient *pClient ){ // start resolving now // working till the stack is emptied or till we reach a dead end situation // we do a depth first traversal, we will grow the interface stack to be resolved till we start finding solutions - list::iterator iCurrent; + std::list::iterator iCurrent; mbStackChanged = true; // init to true so we try the first elem while ( !mStack.empty() ) { @@ -619,7 +619,7 @@ bool CSynapseServer::DoResolve( CSynapseClient *pClient ){ bool CSynapseServer::Resolve( CSynapseClient *pClient ){ bool ret = DoResolve( pClient ); - list::iterator iClient; + std::list::iterator iClient; iClient = mClients.begin(); while ( iClient != mClients.end() ) { @@ -639,7 +639,7 @@ void CSynapseServer::Shutdown(){ Syn_Printf( "Synapse server core is shutting down\n" ); // do a first pass to shutdown the clients nicely (i.e. decref, release memory and drop everything) // we seperate the client shutdown calls from the dlclose cause that part is a clean decref / free situation whereas dlclose will break links without advice - list::iterator iClient; + std::list::iterator iClient; iClient = mClients.begin(); for ( iClient = mClients.begin(); iClient != mClients.end(); iClient++ ) { @@ -654,7 +654,7 @@ void CSynapseServer::Shutdown(){ } void CSynapseServer::DumpStack(){ - list::iterator iCurrent; + std::list::iterator iCurrent; for ( iCurrent = mStack.begin(); iCurrent != mStack.end(); iCurrent++ ) { APIDescriptor_t*pAPI = *iCurrent; @@ -663,7 +663,7 @@ void CSynapseServer::DumpStack(){ } void CSynapseServer::DumpActiveClients(){ - list::iterator iClient; + std::list::iterator iClient; for ( iClient = mClients.begin(); iClient != mClients.end(); iClient++ ) { CSynapseClient *pClient = ( *iClient ).mpClient; @@ -757,7 +757,7 @@ bool CSynapseServer::GetConfigForAPI( const char *api, char **minor ) { } const char *CSynapseServer::GetModuleFilename( CSynapseClient *pClient ){ - list::iterator iSlot; + std::list::iterator iSlot; for ( iSlot = mClients.begin(); iSlot != mClients.end(); iSlot++ ) { if ( ( *iSlot ).mpClient == pClient ) { @@ -783,7 +783,7 @@ CSynapseClient::CSynapseClient(){ } void CSynapseClient::Shutdown(){ - vector::iterator iAPI; + std::vector::iterator iAPI; for ( iAPI = mAPIDescriptors.begin(); iAPI != mAPIDescriptors.end(); iAPI++ ) { APIDescriptor_t *pAPI = *iAPI; @@ -795,7 +795,7 @@ void CSynapseClient::Shutdown(){ *iAPI = NULL; } mAPIDescriptors.clear(); - vector::iterator iManager; + std::vector::iterator iManager; for ( iManager = mManagersList.begin(); iManager != mManagersList.end(); iManager++ ) { CSynapseAPIManager *pManager = *iManager; @@ -919,7 +919,7 @@ bool CSynapseClient::CheckSetActive(){ } } // if we have managers with fixed list, those need to be completely filled in too - vector::iterator iManager; + std::vector::iterator iManager; for ( iManager = mManagersList.begin(); iManager != mManagersList.end(); iManager++ ) { if ( !( *iManager )->CheckSetActive() ) { @@ -986,7 +986,7 @@ APIDescriptor_t * CSynapseClient::FindProvidesMajor( const char * major ) const } CSynapseAPIManager::~CSynapseAPIManager(){ - vector::iterator iAPI; + std::vector::iterator iAPI; for ( iAPI = mAPIs.begin(); iAPI != mAPIs.end(); iAPI++ ) { APIDescriptor_t *pAPI = *iAPI; @@ -1033,7 +1033,7 @@ bool CSynapseAPIManager::MatchAPI( const char *major, const char *minor ){ /*! if this interface has been allocated already, avoid requesting it again.. */ - vector::iterator iAPI; + std::vector::iterator iAPI; for ( iAPI = mAPIs.begin(); iAPI != mAPIs.end(); iAPI++ ) { if ( CSynapseServer::MatchAPI( ( *iAPI )->major_name, ( *iAPI )->minor_name, major, minor ) ) { diff --git a/plugins/model/cpicomodel.cpp b/plugins/model/cpicomodel.cpp index 8a6a0efb..0c49889a 100644 --- a/plugins/model/cpicomodel.cpp +++ b/plugins/model/cpicomodel.cpp @@ -148,7 +148,7 @@ void CPicoModel::Reload( void ){ } } -void CPicoModel::Draw( int state, vector shaders, int rflags ) const { +void CPicoModel::Draw( int state, std::vector shaders, int rflags ) const { if ( m_pModel ) { for ( unsigned int i = 0; i < m_children->len; i++ ) ( (CPicoSurface*)m_children->pdata[i] )->Draw( state, shaders[i], rflags ); diff --git a/plugins/model/cpicomodel.h b/plugins/model/cpicomodel.h index 6432eb9d..b2e5a0f8 100644 --- a/plugins/model/cpicomodel.h +++ b/plugins/model/cpicomodel.h @@ -25,7 +25,7 @@ #include "plugin.h" #include "picomodel.h" -#include "gtkr_vector.h" +#include class CPicoParent { @@ -36,7 +36,7 @@ virtual void UpdateShaders( void ) = 0; class CModelManager; // forward declaration //typedef std::pair PicoModelKey; -typedef pair PicoModelKey; +typedef std::pair PicoModelKey; class CPicoModel : public IRender, public ISelect { @@ -63,7 +63,7 @@ void RemoveParent( CPicoParent *parent ); void Reload( void ); -void Draw( int state, vector shaders, int rflags ) const; +void Draw( int state, std::vector shaders, int rflags ) const; //IRender virtual void Draw( int state, int rflags ) const; virtual const bool IsModelNotNull() const { return true; } diff --git a/plugins/model/remap.cpp b/plugins/model/remap.cpp index 69683eae..72dcfa80 100644 --- a/plugins/model/remap.cpp +++ b/plugins/model/remap.cpp @@ -75,7 +75,7 @@ typedef CPicoModel value_type; public: typedef PicoModelKey key_type; typedef cache_element elem_type; -typedef map cache_type; +typedef std::map cache_type; value_type* capture( const key_type& key ){ return m_cache[key].capture( key ); @@ -268,9 +268,9 @@ Str m_name; int m_frame; CPicoModel* m_model; -typedef vector remaps_t; +typedef std::vector remaps_t; remaps_t m_remaps; -typedef vector shaders_t; +typedef std::vector shaders_t; shaders_t m_shaders; }; diff --git a/plugins/surface/surfacedialog.cpp b/plugins/surface/surfacedialog.cpp index 14414f28..40dafa1e 100644 --- a/plugins/surface/surfacedialog.cpp +++ b/plugins/surface/surfacedialog.cpp @@ -38,9 +38,9 @@ // #define DBG_SI 1 #endif -#include "gtkr_vector.h" +#include -vector g_texdef_face_vector; +std::vector g_texdef_face_vector; inline texdef_to_face_t* get_texdef_face_list(){ return &( *g_texdef_face_vector.begin() ); diff --git a/plugins/surface_idtech2/surfacedialog.cpp b/plugins/surface_idtech2/surfacedialog.cpp index cf7c2de1..9a59c737 100644 --- a/plugins/surface_idtech2/surfacedialog.cpp +++ b/plugins/surface_idtech2/surfacedialog.cpp @@ -34,9 +34,9 @@ //#define DBG_SI 1 #endif -#include "gtkr_vector.h" +#include -vector g_texdef_face_vector; +std::vector g_texdef_face_vector; inline texdef_to_face_t* get_texdef_face_list(){ return &( *g_texdef_face_vector.begin() ); diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 0134ceb2..8d128d03 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -932,7 +932,7 @@ void MainFrame::process_xlink( Str &FileName, const char *menu_name, const char void MainFrame::create_game_help_menu( GtkWidget *menu, GtkAccelGroup *accel ){ Str FileName; - list::iterator iGame; + std::list::iterator iGame; // start in the global dir FileName = g_strAppPath; diff --git a/radiant/mainframe.h b/radiant/mainframe.h index c61c78f6..aa1cfa87 100644 --- a/radiant/mainframe.h +++ b/radiant/mainframe.h @@ -31,7 +31,7 @@ #include "pluginmanager.h" #include "plugin.h" -#include "gtkr_vector.h" +#include #ifdef __APPLE__ #define __toascii( c ) ( ( c ) & 0x7f ) @@ -469,7 +469,7 @@ protected: /*! the urls to fire up in the game packs help menus */ -vector mHelpURLs; +std::vector mHelpURLs; /*! scan the .game files for game install packs diff --git a/radiant/pluginmanager.cpp b/radiant/pluginmanager.cpp index f25eb1f4..a73349f5 100644 --- a/radiant/pluginmanager.cpp +++ b/radiant/pluginmanager.cpp @@ -107,8 +107,8 @@ private: string_t m_name; string_t m_pattern; }; -typedef vector filetype_list_t; -map m_typelists; +typedef std::vector filetype_list_t; +std::map m_typelists; }; static RadiantFileTypeRegistry g_patterns; @@ -141,7 +141,7 @@ void InitFileTypes(){ class CRadiantModelModuleManager : public CSynapseAPIManager { -typedef list APIDescriptorList; +typedef std::list APIDescriptorList; APIDescriptorList mAPIs; public: @@ -298,7 +298,7 @@ IModelCache* GetModelCache(){ // toolbar manager class CRadiantToolbarModuleManager : public CSynapseAPIManager { -typedef list APIDescriptorList; +typedef std::list APIDescriptorList; APIDescriptorList mAPIs; public: @@ -351,7 +351,7 @@ CRadiantToolbarModuleManager g_ToolbarModuleManager; /* image manager ---------------------------------------- */ CRadiantImageManager::~CRadiantImageManager(){ - list::iterator iSlot; + std::list::iterator iSlot; for ( iSlot = mSlots.begin(); iSlot != mSlots.end(); iSlot++ ) { delete *iSlot; @@ -393,7 +393,7 @@ void CRadiantImageManager::LoadImage( const char *name, byte **pic, int *width, if ( ext == NULL ) { // if no extension is provided, start walking through the list Str fullname; - list::iterator iSlot; + std::list::iterator iSlot; for ( iSlot = mSlots.begin(); iSlot != mSlots.end(); iSlot++ ) { APIDescriptor_t *pAPI = ( *iSlot )->GetDescriptor(); @@ -407,7 +407,7 @@ void CRadiantImageManager::LoadImage( const char *name, byte **pic, int *width, } // start walking the interfaces - list::iterator iSlot; + std::list::iterator iSlot; for ( iSlot = mSlots.begin(); iSlot != mSlots.end(); iSlot++ ) { APIDescriptor_t *pAPI = ( *iSlot )->GetDescriptor(); @@ -440,7 +440,7 @@ APIDescriptor_t* CRadiantPluginManager::BuildRequireAPI( APIDescriptor_t *pAPI ) } void CRadiantPluginManager::PopulateMenu(){ - list::iterator iPlug; + std::list::iterator iPlug; for ( iPlug = mSlots.begin(); iPlug != mSlots.end(); iPlug++ ) { g_pParentWnd->AddPlugInMenuItem( *iPlug ); @@ -558,7 +558,7 @@ void CPluginSlot::Dispatch( const char *p ){ } CRadiantPluginManager::~CRadiantPluginManager(){ - list::iterator iSlot; + std::list::iterator iSlot; for ( iSlot = mSlots.begin(); iSlot != mSlots.end(); iSlot++ ) { delete *iSlot; @@ -567,7 +567,7 @@ CRadiantPluginManager::~CRadiantPluginManager(){ } bool CRadiantPluginManager::Dispatch( int n, const char* p ){ - list::iterator iPlug; + std::list::iterator iPlug; for ( iPlug = mSlots.begin(); iPlug != mSlots.end(); iPlug++ ) { CPluginSlot *pPlug = *iPlug; diff --git a/radiant/pluginmanager.h b/radiant/pluginmanager.h index 37b9beda..db40338a 100644 --- a/radiant/pluginmanager.h +++ b/radiant/pluginmanager.h @@ -142,7 +142,7 @@ bool ownsCommandID( int n ); class CRadiantPluginManager : public CSynapseAPIManager { -list mSlots; +std::list mSlots; public: CRadiantPluginManager() {} virtual ~CRadiantPluginManager(); @@ -182,9 +182,9 @@ void InitForFillAPITable( APIDescriptor_t *pAPI ); class CRadiantImageManager : public CSynapseAPIManager { -list mSlots; +std::list mSlots; -list::iterator mExtScanSlot; +std::list::iterator mExtScanSlot; public: CRadiantImageManager() {} virtual ~CRadiantImageManager(); diff --git a/radiant/pmesh.cpp b/radiant/pmesh.cpp index 1f0db766..6f7b6de1 100644 --- a/radiant/pmesh.cpp +++ b/radiant/pmesh.cpp @@ -29,7 +29,7 @@ #include "stdafx.h" #include "gtkmisc.h" -#include "gtkr_list.h" +#include // externs extern void MemFile_fprintf( MemStream* pMemFile, const char* pText, ... ); @@ -2901,7 +2901,7 @@ void Patch_TransformLODTexture( patchMesh_t *p, float fx, float fy, transformtyp BTree_TransformTexture( p->colLOD[( ( ( row - 1 ) / 2 ) * p->width ) + col], fx, fy, xform ); } -void Patch_AddBTreeToDrawListInOrder( list *drawList, BTNode_t *pBT ){ +void Patch_AddBTreeToDrawListInOrder( std::list *drawList, BTNode_t *pBT ){ if ( pBT != NULL ) { //traverse InOrder Patch_AddBTreeToDrawListInOrder( drawList, pBT->left ); if ( pBT->left != NULL && pBT->right != NULL ) { @@ -2911,7 +2911,7 @@ void Patch_AddBTreeToDrawListInOrder( list *drawList, BTNode_t *pBT } } -void Patch_InterpolateListFromRowBT( list *drawList, BTNode_t *rowBT, BTNode_t *rowBTLeft, drawVert_t *vCurve[], float u, float n, float v ){ +void Patch_InterpolateListFromRowBT( std::list *drawList, BTNode_t *rowBT, BTNode_t *rowBTLeft, drawVert_t *vCurve[], float u, float n, float v ){ if ( rowBT != NULL ) { Patch_InterpolateListFromRowBT( drawList, rowBT->left, rowBTLeft->left, vCurve, u - n, n * 0.5f, v ); if ( rowBT->left != NULL && rowBT->right != NULL ) { @@ -2935,7 +2935,7 @@ void Patch_InterpolateListFromRowBT( list *drawList, BTNode_t *rowBT } } -void Patch_TraverseColBTInOrder( list*>::iterator& iter, BTNode_t *colBTLeft, BTNode_t *colBT, BTNode_t *colBTRight, BTNode_t *rowBT, BTNode_t *rowBTLeft, float v, float n ){ +void Patch_TraverseColBTInOrder( std::list*>::iterator& iter, BTNode_t *colBTLeft, BTNode_t *colBT, BTNode_t *colBTRight, BTNode_t *rowBT, BTNode_t *rowBTLeft, float v, float n ){ if ( colBT != NULL ) { //traverse subtree In Order Patch_TraverseColBTInOrder( iter, colBTLeft->left, colBT->left, colBTRight->left, rowBT, rowBTLeft, v - n, n * 0.5f ); @@ -2954,12 +2954,12 @@ void Patch_TraverseColBTInOrder( list*>::iterator& iter, BTNode } -void Patch_StartDrawLists( list*> *drawLists, BTNode_t *colBT ){ +void Patch_StartDrawLists( std::list*> *drawLists, BTNode_t *colBT ){ if ( colBT != NULL ) { //traverse subtree In Order Patch_StartDrawLists( drawLists, colBT->left ); if ( colBT->left != NULL && colBT->right != NULL ) { - list *newList = new list; + std::list *newList = new std::list; drawLists->push_back( newList ); // add empty list to back drawLists->back()->push_back( colBT->vMid ); } @@ -2967,8 +2967,8 @@ void Patch_StartDrawLists( list*> *drawLists, BTNode_t *colBT ) } } -typedef list drawList_t; -typedef list*> drawLists_t; +typedef std::list drawList_t; +typedef std::list*> drawLists_t; void Patch_CreateDrawLists( patchMesh_t *patch ){ int col, row, colpos, rowpos; diff --git a/radiant/preferences.cpp b/radiant/preferences.cpp index c5c100d2..e6dadf44 100644 --- a/radiant/preferences.cpp +++ b/radiant/preferences.cpp @@ -244,7 +244,7 @@ CXMLPropertyBag::CXMLPropertyBag() { // generic preference functions void CXMLPropertyBag::PushAssignment( const char *name, PrefTypes_t type, void *pV ){ - list::iterator iAssign; + std::list::iterator iAssign; for ( iAssign = mPrefAssignments.begin(); iAssign != mPrefAssignments.end(); iAssign++ ) { if ( ( *iAssign ).mName == name ) { @@ -396,7 +396,7 @@ void CXMLPropertyBag::GetPref( const char *name, window_position_t* pV, window_p void CXMLPropertyBag::UpdatePrefTree(){ // read the assignments and update the tree - list::iterator iPref; + std::list::iterator iPref; for ( iPref = mPrefAssignments.begin(); iPref != mPrefAssignments.end(); iPref++ ) { CPrefAssignment *pPref = &( *iPref ); @@ -1095,7 +1095,7 @@ GtkWidget* CGameDialog::GetGlobalFrame(){ void CGameDialog::UpdateData( bool retrieve ) { if ( !retrieve ) { // use m_sGameFile to set m_nComboSelect - list::iterator iGame; + std::list::iterator iGame; int i = 0; for ( iGame = mGames.begin(); iGame != mGames.end(); iGame++ ) { @@ -1112,7 +1112,7 @@ void CGameDialog::UpdateData( bool retrieve ) { Dialog::UpdateData( retrieve ); if ( retrieve ) { // use m_nComboSelect to set m_sGameFile - list::iterator iGame = mGames.begin(); + std::list::iterator iGame = mGames.begin(); int i; for ( i = 0; i < m_nComboSelect; i++ ) { @@ -1166,7 +1166,7 @@ void CGameDialog::BuildDialog() { void CGameDialog::UpdateGameCombo() { // fill in with the game descriptions - list::iterator iGame; + std::list::iterator iGame; GtkListStore *store; if ( mGameCombo == NULL ) { @@ -1197,7 +1197,7 @@ void CGameDialog::ScanForGames(){ if ( !mGames.empty() ) { Sys_Printf( "Clearing game list\n" ); - list::iterator iGame; + std::list::iterator iGame; for ( iGame = mGames.begin(); iGame != mGames.end(); iGame++ ) { delete ( *iGame ); } @@ -1257,7 +1257,7 @@ void CGameDialog::ScanForGames(){ } CGameDescription* CGameDialog::GameDescriptionForComboItem(){ - list::iterator iGame; + std::list::iterator iGame; int i = 0; for ( iGame = mGames.begin(); iGame != mGames.end(); iGame++,i++ ) { if ( i == m_nComboSelect ) { @@ -1297,7 +1297,7 @@ void CGameDialog::Init(){ LoadPrefs(); if ( m_bAutoLoadGame ) { // search by .game name - list::iterator iGame; + std::list::iterator iGame; for ( iGame = mGames.begin(); iGame != mGames.end(); iGame++ ) { if ( ( *iGame )->mGameFile == m_sGameFile ) { @@ -1345,7 +1345,7 @@ CGameDialog::~CGameDialog(){ g_object_unref( GTK_WIDGET( mFrame ) ); } // free all the game descriptions - list::iterator iGame; + std::list::iterator iGame; for ( iGame = mGames.begin(); iGame != mGames.end(); iGame++ ) { delete ( *iGame ); @@ -1356,7 +1356,7 @@ CGameDialog::~CGameDialog(){ void CGameDialog::AddPacksURL( Str &URL ){ // add the URLs for the list of game packs installed // FIXME: this is kinda hardcoded for now.. - list::iterator iGame; + std::list::iterator iGame; for ( iGame = mGames.begin(); iGame != mGames.end(); iGame++ ) { if ( ( *iGame )->mGameFile == "q3.game" ) { diff --git a/radiant/preferences.h b/radiant/preferences.h index 4086685c..db893f52 100644 --- a/radiant/preferences.h +++ b/radiant/preferences.h @@ -23,8 +23,7 @@ #define _PREFERENCES_H_ #include "dialog.h" -#include "gtkr_list.h" -//#include "profile.h" +#include #ifdef _WIN32 #define NVIDIA_AERO_HACK @@ -79,7 +78,7 @@ xmlNodePtr mpDocNode; /*! prefs assignments (what pref name, what type, what variable) */ -list mPrefAssignments; +std::list mPrefAssignments; /*! name of file to load/save as @@ -345,7 +344,7 @@ CGameDescription *m_pCurrentGameDescription; /*! the list of game descriptions we scanned from the game/ dir */ -list mGames; +std::list mGames; CGameDialog() { mFrame = NULL; @@ -494,7 +493,7 @@ CGameDialog mGamesDialog; protected: // warning about old project files bool m_bWarn; -list mGames; +std::list mGames; public: // last light intensity used in the CLightPrompt dialog, stored in registry