Skip to content

Commit

Permalink
Fix some warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
intorr committed Jan 8, 2018
1 parent 6d94a10 commit 65ac56a
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 20 deletions.
7 changes: 2 additions & 5 deletions src/Common/PlatformWindows.inl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#define DIRECTINPUT_VERSION 0x0800 //

#ifndef _WIN32_WINNT
// Request Windows XP functionality
#define _WIN32_WINNT 0x0501
// Windows Server 2003 with SP1, Windows XP with SP2
#define _WIN32_WINNT _WIN32_WINNT_WS03
#endif

#include <sys/utime.h>
Expand All @@ -27,8 +27,5 @@
#define DOSWIN32
#define _WIN32_DCOM

#pragma warning(push)
#pragma warning(disable : 4005) // macro redefinition
#include <windows.h>
#include <windowsx.h>
#pragma warning(pop)
3 changes: 0 additions & 3 deletions src/editors/xrManagedApi/Pch.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#pragma once
#include "Common/Platform.hpp"
#include "Common/Common.hpp"

// XXX nitrocaster: move to src/Common.hpp (common engine header)
#define DLL_API XR_IMPORT
2 changes: 1 addition & 1 deletion src/xrEngine/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ class ENGINE_API CRenderDevice : public CRenderDeviceBase
TimerGlobal.time_factor(time_factor);
}

IC const float& time_factor() const
IC const float time_factor() const
{
VERIFY(Timer.time_factor() == TimerGlobal.time_factor());
return (Timer.time_factor());
Expand Down
4 changes: 0 additions & 4 deletions src/xrEngine/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
#endif // #ifndef INGAME_EDITOR
#endif // #ifndef NDEBUG

#ifdef INGAME_EDITOR
#define _WIN32_WINNT 0x0550
#endif // #ifdef INGAME_EDITOR

#include "xrCore/xrCore.h"

#define ECORE_API
Expand Down
4 changes: 2 additions & 2 deletions src/xrGame/console_commands_mp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,7 @@ class CCC_ListPlayers : public IConsole_Command
exclude_raid_from_args(args, tmp_dest, sizeof(tmp_dest));
if (xr_strlen(tmp_dest))
{
sscanf_s(tmp_dest, "%s", filter_string);
sscanf_s(tmp_dest, "%s", filter_string, _countof(filter_string));
tmp_functor.filter_string = filter_string;
}
}
Expand Down Expand Up @@ -1323,7 +1323,7 @@ class CCC_ListPlayers_Banned : public IConsole_Command
exclude_raid_from_args(args, tmp_dest, sizeof(tmp_dest));
if (xr_strlen(tmp_dest))
{
sscanf_s(tmp_dest, "%s", filter_dest);
sscanf_s(tmp_dest, "%s", filter_dest, _countof(filter_dest));
}
tmp_sv_game->PrintBanList(filter_dest);
Level().Server->Print_Banned_Addreses();
Expand Down
6 changes: 3 additions & 3 deletions src/xrGame/script_sound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ CScriptSound::CScriptSound(LPCSTR caSoundName, ESoundTypes sound_type)

CScriptSound::~CScriptSound()
{
// Compiler warning C4297: function assumed not to throw an exception but does.
THROW3(!m_sound._feedback(), "playing sound is not completed, but is destroying",
m_sound._handle() ? m_sound._handle()->file_name() : "unknown");
if (m_sound._feedback())
GEnv.ScriptEngine->script_log(LuaMessageType::Error, "Playing sound is not completed, but is destroying \"%s\"!",
m_sound._handle() ? m_sound._handle()->file_name() : "unknown");
m_sound.destroy();
}

Expand Down
4 changes: 2 additions & 2 deletions src/xrSound/OpenALDeviceList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ void ALDeviceList::Enumerate()
if (alIsExtensionPresent("EAX5.0"))
m_devices.back().props.eax = 5;

m_devices.back().props.efx = alIsExtensionPresent("ALC_EXT_EFX") == true;
m_devices.back().props.xram = alIsExtensionPresent("EAX_RAM") == true;
m_devices.back().props.efx = alIsExtensionPresent("ALC_EXT_EFX") == AL_TRUE;
m_devices.back().props.xram = alIsExtensionPresent("EAX_RAM") == AL_TRUE;

m_devices.back().props.eax_unwanted =
0 == xr_strcmp(actualDeviceName, AL_GENERIC_HARDWARE) ||
Expand Down

0 comments on commit 65ac56a

Please sign in to comment.