mirror of
https://github.com/alliedmodders/sourcemod.git
synced 2025-12-07 18:38:37 +00:00
Remove -Wno-unused and clean up code.
This commit is contained in:
parent
a9465b1fa1
commit
0681110e14
@ -200,7 +200,7 @@ class SMConfig(object):
|
||||
'-fno-strict-aliasing',
|
||||
'-Wall',
|
||||
'-Werror',
|
||||
'-Wno-unused',
|
||||
'-Wno-error=unused-function',
|
||||
'-msse',
|
||||
'-m32',
|
||||
'-fvisibility=hidden',
|
||||
|
||||
@ -125,8 +125,6 @@ void ChatTriggers::OnSourceModAllInitialized_Post()
|
||||
|
||||
void ChatTriggers::OnSourceModGameInitialized()
|
||||
{
|
||||
ConCommand *say_team = FindCommand("say_team");
|
||||
|
||||
CommandHook::Callback pre_hook = [this] (int client, const ICommandArgs *args) -> bool {
|
||||
return this->OnSayCommand_Pre(client, args);
|
||||
};
|
||||
|
||||
@ -1054,7 +1054,6 @@ void CPluginManager::LoadAll_SecondPass()
|
||||
for (PluginIter iter(m_plugins); !iter.done(); iter.next()) {
|
||||
CPlugin *pPlugin = (*iter);
|
||||
if (pPlugin->GetStatus() == Plugin_Loaded) {
|
||||
char error[256] = {0};
|
||||
if (!RunSecondPass(pPlugin)) {
|
||||
g_Logger.LogError("[SM] Unable to load plugin \"%s\": %s", pPlugin->GetFilename(), pPlugin->GetErrorMsg());
|
||||
Purge(pPlugin);
|
||||
|
||||
@ -79,7 +79,6 @@ private:
|
||||
ke::Vector<IProfilingTool *> tools_;
|
||||
IProfilingTool *active_;
|
||||
IProfilingTool *default_;
|
||||
bool enabled_;
|
||||
};
|
||||
|
||||
extern ProfileToolManager g_ProfileToolManager;
|
||||
|
||||
@ -216,7 +216,6 @@ static cell_t sm_ClientCommand(IPluginContext *pContext, const cell_t *params)
|
||||
g_pSM->SetGlobalTarget(params[1]);
|
||||
|
||||
char buffer[256];
|
||||
size_t len;
|
||||
{
|
||||
DetectExceptions eh(pContext);
|
||||
g_pSM->FormatString(buffer, sizeof(buffer), pContext, params, 2);
|
||||
|
||||
@ -1191,7 +1191,6 @@ static cell_t _ShowActivity2(IPluginContext *pContext,
|
||||
char message[255];
|
||||
char buffer[255];
|
||||
int value = bridge->GetActivityFlags();
|
||||
unsigned int replyto = playerhelpers->GetReplyTo();
|
||||
int client = params[1];
|
||||
|
||||
const char *name = "Console";
|
||||
|
||||
@ -36,11 +36,6 @@
|
||||
|
||||
VProfTool sVProfTool;
|
||||
|
||||
VProfTool::VProfTool()
|
||||
: active_(false)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
VProfTool::OnSourceModAllInitialized()
|
||||
{
|
||||
|
||||
@ -53,9 +53,6 @@ public:
|
||||
|
||||
// SMGlobalClass
|
||||
void OnSourceModAllInitialized() override;
|
||||
|
||||
private:
|
||||
bool active_;
|
||||
};
|
||||
|
||||
#endif // _include_sourcemod_core_vprof_bridge_h_
|
||||
|
||||
@ -217,8 +217,6 @@ void ClientPrefs::AttemptReconnection()
|
||||
void ClientPrefs::DatabaseConnect()
|
||||
{
|
||||
char error[256];
|
||||
int errCode = 0;
|
||||
|
||||
Database = AdoptRef(Driver->Connect(DBInfo, true, error, sizeof(error)));
|
||||
|
||||
if (!Database)
|
||||
|
||||
@ -86,7 +86,6 @@ cell_t FindClientPrefCookie(IPluginContext *pContext, const cell_t *params)
|
||||
size_t IsAuthIdConnected(char *authID)
|
||||
{
|
||||
IGamePlayer *player;
|
||||
const char *authString;
|
||||
|
||||
for (int playerIndex = playerhelpers->GetMaxClients()+1; --playerIndex > 0;)
|
||||
{
|
||||
|
||||
@ -1751,7 +1751,7 @@ bool SDKHooks::Hook_WeaponSwitch(CBaseCombatWeapon *pWeapon, int viewmodelindex)
|
||||
|
||||
bool SDKHooks::Hook_WeaponSwitchPost(CBaseCombatWeapon *pWeapon, int viewmodelindex)
|
||||
{
|
||||
cell_t result = Call(META_IFACEPTR(CBaseEntity), SDKHook_WeaponSwitchPost, pWeapon);
|
||||
Call(META_IFACEPTR(CBaseEntity), SDKHook_WeaponSwitchPost, pWeapon);
|
||||
RETURN_META_VALUE(MRES_IGNORED, true);
|
||||
}
|
||||
|
||||
|
||||
@ -31,7 +31,6 @@
|
||||
|
||||
|
||||
#include "extension.h"
|
||||
#include "clientnatives.h"
|
||||
#include "iserver.h"
|
||||
#include "iclient.h"
|
||||
|
||||
@ -94,4 +93,4 @@ sp_nativeinfo_t g_ClientNatives[] =
|
||||
{ "InactivateClient", smn_InactivateClient },
|
||||
{ "ReconnectClient", smn_ReconnectClient },
|
||||
{ NULL, NULL },
|
||||
};
|
||||
};
|
||||
|
||||
@ -1,37 +0,0 @@
|
||||
/**
|
||||
* vim: set ts=4 :
|
||||
* =============================================================================
|
||||
* SourceMod SDKTools Extension
|
||||
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
|
||||
* =============================================================================
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, version 3.0, as published by the
|
||||
* Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* As a special exception, AlliedModders LLC gives you permission to link the
|
||||
* code of this program (as well as its derivative works) to "Half-Life 2," the
|
||||
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
|
||||
* by the Valve Corporation. You must obey the GNU General Public License in
|
||||
* all respects for all other code used. Additionally, AlliedModders LLC grants
|
||||
* this exception to all derivative works. AlliedModders LLC defines further
|
||||
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
|
||||
* or <http://www.sourcemod.net/license.php>.
|
||||
*
|
||||
* Version: $Id$
|
||||
*/
|
||||
#ifndef _INCLUDE_SDKTOOLS_CLIENTNATIVES_H_
|
||||
#define _INCLUDE_SDKTOOLS_CLIENTNATIVES_H_
|
||||
|
||||
static cell_t smn_InactivateClient(IPluginContext *pContext, const cell_t *params);
|
||||
static cell_t smn_ReconnectClient(IPluginContext *pContext, const cell_t *params);
|
||||
|
||||
#endif
|
||||
@ -42,7 +42,6 @@
|
||||
#include "hooks.h"
|
||||
#include "gamerulesnatives.h"
|
||||
#include <ISDKTools.h>
|
||||
#include "clientnatives.h"
|
||||
#include "teamnatives.h"
|
||||
#include "filesystem.h"
|
||||
/**
|
||||
|
||||
@ -170,8 +170,6 @@ static cell_t GameRules_GetProp(IPluginContext *pContext, const cell_t *params)
|
||||
|
||||
pContext->LocalToString(params[1], &prop);
|
||||
|
||||
int elementCount = 1;
|
||||
|
||||
FIND_PROP_SEND(DPT_Int, "integer");
|
||||
is_unsigned = ((pProp->GetFlags() & SPROP_UNSIGNED) == SPROP_UNSIGNED);
|
||||
|
||||
|
||||
@ -320,7 +320,7 @@ DataStatus DecodeValveParam(IPluginContext *pContext,
|
||||
* This has no destructor so we don't need to do
|
||||
* DestroyValveParam() or something :]
|
||||
*/
|
||||
Vector *v = new (mem) Vector(
|
||||
new (mem) Vector(
|
||||
sp_ctof(addr[0]),
|
||||
sp_ctof(addr[1]),
|
||||
sp_ctof(addr[2]));
|
||||
@ -367,7 +367,7 @@ DataStatus DecodeValveParam(IPluginContext *pContext,
|
||||
* This has no destructor so we don't need to do
|
||||
* DestroyValveParam() or something :]
|
||||
*/
|
||||
QAngle *v = new (mem) QAngle(
|
||||
new (mem) QAngle(
|
||||
sp_ctof(addr[0]),
|
||||
sp_ctof(addr[1]),
|
||||
sp_ctof(addr[2]));
|
||||
|
||||
@ -542,7 +542,7 @@ CON_COMMAND(sm_dump_netprops_xml, "Dumps the networkable property table as an XM
|
||||
#endif
|
||||
|
||||
time_t t = g_pSM->GetAdjustedTime();
|
||||
size_t written = strftime(buffer, sizeof(buffer), "%Y/%m/%d", localtime(&t));
|
||||
strftime(buffer, sizeof(buffer), "%Y/%m/%d", localtime(&t));
|
||||
|
||||
#if defined SUBPLATFORM_SECURECRT
|
||||
_set_invalid_parameter_handler(handler);
|
||||
@ -598,7 +598,7 @@ CON_COMMAND(sm_dump_netprops, "Dumps the networkable property table as a text fi
|
||||
#endif
|
||||
|
||||
time_t t = g_pSM->GetAdjustedTime();
|
||||
size_t written = strftime(buffer, sizeof(buffer), "%Y/%m/%d", localtime(&t));
|
||||
strftime(buffer, sizeof(buffer), "%Y/%m/%d", localtime(&t));
|
||||
|
||||
#if defined SUBPLATFORM_SECURECRT
|
||||
_set_invalid_parameter_handler(handler);
|
||||
@ -739,7 +739,7 @@ CON_COMMAND(sm_dump_classes, "Dumps the class list as a text file")
|
||||
#endif
|
||||
|
||||
time_t t = g_pSM->GetAdjustedTime();
|
||||
size_t written = strftime(buffer, sizeof(buffer), "%Y/%m/%d", localtime(&t));
|
||||
strftime(buffer, sizeof(buffer), "%Y/%m/%d", localtime(&t));
|
||||
|
||||
#if defined SUBPLATFORM_SECURECRT
|
||||
_set_invalid_parameter_handler(handler);
|
||||
@ -903,7 +903,7 @@ CON_COMMAND(sm_dump_datamaps, "Dumps the data map list as a text file")
|
||||
#endif
|
||||
|
||||
time_t t = g_pSM->GetAdjustedTime();
|
||||
size_t written = strftime(buffer, sizeof(buffer), "%Y/%m/%d", localtime(&t));
|
||||
strftime(buffer, sizeof(buffer), "%Y/%m/%d", localtime(&t));
|
||||
|
||||
#if defined SUBPLATFORM_SECURECRT
|
||||
_set_invalid_parameter_handler(handler);
|
||||
|
||||
@ -524,7 +524,6 @@ static cell_t SlapPlayer(IPluginContext *pContext, const cell_t *params)
|
||||
{
|
||||
static bool s_slap_supported = false;
|
||||
static bool s_slap_setup = false;
|
||||
static ICallWrapper *s_teleport = NULL;
|
||||
static int s_health_offs = 0;
|
||||
static int s_sound_count = 0;
|
||||
static int s_frag_offs = 0;
|
||||
|
||||
@ -17,6 +17,7 @@ binary.compiler.defines += [
|
||||
'SQLITE_ALLOW_URI_AUTHORITY',
|
||||
]
|
||||
if builder.target_platform == 'linux':
|
||||
binary.compiler.cflags += ['-Wno-error=unused-const-variable']
|
||||
binary.compiler.postlink += ['-ldl', '-lpthread']
|
||||
|
||||
binary.sources += [
|
||||
|
||||
@ -101,13 +101,14 @@ bool CritManager::TryEnable()
|
||||
void CritManager::Disable()
|
||||
{
|
||||
int i = m_entsHooked.FindNextSetBit(playerhelpers->GetMaxClients() + 1);
|
||||
for (i; i != -1; i = m_entsHooked.FindNextSetBit(i))
|
||||
while (i != -1)
|
||||
{
|
||||
CBaseEntity *pEntity = gamehelpers->ReferenceToEntity(i);
|
||||
SH_REMOVE_MANUALHOOK(CalcIsAttackCriticalHelper, pEntity, SH_MEMBER(&g_CritManager, &CritManager::Hook_CalcIsAttackCriticalHelper), false);
|
||||
SH_REMOVE_MANUALHOOK(CalcIsAttackCriticalHelperNoCrits, pEntity, SH_MEMBER(&g_CritManager, &CritManager::Hook_CalcIsAttackCriticalHelperNoCrits), false);
|
||||
|
||||
m_entsHooked.Set(i, false);
|
||||
i = m_entsHooked.FindNextSetBit(i);
|
||||
}
|
||||
|
||||
m_enabled = false;
|
||||
|
||||
@ -463,8 +463,6 @@ bool TopMenu::DisplayMenuAtCategory(int client, unsigned int object_id)
|
||||
return false;
|
||||
}
|
||||
|
||||
topmenu_category_t *category = m_Categories[category_id];
|
||||
|
||||
UpdateClientRoot(client, pPlayer);
|
||||
|
||||
topmenu_player_t *pClient = &m_clients[client];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user