change conversions to static_cast
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
@@ -83,12 +83,12 @@ struct SANDBOX_API DisplayContext
|
||||
// Draw functions
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//! Set current materialc color.
|
||||
void SetColor(float r, float g, float b, float a = 1) { m_color4b = ColorB(aznumeric_cast<uint8>(r * 255.0f), aznumeric_cast<uint8>(g * 255.0f), aznumeric_cast<uint8>(b * 255.0f), aznumeric_cast<uint8>(a * 255.0f)); };
|
||||
void SetColor(const Vec3& color, float a = 1) { m_color4b = ColorB(aznumeric_cast<uint8>(color.x * 255.0f), aznumeric_cast<uint8>(color.y * 255.0f), aznumeric_cast<uint8>(color.z * 255.0f), aznumeric_cast<uint8>(a * 255.0f)); };
|
||||
void SetColor(const QColor& rgb, float a) { m_color4b = ColorB(aznumeric_cast<uint8>(rgb.red()), aznumeric_cast<uint8>(rgb.green()), aznumeric_cast<uint8>(rgb.blue()), aznumeric_cast<uint8>(a * 255.0f)); };
|
||||
void SetColor(const QColor& color) { m_color4b = ColorB(aznumeric_cast<uint8>(color.red()), aznumeric_cast<uint8>(color.green()), aznumeric_cast<uint8>(color.blue()), aznumeric_cast<uint8>(color.alpha())); };
|
||||
void SetColor(float r, float g, float b, float a = 1) { m_color4b = ColorB(static_cast<uint8>(r * 255.0f), static_cast<uint8>(g * 255.0f), static_cast<uint8>(b * 255.0f), static_cast<uint8>(a * 255.0f)); };
|
||||
void SetColor(const Vec3& color, float a = 1) { m_color4b = ColorB(static_cast<uint8>(color.x * 255.0f), static_cast<uint8>(color.y * 255.0f), static_cast<uint8>(color.z * 255.0f), static_cast<uint8>(a * 255.0f)); };
|
||||
void SetColor(const QColor& rgb, float a) { m_color4b = ColorB(static_cast<uint8>(rgb.red()), static_cast<uint8>(rgb.green()), static_cast<uint8>(rgb.blue()), static_cast<uint8>(a * 255.0f)); };
|
||||
void SetColor(const QColor& color) { m_color4b = ColorB(static_cast<uint8>(color.red()), static_cast<uint8>(color.green()), static_cast<uint8>(color.blue()), static_cast<uint8>(color.alpha())); };
|
||||
void SetColor(const ColorB& color) { m_color4b = color; };
|
||||
void SetAlpha(float a = 1) { m_color4b.a = aznumeric_cast<uint8>(a * 255.0f); };
|
||||
void SetAlpha(float a = 1) { m_color4b.a = static_cast<uint8>(a * 255.0f); };
|
||||
ColorB GetColor() const { return m_color4b; }
|
||||
|
||||
void SetSelectedColor(float fAlpha = 1);
|
||||
|
||||
@@ -64,14 +64,14 @@ inline GUID GuidUtil::FromString(const char* guidString)
|
||||
guid.Data3 = 0;
|
||||
azsscanf(guidString, "{%8" SCNx32 "-%4hX-%4hX-%2X%2X-%2X%2X%2X%2X%2X%2X}",
|
||||
&guid.Data1, &guid.Data2, &guid.Data3, &d[0], &d[1], &d[2], &d[3], &d[4], &d[5], &d[6], &d[7]);
|
||||
guid.Data4[0] = aznumeric_cast<unsigned char>(d[0]);
|
||||
guid.Data4[1] = aznumeric_cast<unsigned char>(d[1]);
|
||||
guid.Data4[2] = aznumeric_cast<unsigned char>(d[2]);
|
||||
guid.Data4[3] = aznumeric_cast<unsigned char>(d[3]);
|
||||
guid.Data4[4] = aznumeric_cast<unsigned char>(d[4]);
|
||||
guid.Data4[5] = aznumeric_cast<unsigned char>(d[5]);
|
||||
guid.Data4[6] = aznumeric_cast<unsigned char>(d[6]);
|
||||
guid.Data4[7] = aznumeric_cast<unsigned char>(d[7]);
|
||||
guid.Data4[0] = static_cast<unsigned char>(d[0]);
|
||||
guid.Data4[1] = static_cast<unsigned char>(d[1]);
|
||||
guid.Data4[2] = static_cast<unsigned char>(d[2]);
|
||||
guid.Data4[3] = static_cast<unsigned char>(d[3]);
|
||||
guid.Data4[4] = static_cast<unsigned char>(d[4]);
|
||||
guid.Data4[5] = static_cast<unsigned char>(d[5]);
|
||||
guid.Data4[6] = static_cast<unsigned char>(d[6]);
|
||||
guid.Data4[7] = static_cast<unsigned char>(d[7]);
|
||||
|
||||
return guid;
|
||||
}
|
||||
|
||||
@@ -405,7 +405,7 @@ public:
|
||||
unsigned char GetDataType() const { return m_dataType; };
|
||||
void SetDataType(unsigned char dataType) { m_dataType = dataType; }
|
||||
|
||||
void SetFlags(int flags) { m_flags = aznumeric_cast<uint16>(flags); }
|
||||
void SetFlags(int flags) { m_flags = static_cast<uint16>(flags); }
|
||||
int GetFlags() const { return m_flags; }
|
||||
void SetFlagRecursive(EFlags flag) { m_flags |= flag; }
|
||||
|
||||
|
||||
@@ -221,7 +221,7 @@ namespace AZ::IO::Internal
|
||||
? strncmp(left.data(), right.data(), maxCharsToCompare)
|
||||
: azstrnicmp(left.data(), right.data(), maxCharsToCompare);
|
||||
return charCompareResult == 0
|
||||
? aznumeric_cast<int>(aznumeric_cast<ptrdiff_t>(left.size()) - aznumeric_cast<ptrdiff_t>(right.size()))
|
||||
? static_cast<int>(aznumeric_cast<ptrdiff_t>(left.size()) - aznumeric_cast<ptrdiff_t>(right.size()))
|
||||
: charCompareResult;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include <AzCore/std/string/conversions.h>
|
||||
#include <AzCore/std/containers/array.h>
|
||||
#include <AzCore/std/containers/fixed_vector.h>
|
||||
#include <AzCore/Casting/lossy_cast.h>
|
||||
#include <AzCore/Memory/Memory.h>
|
||||
#include <AzCore/Memory/OSAllocator.h>
|
||||
#include <AzCore/Memory/SystemAllocator.h>
|
||||
@@ -343,8 +342,8 @@ namespace AZ::StringFunc::Internal
|
||||
{
|
||||
for (const char stripCharacter : stripCharacters)
|
||||
{
|
||||
const char lower = azlossy_cast<char>(tolower(stripCharacter));
|
||||
const char upper = azlossy_cast<char>(toupper(stripCharacter));
|
||||
const char lower = static_cast<char>(tolower(stripCharacter));
|
||||
const char upper = static_cast<char>(toupper(stripCharacter));
|
||||
if (lower != upper)
|
||||
{
|
||||
combinedStripCharacters.push_back(lower);
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#include <AzCore/Debug/StackTracer.h>
|
||||
#include <AzCore/Debug/Trace.h>
|
||||
#include <AzCore/Math/Sfmt.h>
|
||||
#include <AzCore/Casting/lossy_cast.h>
|
||||
|
||||
|
||||
namespace Internal
|
||||
@@ -298,7 +297,7 @@ AZ_POP_DISABLE_WARNING
|
||||
// the overflow guard is generated out of rand, so we set a fixed seed before doing the allocation
|
||||
// to get a deterministic guard
|
||||
srand(0);
|
||||
const unsigned char expectedInitialGuard = azlossy_cast<unsigned char>(rand());
|
||||
const unsigned char expectedInitialGuard = static_cast<unsigned char>(rand());
|
||||
|
||||
srand(0);
|
||||
TestClass<16>* someObject = aznew TestClass<16>();
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
#include <AzCore/std/chrono/chrono.h>
|
||||
#include <AzCore/std/string/conversions.h>
|
||||
#include <AzCore/Utils/Utils.h>
|
||||
#include <AzCore/Casting/lossy_cast.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <io.h>
|
||||
@@ -285,7 +284,7 @@ char* CRCfix::GetToken(FILE* infile, FILE* outfile)
|
||||
{
|
||||
if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '#' || c == '_')
|
||||
{
|
||||
token[i++] = azlossy_cast<char>(c);
|
||||
token[i++] = static_cast<char>(c);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
@@ -376,7 +375,7 @@ void CRCfix::GetPreviousCRC(char* token, FILE* infile)
|
||||
int c;
|
||||
while ((c = fgetc(infile)) != ')')
|
||||
{
|
||||
*token++ = azlossy_cast<char>(c);
|
||||
*token++ = static_cast<char>(c);
|
||||
}
|
||||
*token = 0;
|
||||
}
|
||||
@@ -427,7 +426,7 @@ int CRCfix::Fix(Filename srce)
|
||||
if (strcmp(token, "AZ_CRC") == 0 && lastchar == '(')
|
||||
{
|
||||
size_t i = strlen(token);
|
||||
token[i++] = azlossy_cast<char>(lastchar);
|
||||
token[i++] = static_cast<char>(lastchar);
|
||||
int c = fgetc(infile);
|
||||
|
||||
if (c == '"')
|
||||
@@ -436,11 +435,11 @@ int CRCfix::Fix(Filename srce)
|
||||
|
||||
do
|
||||
{
|
||||
token[i++] = azlossy_cast<char>(c);
|
||||
token[i++] = static_cast<char>(c);
|
||||
c = fgetc(infile);
|
||||
} while (c != '"');
|
||||
|
||||
token[i++] = azlossy_cast<char>(c);
|
||||
token[i++] = static_cast<char>(c);
|
||||
c = fgetc(infile);
|
||||
|
||||
int oldcrc = 0, newcrc;
|
||||
|
||||
Reference in New Issue
Block a user