More fixes for warnings

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
monroegm-disable-blank-issue-2
Esteban Papp 4 years ago
parent 1f5dddcca6
commit 14e7754334

@ -72,10 +72,15 @@ namespace O3de
return true; return true;
} }
#if !AZ_TRAIT_OS_PLATFORM_APPLE #if !AZ_TRAIT_OS_PLATFORM_APPLE
AZ_PUSH_DISABLE_WARNING(4996, "-Wunknown-warning-option") #if AZ_TRAIT_USE_SECURE_CRT_FUNCTIONS
char noConfirmation[64]{};
size_t variableSize = 0;
auto err = getenv_s(&variableSize, noConfirmation, AZ_ARRAY_SIZE(noConfirmation), "LY_NO_CONFIRM");
if (variableSize == 0)
#else
const char* noConfirmation = getenv("LY_NO_CONFIRM"); const char* noConfirmation = getenv("LY_NO_CONFIRM");
AZ_POP_DISABLE_WARNING
if (noConfirmation == nullptr) if (noConfirmation == nullptr)
#endif
{ {
int argCount = 0; int argCount = 0;

@ -54,7 +54,13 @@ namespace AWSGameLift
} }
char buffer[50]; char buffer[50];
strftime(buffer, sizeof(buffer), "%FT%TZ", gmtime(&terminationTime)); tm time;
#if AZ_TRAIT_USE_SECURE_CRT_FUNCTIONS
gmtime_s(&time, &terminationTime);
#else
time = *gmtime(&terminationTime);
#endif
strftime(buffer, sizeof(buffer), "%FT%TZ", &time);
return AZStd::string(buffer); return AZStd::string(buffer);
} }

@ -7,14 +7,11 @@
*/ */
#include <AzCore/PlatformIncl.h> #include <AzCore/PlatformIncl.h>
#include <AzCore/std/string/conversions.h>
#include <CrashReporting/GameCrashUploader.h> #include <CrashReporting/GameCrashUploader.h>
#include <CrashSupport.h> #include <CrashSupport.h>
#include <stdlib.h>
#include <locale>
#include <codecvt>
namespace O3de namespace O3de
{ {
@ -22,21 +19,26 @@ namespace O3de
{ {
if (!m_noConfirmation) if (!m_noConfirmation)
{ {
#if AZ_TRAIT_USE_SECURE_CRT_FUNCTIONS
char noConfirmation[64]{};
size_t variableSize = 0;
getenv_s(&variableSize, noConfirmation, AZ_ARRAY_SIZE(noConfirmation), "LY_NO_CONFIRM");
if (variableSize == 0)
#else
const char* noConfirmation = getenv("LY_NO_CONFIRM"); const char* noConfirmation = getenv("LY_NO_CONFIRM");
if (noConfirmation == nullptr) if (noConfirmation == nullptr)
#endif
{ {
AZStd::wstring sendDialogMessage;
std::wstring sendDialogMessage; AZStd::to_wstring(sendDialogMessage, m_executableName.c_str());
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
sendDialogMessage = converter.from_bytes(m_executableName);
sendDialogMessage += L" has encountered a fatal error. We're sorry for the inconvenience.\n\nA crash debugging file has been created at:\n"; sendDialogMessage += L" has encountered a fatal error. We're sorry for the inconvenience.\n\nA crash debugging file has been created at:\n";
sendDialogMessage += report.file_path.value(); sendDialogMessage += report.file_path.value().c_str();
sendDialogMessage += L"\n\nIf you are willing to submit this file to Amazon it will help us improve the Lumberyard experience. We will treat this report as confidential.\n\nWould you like to send the error report?"; sendDialogMessage += L"\n\nIf you are willing to submit this file to Amazon it will help us improve the Lumberyard experience. We will treat this report as confidential.\n\nWould you like to send the error report?";
int msgboxID = MessageBoxW( int msgboxID = MessageBoxW(
NULL, nullptr,
sendDialogMessage.data(), sendDialogMessage.data(),
L"Send Error Report", L"Send Error Report",
(MB_ICONEXCLAMATION | MB_YESNO | MB_SYSTEMMODAL) (MB_ICONEXCLAMATION | MB_YESNO | MB_SYSTEMMODAL)

@ -165,7 +165,7 @@ namespace EMotionFX
for (const auto& activeObjects : activeObjectsAtFrame) for (const auto& activeObjects : activeObjectsAtFrame)
{ {
if (activeObjects.m_frameNr == frame) if (activeObjects.m_frameNr == static_cast<AZ::u32>(frame))
{ {
// Check which states and transitions are active and compare it to the expected ones. // Check which states and transitions are active and compare it to the expected ones.
EXPECT_EQ(activeObjects.m_stateA, compareAgainst.m_stateA) EXPECT_EQ(activeObjects.m_stateA, compareAgainst.m_stateA)

@ -181,9 +181,12 @@ namespace ScriptCanvas
: public Node : public Node
{ {
public: public:
AZ_PUSH_DISABLE_WARNING(5046, "-Wunknown-warning-option") // 'function' : Symbol involving type with internal linkage not defined
AZ_RTTI(((NodeFunctionGenericMultiReturn<t_Func, t_Traits, function>), "{DC5B1799-6C5B-4190-8D90-EF0C2D1BCE4E}", t_Func, t_Traits), Node); AZ_RTTI(((NodeFunctionGenericMultiReturn<t_Func, t_Traits, function>), "{DC5B1799-6C5B-4190-8D90-EF0C2D1BCE4E}", t_Func, t_Traits), Node);
AZ_COMPONENT_INTRUSIVE_DESCRIPTOR_TYPE(NodeFunctionGenericMultiReturn); AZ_COMPONENT_INTRUSIVE_DESCRIPTOR_TYPE(NodeFunctionGenericMultiReturn);
AZ_COMPONENT_BASE(NodeFunctionGenericMultiReturn, Node); AZ_COMPONENT_BASE(NodeFunctionGenericMultiReturn, Node);
AZ_POP_DISABLE_WARNING
static const char* GetNodeFunctionName() static const char* GetNodeFunctionName()
{ {

Loading…
Cancel
Save