Don't ignore warning 4100

This commit is contained in:
momo5502 2016-08-18 02:18:45 +02:00
parent f064966ec0
commit 256b463411
30 changed files with 76 additions and 36 deletions

View File

@ -8,10 +8,10 @@ namespace Components
public:
virtual ~IAsset() {};
virtual Game::XAssetType GetType() { return Game::XAssetType::ASSET_TYPE_INVALID; };
virtual void Mark(Game::XAssetHeader header, ZoneBuilder::Zone* builder) { /*ErrorTypeNotSupported(this);*/ };
virtual void Save(Game::XAssetHeader header, ZoneBuilder::Zone* builder) { /*ErrorTypeNotSupported(this);*/ };
virtual void Dump(Game::XAssetHeader header) { /*ErrorTypeNotSupported(this);*/ };
virtual void Load(Game::XAssetHeader* header, std::string name, ZoneBuilder::Zone* builder) { /*ErrorTypeNotSupported(this);*/ };
virtual void Mark(Game::XAssetHeader /*header*/, ZoneBuilder::Zone* /*builder*/) { /*ErrorTypeNotSupported(this);*/ };
virtual void Save(Game::XAssetHeader /*header*/, ZoneBuilder::Zone* /*builder*/) { /*ErrorTypeNotSupported(this);*/ };
virtual void Dump(Game::XAssetHeader /*header*/) { /*ErrorTypeNotSupported(this);*/ };
virtual void Load(Game::XAssetHeader* /*header*/, std::string name, ZoneBuilder::Zone* /*builder*/) { /*ErrorTypeNotSupported(this);*/ };
};
typedef Game::XAssetHeader(Callback)(Game::XAssetType type, std::string name);

View File

