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',
|
||||
'-Wall',
|
||||
'-Werror',
|
||||
'-Wno-error=switch',
|
||||
'-Wno-error=unused-function',
|
||||
'-Wno-error=unused-private-field',
|
||||
'-msse',
|
||||
'-fvisibility=hidden',
|
||||
]
|
||||
|
||||
@ -1200,7 +1200,7 @@ bool IsWindowsReservedDeviceName(const char *pMapname)
|
||||
};
|
||||
|
||||
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]))
|
||||
{
|
||||
@ -1330,6 +1330,8 @@ string_t CHalfLife2::AllocPooledString(const char *pszValue)
|
||||
sm_datatable_info_t info;
|
||||
bool found = FindDataMapInfo(pDataMap, "m_iName", &info);
|
||||
assert(found);
|
||||
(void)(found); // silence -Wunused-variable for release builds
|
||||
|
||||
offset = info.actual_offset;
|
||||
}
|
||||
|
||||
|
||||
@ -469,8 +469,6 @@ void CRadioMenuPlayer::Radio_Refresh()
|
||||
{
|
||||
cell_t players[1] = { (cell_t)m_index };
|
||||
char *ptr = display_pkt;
|
||||
char save = 0;
|
||||
size_t len = display_len;
|
||||
unsigned int time;
|
||||
|
||||
/* Compute the new time */
|
||||
@ -491,6 +489,8 @@ void CRadioMenuPlayer::Radio_Refresh()
|
||||
msg->set_menu_string(ptr);
|
||||
g_UserMsgs.EndMessage();
|
||||
#else
|
||||
size_t len = display_len;
|
||||
char save = 0;
|
||||
while (true)
|
||||
{
|
||||
if (len > 240)
|
||||
|
||||
@ -315,7 +315,8 @@ bool UserMessages::EndMessage()
|
||||
delete m_FakeEngineBuffer;
|
||||
m_FakeEngineBuffer = NULL;
|
||||
break;
|
||||
//case MRES_SUPERCEDE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
OnMessageEnd_Post();
|
||||
|
||||
@ -232,12 +232,15 @@ bool CDataPack::RemoveItem(size_t pos)
|
||||
delete elements[pos].pData.vval;
|
||||
break;
|
||||
}
|
||||
|
||||
case CDataPackType::String:
|
||||
{
|
||||
delete elements[pos].pData.sval;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
elements.remove(pos);
|
||||
|
||||
@ -951,6 +951,10 @@ static void GuessDataPropTypes(typedescription_t *td, cell_t * pSize, cell_t * p
|
||||
return;
|
||||
}
|
||||
}
|
||||
default:
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
*pType = PropField_Unsupported;
|
||||
@ -1729,6 +1733,8 @@ static cell_t GetEntPropEnt(IPluginContext *pContext, const cell_t *params)
|
||||
type = PropEnt_Variant;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (type == PropEnt_Unknown)
|
||||
@ -1792,6 +1798,10 @@ static cell_t GetEntPropEnt(IPluginContext *pContext, const cell_t *params)
|
||||
|
||||
return IndexOfEdict(pEdict);
|
||||
}
|
||||
default:
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
@ -1846,6 +1856,8 @@ static cell_t SetEntPropEnt(IPluginContext *pContext, const cell_t *params)
|
||||
type = PropEnt_Variant;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
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;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
@ -37,8 +37,6 @@ class VProfTool
|
||||
public SMGlobalClass
|
||||
{
|
||||
public:
|
||||
VProfTool();
|
||||
|
||||
// IProfilingTool
|
||||
const char *Name() override;
|
||||
const char *Description() override;
|
||||
|
||||
@ -861,9 +861,9 @@ static cell_t FindEntityByClassname(IPluginContext *pContext, const cell_t *para
|
||||
#endif
|
||||
|
||||
static ValveCall *pCall = NULL;
|
||||
static bool bProbablyNoFEBC = false;
|
||||
|
||||
#if SOURCE_ENGINE >= SE_ORANGEBOX
|
||||
static bool bProbablyNoFEBC = false;
|
||||
if (bProbablyNoFEBC)
|
||||
{
|
||||
return NativeFindEntityByClassname(pContext, params);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user