mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-01-31 09:57:14 +01:00
Supress some fall through warnings in GCC with markers. Later to be updated to attributes and include support for more compilers.
This commit is contained in:
parent
68e00bce02
commit
ef0fc103cd
@ -236,9 +236,13 @@ Int32 Statement::Exec()
|
|||||||
{
|
{
|
||||||
// We don't expect any rows to be returned in this case!
|
// We don't expect any rows to be returned in this case!
|
||||||
case SQLITE_ROW: STHROWF("Results were found");
|
case SQLITE_ROW: STHROWF("Results were found");
|
||||||
|
// fall through
|
||||||
case SQLITE_BUSY: STHROWF("Database was busy");
|
case SQLITE_BUSY: STHROWF("Database was busy");
|
||||||
|
// fall through
|
||||||
case SQLITE_ERROR: STHROWF("Runtime error occurred");
|
case SQLITE_ERROR: STHROWF("Runtime error occurred");
|
||||||
|
// fall through
|
||||||
case SQLITE_MISUSE: STHROWF("Statement misuse");
|
case SQLITE_MISUSE: STHROWF("Statement misuse");
|
||||||
|
// fall through
|
||||||
default: STHROWF("Unknown failure [%s]", m_Handle->ErrStr());
|
default: STHROWF("Unknown failure [%s]", m_Handle->ErrStr());
|
||||||
}
|
}
|
||||||
// Operation failed (shouldn't reach this point!)
|
// Operation failed (shouldn't reach this point!)
|
||||||
@ -277,8 +281,11 @@ bool Statement::Step()
|
|||||||
switch (m_Handle->mStatus)
|
switch (m_Handle->mStatus)
|
||||||
{
|
{
|
||||||
case SQLITE_BUSY: STHROWF("Database was busy");
|
case SQLITE_BUSY: STHROWF("Database was busy");
|
||||||
|
// fall through
|
||||||
case SQLITE_ERROR: STHROWF("Runtime error occurred");
|
case SQLITE_ERROR: STHROWF("Runtime error occurred");
|
||||||
|
// fall through
|
||||||
case SQLITE_MISUSE: STHROWF("Statement misuse");
|
case SQLITE_MISUSE: STHROWF("Statement misuse");
|
||||||
|
// fall through
|
||||||
default: STHROWF("Unknown failure [%s]", m_Handle->ErrStr());
|
default: STHROWF("Unknown failure [%s]", m_Handle->ErrStr());
|
||||||
}
|
}
|
||||||
// Operation failed (shouldn't reach this point!)
|
// Operation failed (shouldn't reach this point!)
|
||||||
|
@ -1417,6 +1417,7 @@ void ImportModuleAPI(PluginFuncs * vcapi, CCStr mod)
|
|||||||
switch (plugin_exports->PopulateModuleAPI(&sqmodapi, sizeof(SQMODAPI)))
|
switch (plugin_exports->PopulateModuleAPI(&sqmodapi, sizeof(SQMODAPI)))
|
||||||
{
|
{
|
||||||
case -1: STHROWF("%s: Incompatible module API structure", mod);
|
case -1: STHROWF("%s: Incompatible module API structure", mod);
|
||||||
|
// fall through
|
||||||
case 0: STHROWF("%s: Invalid pointer to module API structure", mod);
|
case 0: STHROWF("%s: Invalid pointer to module API structure", mod);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1426,6 +1427,7 @@ void ImportModuleAPI(PluginFuncs * vcapi, CCStr mod)
|
|||||||
switch (plugin_exports->PopulateSquirrelAPI(&sqlibapi, sizeof(SQLIBAPI)))
|
switch (plugin_exports->PopulateSquirrelAPI(&sqlibapi, sizeof(SQLIBAPI)))
|
||||||
{
|
{
|
||||||
case -1: STHROWF("%s: Incompatible squirrel API structure", mod);
|
case -1: STHROWF("%s: Incompatible squirrel API structure", mod);
|
||||||
|
// fall through
|
||||||
case 0: STHROWF("%s: Invalid pointer to squirrel API structure", mod);
|
case 0: STHROWF("%s: Invalid pointer to squirrel API structure", mod);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -286,6 +286,15 @@ typedef std::basic_string< SQChar > String;
|
|||||||
#define SQMOD_FORCEINLINE inline
|
#define SQMOD_FORCEINLINE inline
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------------------
|
||||||
|
* ATTRIBUTES
|
||||||
|
*/
|
||||||
|
#if defined(__GNUC__) && __GNUC__ >= 7
|
||||||
|
#define SQ_FALL_THROUGH __attribute__ ((fallthrough))
|
||||||
|
#else
|
||||||
|
#define SQ_FALL_THROUGH ((void)0)
|
||||||
|
#endif // __GNUC__ >= 7
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
/* ------------------------------------------------------------------------------------------------
|
||||||
* LOGGING LOCATION
|
* LOGGING LOCATION
|
||||||
*/
|
*/
|
||||||
|
@ -161,6 +161,7 @@ Int32 GetSkinID(StackStrF & name)
|
|||||||
// [B]um guy (#1|A)/(#2|B)/(#3|C)
|
// [B]um guy (#1|A)/(#2|B)/(#3|C)
|
||||||
// [B]um lady (#1|A)/(#2|B)/(#2|C)/(#3|D)/(#4|E)
|
// [B]um lady (#1|A)/(#2|B)/(#2|C)/(#3|D)/(#4|E)
|
||||||
// [B]usiness man (#1|A)/(#2|B)/(#3|C)/(#4|D)/(#5|E)/(#6|F)
|
// [B]usiness man (#1|A)/(#2|B)/(#3|C)/(#4|D)/(#5|E)/(#6|F)
|
||||||
|
// fall through
|
||||||
case 'b':
|
case 'b':
|
||||||
// [Be]ach [g]uy (#1|A)/(#2|B)/(#3|C)/(#4|D)/(#5|E)/(#6|F)/(#7|G)/(#8|H)
|
// [Be]ach [g]uy (#1|A)/(#2|B)/(#3|C)/(#4|D)/(#5|E)/(#6|F)/(#7|G)/(#8|H)
|
||||||
if (b == 'e' && (c == 'g' || (len > 5 && str[5] == 'g')))
|
if (b == 'e' && (c == 'g' || (len > 5 && str[5] == 'g')))
|
||||||
@ -257,6 +258,7 @@ Int32 GetSkinID(StackStrF & name)
|
|||||||
// [C]op, [C]ortez
|
// [C]op, [C]ortez
|
||||||
// [C]riminal (#1|A)/(#2|B)
|
// [C]riminal (#1|A)/(#2|B)
|
||||||
// [C]uban (#1|A)/(#2|B)
|
// [C]uban (#1|A)/(#2|B)
|
||||||
|
// fall through
|
||||||
case 'c':
|
case 'c':
|
||||||
// [Ca]m, [Ca]m (Robber), [Ca]ndy Suxx
|
// [Ca]m, [Ca]m (Robber), [Ca]ndy Suxx
|
||||||
if (b == 'a')
|
if (b == 'a')
|
||||||
@ -328,6 +330,7 @@ Int32 GetSkinID(StackStrF & name)
|
|||||||
else if (b == 'u' && (d == '2' || d == 'b')) return SQMOD_SKIN_CUBAN_B;
|
else if (b == 'u' && (d == '2' || d == 'b')) return SQMOD_SKIN_CUBAN_B;
|
||||||
// [D]BP security (#1|A)/(#2|B)
|
// [D]BP security (#1|A)/(#2|B)
|
||||||
// [D]iaz guy (#1|A)/(#2|B)
|
// [D]iaz guy (#1|A)/(#2|B)
|
||||||
|
// fall through
|
||||||
case 'd':
|
case 'd':
|
||||||
switch (b)
|
switch (b)
|
||||||
{
|
{
|
||||||
@ -337,6 +340,7 @@ Int32 GetSkinID(StackStrF & name)
|
|||||||
if (d == '1' || d == 'a') return SQMOD_SKIN_DBP_SECURITY_A;
|
if (d == '1' || d == 'a') return SQMOD_SKIN_DBP_SECURITY_A;
|
||||||
else if (d == '2' || d == 'b') return SQMOD_SKIN_DBP_SECURITY_B;
|
else if (d == '2' || d == 'b') return SQMOD_SKIN_DBP_SECURITY_B;
|
||||||
// [Di]a[z] [g]uy (#1|A)/(#2|B)
|
// [Di]a[z] [g]uy (#1|A)/(#2|B)
|
||||||
|
// fall through
|
||||||
case 'i':
|
case 'i':
|
||||||
case 'z':
|
case 'z':
|
||||||
case 'g':
|
case 'g':
|
||||||
@ -344,6 +348,7 @@ Int32 GetSkinID(StackStrF & name)
|
|||||||
else if (d == '2' || d == 'b') return SQMOD_SKIN_DIAZ_GUY_B;
|
else if (d == '2' || d == 'b') return SQMOD_SKIN_DIAZ_GUY_B;
|
||||||
}
|
}
|
||||||
// [F]BI, [F]ireman, [F]ood lady, [F]rench guy
|
// [F]BI, [F]ireman, [F]ood lady, [F]rench guy
|
||||||
|
// fall through
|
||||||
case 'f':
|
case 'f':
|
||||||
switch (b)
|
switch (b)
|
||||||
{
|
{
|
||||||
@ -412,6 +417,7 @@ Int32 GetSkinID(StackStrF & name)
|
|||||||
return SQMOD_SKIN_GYM_LADY;
|
return SQMOD_SKIN_GYM_LADY;
|
||||||
// [H]atian (#1|A)/(#2|B)/(#3|C)/(#4|D)/(#5|E)
|
// [H]atian (#1|A)/(#2|B)/(#3|C)/(#4|D)/(#5|E)
|
||||||
// [H]ilary, [H]ilary (Robber), [H]ood lady
|
// [H]ilary, [H]ilary (Robber), [H]ood lady
|
||||||
|
// fall through
|
||||||
case 'h':
|
case 'h':
|
||||||
// [H]atian (#1|A)/(#2|B)/(#3|C)/(#4|D)/(#5|E)
|
// [H]atian (#1|A)/(#2|B)/(#3|C)/(#4|D)/(#5|E)
|
||||||
if (b == 'a')
|
if (b == 'a')
|
||||||
@ -437,6 +443,7 @@ Int32 GetSkinID(StackStrF & name)
|
|||||||
// [Ho]od [l]ady
|
// [Ho]od [l]ady
|
||||||
if (b && (b == 'o' || b == 'l')) return SQMOD_SKIN_HOOD_LADY;
|
if (b && (b == 'o' || b == 'l')) return SQMOD_SKIN_HOOD_LADY;
|
||||||
// [K]en Rosenburg
|
// [K]en Rosenburg
|
||||||
|
// fall through
|
||||||
case 'k':
|
case 'k':
|
||||||
return SQMOD_SKIN_KEN_ROSENBURG;
|
return SQMOD_SKIN_KEN_ROSENBURG;
|
||||||
// [L]ance (#1|A)/(#1|B)
|
// [L]ance (#1|A)/(#1|B)
|
||||||
@ -472,6 +479,7 @@ Int32 GetSkinID(StackStrF & name)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// [M]ercades
|
// [M]ercades
|
||||||
|
// fall through
|
||||||
case 'm':
|
case 'm':
|
||||||
if (d == 'b') return SQMOD_SKIN_MERCADES_B;
|
if (d == 'b') return SQMOD_SKIN_MERCADES_B;
|
||||||
else return SQMOD_SKIN_MERCADES_A;
|
else return SQMOD_SKIN_MERCADES_A;
|
||||||
@ -483,6 +491,7 @@ Int32 GetSkinID(StackStrF & name)
|
|||||||
// [P]imp, [P]izzaman
|
// [P]imp, [P]izzaman
|
||||||
// [P]rostitute (#1|A)/(#2|B)/(#2|C)/(#2|D)/(#3|D)/(#4|D)
|
// [P]rostitute (#1|A)/(#2|B)/(#2|C)/(#2|D)/(#3|D)/(#4|D)
|
||||||
// [P]unk (#1|A)/(#2|B)/(#3|C)
|
// [P]unk (#1|A)/(#2|B)/(#3|C)
|
||||||
|
// fall through
|
||||||
case 'p':
|
case 'p':
|
||||||
// [Pa]ramedic
|
// [Pa]ramedic
|
||||||
if (b == 'a') return SQMOD_SKIN_PARAMEDIC;
|
if (b == 'a') return SQMOD_SKIN_PARAMEDIC;
|
||||||
@ -533,6 +542,7 @@ Int32 GetSkinID(StackStrF & name)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// [R]ich guy, [R]ockstar guy
|
// [R]ich guy, [R]ockstar guy
|
||||||
|
// fall through
|
||||||
case 'r':
|
case 'r':
|
||||||
// [Ri]ch guy
|
// [Ri]ch guy
|
||||||
if (b == 'i') return SQMOD_SKIN_RICH_GUY;
|
if (b == 'i') return SQMOD_SKIN_RICH_GUY;
|
||||||
@ -549,6 +559,7 @@ Int32 GetSkinID(StackStrF & name)
|
|||||||
// [S]tore clerk
|
// [S]tore clerk
|
||||||
// [S]tripper (#1|A)/(#2|B)/(#3|C)
|
// [S]tripper (#1|A)/(#2|B)/(#3|C)
|
||||||
// [S]wat
|
// [S]wat
|
||||||
|
// fall through
|
||||||
case 's':
|
case 's':
|
||||||
// [Sa]ilor (#1|A)/(#2|B)/(#3|C)
|
// [Sa]ilor (#1|A)/(#2|B)/(#3|C)
|
||||||
if (b == 'a')
|
if (b == 'a')
|
||||||
@ -668,6 +679,7 @@ Int32 GetSkinID(StackStrF & name)
|
|||||||
// [T]ommy Vercetti
|
// [T]ommy Vercetti
|
||||||
// [T]ourist (#1|A)/(#2|B)
|
// [T]ourist (#1|A)/(#2|B)
|
||||||
// [T]ranny
|
// [T]ranny
|
||||||
|
// fall through
|
||||||
case 't':
|
case 't':
|
||||||
switch (b)
|
switch (b)
|
||||||
{
|
{
|
||||||
@ -698,6 +710,7 @@ Int32 GetSkinID(StackStrF & name)
|
|||||||
if (c == 'm') return SQMOD_SKIN_TOMMY_VERCETTI;
|
if (c == 'm') return SQMOD_SKIN_TOMMY_VERCETTI;
|
||||||
else if (c == 'u' && (d == '1' || d == 'a')) return SQMOD_SKIN_TOURIST_A;
|
else if (c == 'u' && (d == '1' || d == 'a')) return SQMOD_SKIN_TOURIST_A;
|
||||||
else if (c == 'u' && (d == '2' || d == 'b')) return SQMOD_SKIN_TOURIST_B;
|
else if (c == 'u' && (d == '2' || d == 'b')) return SQMOD_SKIN_TOURIST_B;
|
||||||
|
// fall through
|
||||||
case 'r': return SQMOD_SKIN_TRANNY;
|
case 'r': return SQMOD_SKIN_TRANNY;
|
||||||
}
|
}
|
||||||
// [U]ndercover cop (#1|A)/(#2|B)/(#3|C)/(#4|D)/(#5|E)/(#6|F)
|
// [U]ndercover cop (#1|A)/(#2|B)/(#3|C)/(#4|D)/(#5|E)/(#6|F)
|
||||||
|
@ -519,6 +519,15 @@ enum EntityType
|
|||||||
#define SQMOD_FORCEINLINE inline
|
#define SQMOD_FORCEINLINE inline
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------------------------------
|
||||||
|
* ATTRIBUTES
|
||||||
|
*/
|
||||||
|
#if defined(__GNUC__) && __GNUC__ >= 7
|
||||||
|
#define SQ_FALL_THROUGH __attribute__ ((fallthrough))
|
||||||
|
#else
|
||||||
|
#define SQ_FALL_THROUGH ((void)0)
|
||||||
|
#endif // __GNUC__ >= 7
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------------------------------
|
/* ------------------------------------------------------------------------------------------------
|
||||||
* LOGGING LOCATION
|
* LOGGING LOCATION
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user