@ -247,7 +247,7 @@ namespace Components
Proto::Auth::Certificate cert;
if (cert.ParseFromString(::Utils::IO::ReadFile("players/guid.dat")))
{
Auth::GuidKey.Import(cert.privatekey(), PK_PRIVATE);
Auth::GuidKey.Import(cert.privatekey());
Auth::GuidToken = cert.token();
Auth::ComputeToken = cert.ctoken();
}
@ -386,7 +386,7 @@ namespace Components
Utils::Hook(0x41D3E3, Auth::SendConnectDataStub, HOOK_CALL).Install()->Quick();
// Guid command
Command::Add("guid", [] (Command::Params params)
Command::Add("guid", [] (Command::Params)
{
Logger::Print("Your guid: %llX\n", Steam::SteamUser()->GetSteamID().Bits);
});

View File

@ -137,7 +137,7 @@ namespace Components
// Disable native noclip command
Utils::Hook::Nop(0x474846, 5);
Command::Add("noclip", [] (Command::Params params)
Command::Add("noclip", [] (Command::Params)
{
if (!Game::CL_IsCgameInitialized())
{
@ -170,7 +170,7 @@ namespace Components
Logger::Print("Noclip toggled\n");
});
Command::Add("ufo", [] (Command::Params params)
Command::Add("ufo", [] (Command::Params)
{
if (!Game::CL_IsCgameInitialized())
{

View File

@ -40,7 +40,7 @@ namespace Components
nc->flags |= MG_F_SEND_AND_CLOSE;
}
void Download::ListHandler(mg_connection *nc, int ev, void *ev_data)
void Download::ListHandler(mg_connection* nc, int ev, void* /*ev_data*/)
{
// Only handle http requests
if (ev != MG_EV_HTTP_REQUEST) return;
@ -150,7 +150,7 @@ namespace Components
}
}
void Download::InfoHandler(mg_connection *nc, int ev, void *ev_data)
void Download::InfoHandler(mg_connection* nc, int ev, void* /*ev_data*/)
{
// Only handle http requests
if (ev != MG_EV_HTTP_REQUEST) return;

View File

@ -136,7 +136,7 @@ namespace Components
Dvar::RegistrationSignal.connect(callback);
}
Game::dvar_t* Dvar::RegisterName(const char* name, const char* default, Game::dvar_flag flag, const char* description)
Game::dvar_t* Dvar::RegisterName(const char* name, const char* /*default*/, Game::dvar_flag flag, const char* description)
{
// Run callbacks
Dvar::RegistrationSignal();

View File

@ -236,7 +236,7 @@ namespace Components
});
// Test pipe functionality by sending pings
Command::Add("ipcping", [] (Command::Params params)
Command::Add("ipcping", [] (Command::Params)
{
Logger::Print("Sending ping to pipe!\n");
IPCPipe::Write("ping", "");

View File

@ -113,7 +113,7 @@ namespace Components
Localization::TempLocalizeMap.clear();
}
void __stdcall Localization::SetStringStub(const char* key, const char* value, bool isEnglish)
void __stdcall Localization::SetStringStub(const char* key, const char* value, bool /*isEnglish*/)
{
Localization::Set(key, value);
}

View File

@ -41,7 +41,7 @@ namespace Components
}
else
{
Game::Com_PrintMessage(0, message.data(), 0);
Game::Com_PrintMessage(channel, message.data(), 0);
}
}

View File

@ -506,7 +506,7 @@ namespace Components
Menus::MenuList.clear();
}
Game::XAssetHeader Menus::MenuLoad(Game::XAssetType type, std::string filename)
Game::XAssetHeader Menus::MenuLoad(Game::XAssetType /*type*/, std::string filename)
{
return { Game::Menus_FindByName(Game::uiContext, filename.data()) };
}
@ -644,7 +644,7 @@ namespace Components
Game::Menus_OpenByName(Game::uiContext, params[1]);
});
Command::Add("reloadmenus", [] (Command::Params params)
Command::Add("reloadmenus", [] (Command::Params)
{
// Close all menus
Game::Menus_CloseAll(Game::uiContext);

View File

@ -25,7 +25,7 @@ namespace Components
return ModList::Mods.size();
}
const char* ModList::GetItemText(unsigned int index, int column)
const char* ModList::GetItemText(unsigned int index, int /*column*/)
{
if (index < ModList::Mods.size())
{

View File

@ -778,7 +778,7 @@ namespace Components
}
});
Command::Add("listnodes", [] (Command::Params params)
Command::Add("listnodes", [] (Command::Params)
{
Logger::Print("Nodes: %d (%d)\n", Node::Nodes.size(), Node::GetValidNodeCount());
@ -803,7 +803,7 @@ namespace Components
}
});
Command::Add("syncnodes", [] (Command::Params params)
Command::Add("syncnodes", [] (Command::Params)
{
Logger::Print("Re-Synchronizing nodes...\n");

View File

@ -69,7 +69,7 @@ namespace Components
Command::Execute("openmenu menu_xboxlive_partyended");
}
Game::dvar_t* Party::RegisterMinPlayers(const char* name, int value, int min, int max, Game::dvar_flag flag, const char* description)
Game::dvar_t* Party::RegisterMinPlayers(const char* name, int /*value*/, int /*min*/, int max, Game::dvar_flag flag, const char* description)
{
return Dvar::Register<int>(name, 1, 1, max, Game::dvar_flag::DVAR_FLAG_WRITEPROTECTED | flag, description).Get<Game::dvar_t*>();
}
@ -249,7 +249,7 @@ namespace Components
Party::Connect(Network::Address(params[1]));
});
Command::Add("reconnect", [] (Command::Params params)
Command::Add("reconnect", [] (Command::Params)
{
Party::Connect(Party::Container.Target);
});

View File

@ -17,7 +17,7 @@ namespace Components
void QuickPatch::ShutdownStub(int channel, const char* message)
{
Game::Com_Printf(0, message);
Game::Com_Printf(channel, message);
QuickPatch::ShutdownSignal();
}
@ -362,12 +362,12 @@ namespace Components
// Patch selectStringTableEntryInDvar
Utils::Hook::Set(0x405959, QuickPatch::SelectStringTableEntryInDvarStub);
Command::Add("unlockstats", [] (Command::Params params)
Command::Add("unlockstats", [] (Command::Params)
{
QuickPatch::UnlockStats();
});
Command::Add("crash", [] (Command::Params params)
Command::Add("crash", [] (Command::Params)
{
throw new std::exception();
});

View File

@ -84,7 +84,7 @@ namespace Components
// Only execute this when building zones
if (!ZoneBuilder::IsEnabled()) return;
AssetHandler::OnLoad([] (Game::XAssetType type, Game::XAssetHeader asset, std::string filename, bool* restrict)
AssetHandler::OnLoad([] (Game::XAssetType type, Game::XAssetHeader asset, std::string filename, bool* /*restrict*/)
{
// Only intercept playerdatadef loading
if (filename != "mp/playerdata.def" || type != Game::XAssetType::ASSET_TYPE_STRUCTUREDDATADEF) return;

View File

@ -252,7 +252,7 @@ namespace Components
}
// Omit column here
const char* Theatre::GetDemoText(unsigned int item, int column)
const char* Theatre::GetDemoText(unsigned int item, int /*column*/)
{
if (item < Theatre::DemoContainer.Demos.size())
{

View File

@ -2,7 +2,7 @@
namespace Components
{
Game::XAssetHeader Weapon::WeaponFileLoad(Game::XAssetType type, std::string filename)
Game::XAssetHeader Weapon::WeaponFileLoad(Game::XAssetType /*type*/, std::string filename)
{
Game::XAssetHeader header = { 0 };

View File

@ -500,7 +500,7 @@ namespace Components
Utils::Hook::Set<DWORD>(0x64A029, 0x38400000); // 900 MiB
Utils::Hook::Set<DWORD>(0x64A057, 0x38400000);
AssetHandler::OnLoad([](Game::XAssetType type, Game::XAssetHeader asset, std::string name, bool* restrict)
AssetHandler::OnLoad([](Game::XAssetType type, Game::XAssetHeader /*asset*/, std::string name, bool* /*restrict*/)
{
if (!ZoneBuilder::TraceZone.empty() && ZoneBuilder::TraceZone == FastFiles::Current())
{

View File

@ -317,11 +317,16 @@ namespace Game
float UI_GetScoreboardLeft(void* a1)
{
static int func = 0x590390;
float result = 0;
__asm
{
mov eax, [esp + 4h]
mov eax, a1
call func
mov result, eax
}
return result;
}
const char *DB_GetXAssetName(XAsset *asset)

View File

@ -46,7 +46,7 @@ namespace Main
}
}
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
BOOL APIENTRY DllMain(HMODULE /*hModule*/, DWORD ul_reason_for_call, LPVOID /*lpReserved*/)
{
if (ul_reason_for_call == DLL_PROCESS_ATTACH)
{

View File

@ -5,9 +5,6 @@
#ifndef RESOURCE_DATA
// Disable irrelevant warnings
#pragma warning(disable: 4100) // Unreferenced parameter (steam has to have them and other stubs as well, due to their calling convention)
#define VC_EXTRALEAN
#define WIN32_LEAN_AND_MEAN
@ -46,6 +43,7 @@
// Ignore the warnings, it's no our code!
#pragma warning(push)
#pragma warning(disable: 4005)
#pragma warning(disable: 4100)
#pragma warning(disable: 4389)
#pragma warning(disable: 4702)
#pragma warning(disable: 6001)

View File

@ -1,6 +1,8 @@
#include "STDInclude.hpp"
using namespace Components;
using namespace Components;
STEAM_IGNORE_WARNINGS_START
namespace Steam
{
@ -118,3 +120,5 @@ namespace Steam
{
}
}
STEAM_IGNORE_WARNINGS_END

View File

@ -1,5 +1,7 @@
#include "STDInclude.hpp"
STEAM_IGNORE_WARNINGS_START
namespace Steam
{
void GameServer::LogOn()
@ -89,3 +91,5 @@ namespace Steam
return 0;
}
}
STEAM_IGNORE_WARNINGS_END

View File

@ -1,5 +1,7 @@
#include "STDInclude.hpp"
STEAM_IGNORE_WARNINGS_START
namespace Steam
{
void MasterServerUpdater::SetActive(bool bActive)
@ -65,3 +67,5 @@ namespace Steam
return 0;
}
}
STEAM_IGNORE_WARNINGS_END

View File

@ -1,4 +1,6 @@
#include "STDInclude.hpp"
#include "STDInclude.hpp"
STEAM_IGNORE_WARNINGS_START
namespace Steam
{
@ -191,3 +193,5 @@ namespace Steam
return true;
}
}
STEAM_IGNORE_WARNINGS_END

View File

@ -1,5 +1,7 @@
#include "STDInclude.hpp"
STEAM_IGNORE_WARNINGS_START
namespace Steam
{
bool Networking::SendP2PPacket(SteamID steamIDRemote, const void *pubData, unsigned int cubData, int eP2PSendType)
@ -102,3 +104,5 @@ namespace Steam
return 0;
}
}
STEAM_IGNORE_WARNINGS_END

View File

@ -1,5 +1,7 @@
#include "STDInclude.hpp"
STEAM_IGNORE_WARNINGS_START
namespace Steam
{
bool RemoteStorage::FileWrite(const char *pchFile, const void *pvData, int cubData)
@ -41,3 +43,5 @@ namespace Steam
return false;
}
}
STEAM_IGNORE_WARNINGS_END

View File

@ -1,4 +1,6 @@
#include "STDInclude.hpp"
STEAM_IGNORE_WARNINGS_START
namespace Steam
{
@ -100,3 +102,5 @@ namespace Steam
return 0;
}
}
STEAM_IGNORE_WARNINGS_END

View File

@ -1,5 +1,7 @@
#include "STDInclude.hpp"
STEAM_IGNORE_WARNINGS_START
namespace Steam
{
unsigned int Utils::GetSecondsSinceAppActive()
@ -95,3 +97,5 @@ namespace Steam
return false;
}
}
STEAM_IGNORE_WARNINGS_END

View File

@ -2,6 +2,11 @@
#define STEAM_EXPORT extern "C" __declspec(dllexport)
#define STEAM_IGNORE_WARNINGS_START __pragma(warning(push)) \
__pragma(warning(disable: 4100))
#define STEAM_IGNORE_WARNINGS_END __pragma(warning(pop))
typedef union
{
struct

View File

@ -194,7 +194,7 @@ namespace Utils
}
}
void Import(std::string key, int type = PK_PRIVATE)
void Import(std::string key)
{
this->Free();