Skip to content

Commit bf8950c

Browse files
committed
Remove more instances of SourceHook::List
1 parent b97d0d6 commit bf8950c

4 files changed

Lines changed: 12 additions & 14 deletions

File tree

core/CoreConfig.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -399,9 +399,9 @@ inline bool SM_CvarExistsInConfig(ke::HashMap<std::string, std::string, StringPo
399399
return cvars.find(cvar_name).found();
400400
}
401401

402-
bool SM_CvarExistsInPlugin(List<const ConVar *> &convars, const char *cvar_name)
402+
bool SM_CvarExistsInPlugin(std::list<const ConVar *> &convars, const char *cvar_name)
403403
{
404-
for (List<const ConVar *>::iterator iter = convars.begin(); iter != convars.end(); iter++)
404+
for (auto iter = convars.begin(); iter != convars.end(); iter++)
405405
{
406406
const ConVar *cvar = (*iter);
407407
#if SOURCE_ENGINE >= SE_ORANGEBOX
@@ -425,7 +425,7 @@ bool SM_CvarExistsInPlugin(List<const ConVar *> &convars, const char *cvar_name)
425425
bool SM_ConfigCheckRegeneration(
426426
const char *file,
427427
ke::HashMap<std::string, std::string, StringPolicy> &existing_cvars,
428-
List<const ConVar *> &convars)
428+
std::list<const ConVar *> &convars)
429429
{
430430
FILE *fp = fopen(file, "rt");
431431
if (!fp)
@@ -438,7 +438,7 @@ bool SM_ConfigCheckRegeneration(
438438
fclose(fp);
439439

440440
/* #1. Check if the plugin's cvar list has a cvar that doesn't exist in the config file. */
441-
for (List<const ConVar *>::iterator iter = convars.begin(); iter != convars.end(); iter++)
441+
for (auto iter = convars.begin(); iter != convars.end(); iter++)
442442
{
443443
const ConVar *cvar = (*iter);
444444
#if SOURCE_ENGINE >= SE_ORANGEBOX
@@ -478,7 +478,7 @@ inline void SM_ExecuteConfigFile(const char *file)
478478
bool SM_GenerateConfigFile(
479479
IPlugin *pl,
480480
const char *file,
481-
List<const ConVar *> &convars,
481+
std::list<const ConVar *> &convars,
482482
bool needs_regeneration = false,
483483
ke::HashMap<std::string, std::string, StringPolicy> *existing_cvars = NULL)
484484
{
@@ -510,7 +510,7 @@ bool SM_GenerateConfigFile(
510510
fprintf(fp, "\n\n");
511511

512512
float x;
513-
for (List<const ConVar *>::iterator iter = convars.begin(); iter != convars.end(); iter++)
513+
for (auto iter = convars.begin(); iter != convars.end(); iter++)
514514
{
515515
const ConVar *cvar = (*iter);
516516
#if SOURCE_ENGINE >= SE_ORANGEBOX
@@ -683,7 +683,7 @@ bool SM_ExecuteConfig(IPlugin *pl, AutoConfig *cfg, bool can_create)
683683
return can_create;
684684
}
685685

686-
List<const ConVar *> *convars = NULL;
686+
std::list<const ConVar *> *convars = nullptr;
687687
if (!pl->GetProperty("ConVarList", (void **)&convars, false) || !convars)
688688
{
689689
if (file_exists)

extensions/structs/Struct.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,7 @@ void StructInfo::AddMember( const char *name, MemberInfo *member )
8181

8282
StructInfo::~StructInfo()
8383
{
84-
SourceHook::List<MemberInfo *>::iterator iter;
85-
86-
iter = membersList.begin();
84+
auto iter = membersList.begin();
8785

8886
while (iter != membersList.end())
8987
{

extensions/structs/StructManager.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ void StructManager::AddStruct( const char *name, StructInfo *str )
4242

4343
StructManager::~StructManager()
4444
{
45-
SourceHook::List<StructInfo *>::iterator iter;
46-
47-
iter = structsList.begin();
45+
auto iter = structsList.begin();
4846

4947
while (iter != structsList.end())
5048
{

extensions/structs/StructManager.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
#include "IHandleSys.h"
3939
#include "smsdk_ext.h"
4040

41+
#include <list>
42+
4143
int CheckBaseHandle(CBaseHandle &hndl);
4244

4345
class StructManager : public IStructAbstracter
@@ -48,7 +50,7 @@ class StructManager : public IStructAbstracter
4850
void AddStruct(const char *name, StructInfo *str);
4951
private:
5052
KTrie<StructInfo *> structs;
51-
SourceHook::List<StructInfo *> structsList;
53+
std::list<StructInfo *> structsList;
5254
};
5355

5456
extern StructManager g_StructManager;

0 commit comments

Comments
 (0)