mirror of
https://github.com/alliedmodders/sourcemod.git
synced 2025-12-07 02:18:35 +00:00
Fix unused decls, bad switches, linkage error, and nuked endings
This commit is contained in:
parent
a189985964
commit
a11486c1f6
@ -264,7 +264,9 @@ class SMConfig(object):
|
|||||||
'-fno-strict-aliasing',
|
'-fno-strict-aliasing',
|
||||||
'-Wall',
|
'-Wall',
|
||||||
'-Werror',
|
'-Werror',
|
||||||
|
'-Wno-error=switch',
|
||||||
'-Wno-error=unused-function',
|
'-Wno-error=unused-function',
|
||||||
|
'-Wno-error=unused-private-field',
|
||||||
'-msse',
|
'-msse',
|
||||||
'-fvisibility=hidden',
|
'-fvisibility=hidden',
|
||||||
]
|
]
|
||||||
|
|||||||
@ -1200,7 +1200,7 @@ bool IsWindowsReservedDeviceName(const char *pMapname)
|
|||||||
};
|
};
|
||||||
|
|
||||||
size_t reservedCount = sizeof(reservedDeviceNames) / sizeof(reservedDeviceNames[0]);
|
size_t reservedCount = sizeof(reservedDeviceNames) / sizeof(reservedDeviceNames[0]);
|
||||||
for (int i = 0; i < reservedCount; ++i)
|
for (size_t i = 0; i < reservedCount; ++i)
|
||||||
{
|
{
|
||||||
if (CheckReservedFilename(pMapname, reservedDeviceNames[i]))
|
if (CheckReservedFilename(pMapname, reservedDeviceNames[i]))
|
||||||
{
|
{
|
||||||
@ -1330,6 +1330,8 @@ string_t CHalfLife2::AllocPooledString(const char *pszValue)
|
|||||||
sm_datatable_info_t info;
|
sm_datatable_info_t info;
|
||||||
bool found = FindDataMapInfo(pDataMap, "m_iName", &info);
|
bool found = FindDataMapInfo(pDataMap, "m_iName", &info);
|
||||||
assert(found);
|
assert(found);
|
||||||
|
(void)(found); // silence -Wunused-variable for release builds
|
||||||
|
|
||||||
offset = info.actual_offset;
|
offset = info.actual_offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -469,8 +469,6 @@ void CRadioMenuPlayer::Radio_Refresh()
|
|||||||
{
|
{
|
||||||
cell_t players[1] = { (cell_t)m_index };
|
cell_t players[1] = { (cell_t)m_index };
|
||||||
char *ptr = display_pkt;
|
char *ptr = display_pkt;
|
||||||
char save = 0;
|
|
||||||
size_t len = display_len;
|
|
||||||
unsigned int time;
|
unsigned int time;
|
||||||
|
|
||||||
/* Compute the new time */
|
/* Compute the new time */
|
||||||
@ -491,6 +489,8 @@ void CRadioMenuPlayer::Radio_Refresh()
|
|||||||
msg->set_menu_string(ptr);
|
msg->set_menu_string(ptr);
|
||||||
g_UserMsgs.EndMessage();
|
g_UserMsgs.EndMessage();
|
||||||
#else
|
#else
|
||||||
|
size_t len = display_len;
|
||||||
|
char save = 0;
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
if (len > 240)
|
if (len > 240)
|
||||||
|
|||||||
@ -315,7 +315,8 @@ bool UserMessages::EndMessage()
|
|||||||
delete m_FakeEngineBuffer;
|
delete m_FakeEngineBuffer;
|
||||||
m_FakeEngineBuffer = NULL;
|
m_FakeEngineBuffer = NULL;
|
||||||
break;
|
break;
|
||||||
//case MRES_SUPERCEDE:
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
OnMessageEnd_Post();
|
OnMessageEnd_Post();
|
||||||
|
|||||||
@ -232,12 +232,15 @@ bool CDataPack::RemoveItem(size_t pos)
|
|||||||
delete elements[pos].pData.vval;
|
delete elements[pos].pData.vval;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case CDataPackType::String:
|
case CDataPackType::String:
|
||||||
{
|
{
|
||||||
delete elements[pos].pData.sval;
|
delete elements[pos].pData.sval;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
elements.remove(pos);
|
elements.remove(pos);
|
||||||
|
|||||||
@ -951,6 +951,10 @@ static void GuessDataPropTypes(typedescription_t *td, cell_t * pSize, cell_t * p
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
*pType = PropField_Unsupported;
|
*pType = PropField_Unsupported;
|
||||||
@ -1729,6 +1733,8 @@ static cell_t GetEntPropEnt(IPluginContext *pContext, const cell_t *params)
|
|||||||
type = PropEnt_Variant;
|
type = PropEnt_Variant;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == PropEnt_Unknown)
|
if (type == PropEnt_Unknown)
|
||||||
@ -1792,6 +1798,10 @@ static cell_t GetEntPropEnt(IPluginContext *pContext, const cell_t *params)
|
|||||||
|
|
||||||
return IndexOfEdict(pEdict);
|
return IndexOfEdict(pEdict);
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@ -1846,6 +1856,8 @@ static cell_t SetEntPropEnt(IPluginContext *pContext, const cell_t *params)
|
|||||||
type = PropEnt_Variant;
|
type = PropEnt_Variant;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == PropEnt_Unknown)
|
if (type == PropEnt_Unknown)
|
||||||
@ -1932,6 +1944,10 @@ static cell_t SetEntPropEnt(IPluginContext *pContext, const cell_t *params)
|
|||||||
*(edict_t **) ((uint8_t *) pEntity + offset) = pOtherEdict;
|
*(edict_t **) ((uint8_t *) pEntity + offset) = pOtherEdict;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
@ -37,8 +37,6 @@ class VProfTool
|
|||||||
public SMGlobalClass
|
public SMGlobalClass
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
VProfTool();
|
|
||||||
|
|
||||||
// IProfilingTool
|
// IProfilingTool
|
||||||
const char *Name() override;
|
const char *Name() override;
|
||||||
const char *Description() override;
|
const char *Description() override;
|
||||||
|
|||||||
@ -861,9 +861,9 @@ static cell_t FindEntityByClassname(IPluginContext *pContext, const cell_t *para
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static ValveCall *pCall = NULL;
|
static ValveCall *pCall = NULL;
|
||||||
static bool bProbablyNoFEBC = false;
|
|
||||||
|
|
||||||
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
||||||
|
static bool bProbablyNoFEBC = false;
|
||||||
if (bProbablyNoFEBC)
|
if (bProbablyNoFEBC)
|
||||||
{
|
{
|
||||||
return NativeFindEntityByClassname(pContext, params);
|
return NativeFindEntityByClassname(pContext, params);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user