Skip to content

Commit 65ac56a

Browse files
committed
Fix some warnings.
1 parent 6d94a10 commit 65ac56a

File tree

7 files changed

+10
-20
lines changed

7 files changed

+10
-20
lines changed

src/Common/PlatformWindows.inl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
#define DIRECTINPUT_VERSION 0x0800 //
55

66
#ifndef _WIN32_WINNT
7-
// Request Windows XP functionality
8-
#define _WIN32_WINNT 0x0501
7+
// Windows Server 2003 with SP1, Windows XP with SP2
8+
#define _WIN32_WINNT _WIN32_WINNT_WS03
99
#endif
1010

1111
#include <sys/utime.h>
@@ -27,8 +27,5 @@
2727
#define DOSWIN32
2828
#define _WIN32_DCOM
2929

30-
#pragma warning(push)
31-
#pragma warning(disable : 4005) // macro redefinition
3230
#include <windows.h>
3331
#include <windowsx.h>
34-
#pragma warning(pop)

src/editors/xrManagedApi/Pch.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
#pragma once
22
#include "Common/Platform.hpp"
33
#include "Common/Common.hpp"
4-
5-
// XXX nitrocaster: move to src/Common.hpp (common engine header)
6-
#define DLL_API XR_IMPORT

src/xrEngine/device.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ class ENGINE_API CRenderDevice : public CRenderDeviceBase
230230
TimerGlobal.time_factor(time_factor);
231231
}
232232

233-
IC const float& time_factor() const
233+
IC const float time_factor() const
234234
{
235235
VERIFY(Timer.time_factor() == TimerGlobal.time_factor());
236236
return (Timer.time_factor());

src/xrEngine/stdafx.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
#endif // #ifndef INGAME_EDITOR
1313
#endif // #ifndef NDEBUG
1414

15-
#ifdef INGAME_EDITOR
16-
#define _WIN32_WINNT 0x0550
17-
#endif // #ifdef INGAME_EDITOR
18-
1915
#include "xrCore/xrCore.h"
2016

2117
#define ECORE_API

src/xrGame/console_commands_mp.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,7 +1226,7 @@ class CCC_ListPlayers : public IConsole_Command
12261226
exclude_raid_from_args(args, tmp_dest, sizeof(tmp_dest));
12271227
if (xr_strlen(tmp_dest))
12281228
{
1229-
sscanf_s(tmp_dest, "%s", filter_string);
1229+
sscanf_s(tmp_dest, "%s", filter_string, _countof(filter_string));
12301230
tmp_functor.filter_string = filter_string;
12311231
}
12321232
}
@@ -1323,7 +1323,7 @@ class CCC_ListPlayers_Banned : public IConsole_Command
13231323
exclude_raid_from_args(args, tmp_dest, sizeof(tmp_dest));
13241324
if (xr_strlen(tmp_dest))
13251325
{
1326-
sscanf_s(tmp_dest, "%s", filter_dest);
1326+
sscanf_s(tmp_dest, "%s", filter_dest, _countof(filter_dest));
13271327
}
13281328
tmp_sv_game->PrintBanList(filter_dest);
13291329
Level().Server->Print_Banned_Addreses();

src/xrGame/script_sound.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ CScriptSound::CScriptSound(LPCSTR caSoundName, ESoundTypes sound_type)
2727

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

src/xrSound/OpenALDeviceList.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ void ALDeviceList::Enumerate()
120120
if (alIsExtensionPresent("EAX5.0"))
121121
m_devices.back().props.eax = 5;
122122

123-
m_devices.back().props.efx = alIsExtensionPresent("ALC_EXT_EFX") == true;
124-
m_devices.back().props.xram = alIsExtensionPresent("EAX_RAM") == true;
123+
m_devices.back().props.efx = alIsExtensionPresent("ALC_EXT_EFX") == AL_TRUE;
124+
m_devices.back().props.xram = alIsExtensionPresent("EAX_RAM") == AL_TRUE;
125125

126126
m_devices.back().props.eax_unwanted =
127127
0 == xr_strcmp(actualDeviceName, AL_GENERIC_HARDWARE) ||

0 commit comments

Comments
 (0)