Legacy cleanup, part 2 (#3659)

* Legacy cleanup, part 2

There are still things that can be removed, those will be likely done in part three:
`The Return of the Cleanup` :)

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Fix windows build

Somehow there were some unfixed errors from enabled warnings?
I'm unsure if I've pulled repo in unstable state, or those were somehow
missed.

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>
This commit is contained in:
Artur K
2021-08-30 22:40:02 +02:00
committed by GitHub
parent fa0f2a1007
commit 96a5f06ca3
116 changed files with 189 additions and 18706 deletions
+18 -9
View File
@@ -8,14 +8,12 @@
// Description : Classes to deal with commands
#ifndef CRYINCLUDE_EDITOR_INCLUDE_COMMAND_H
#define CRYINCLUDE_EDITOR_INCLUDE_COMMAND_H
#pragma once
#include <QString>
#include <AzCore/std/containers/vector.h>
#include <AzCore/std/string/conversions.h>
#include <CryCommon/LegacyAllocator.h>
#include "Util/EditorUtils.h"
inline AZStd::string ToString(const QString& s)
@@ -23,8 +21,20 @@ inline AZStd::string ToString(const QString& s)
return s.toUtf8().data();
}
class CCommand
{
static inline bool FromString(int32 &val, const char* s) {
if(!s)
{
return false;
}
val = (int)strtol(s, nullptr, 10);
if(val==0 && errno!=0) {
return false;
}
return true;
}
public:
CCommand(
const AZStd::string& module,
@@ -77,7 +87,7 @@ public:
return false;
}
}
int GetArgCount() const
size_t GetArgCount() const
{ return m_args.size(); }
const AZStd::string& GetArg(int i) const
{
@@ -85,7 +95,7 @@ public:
return m_args[i];
}
private:
DynArray<AZStd::string> m_args;
AZStd::vector<AZStd::string,AZ::StdLegacyAllocator> m_args;
unsigned char m_stringFlags; // This is needed to quote string parameters when logging a command.
};
@@ -115,7 +125,7 @@ protected:
static inline AZStd::string ToString_(const char* val)
{ return val; }
template <typename T>
static bool FromString_(T& t, const char* s) { return ::FromString(t, s); }
static bool FromString_(T& t, const char* s) { return FromString(t, s); }
static inline bool FromString_(const char*& val, const char* s)
{ return (val = s) != 0; }
@@ -789,4 +799,3 @@ QString CCommand6<LIST(6, P)>::Execute(const CCommand::CArgs& args)
}
return "";
}
#endif // CRYINCLUDE_EDITOR_INCLUDE_COMMAND_H
+2 -1
View File
@@ -9,6 +9,7 @@
#pragma once
#include "../Include/SandboxAPI.h"
#include <CryCommon/LegacyAllocator.h>
#include <set>
class QWidget;
@@ -103,7 +104,7 @@ struct IFileUtil
}
};
typedef DynArray<FileDesc> FileArray;
using FileArray = AZStd::vector<FileDesc, AZ::StdLegacyAllocator>;
typedef bool (* ScanDirectoryUpdateCallBack)(const QString& msg);
+1 -1
View File
@@ -89,7 +89,7 @@ public:
//! Get array of objects, managed by manager (not contain sub objects of groups).
//! @param layer if 0 get objects for all layers, or layer to get objects from.
virtual void GetObjects(CBaseObjectsArray& objects) const = 0;
virtual void GetObjects(DynArray<CBaseObject*>& objects) const = 0;
//virtual void GetObjects(DynArray<CBaseObject*>& objects) const = 0;
//! Get array of objects that pass the filter.
//! @param filter The filter functor, return true if you want to get the certain obj, return false if want to skip it.