Adds maybe_unused to several addon scripts

This commit is contained in:
Deukhoofd 2022-04-10 12:08:18 +02:00
parent 6734aa44ec
commit cc5cd3d238
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
9 changed files with 15 additions and 15 deletions

View File

@ -234,7 +234,7 @@ static void ConstructSet_Generic(asIScriptGeneric *gen)
void RegisterScriptDateTime(asIScriptEngine *engine)
{
int r = engine->RegisterObjectType("datetime", sizeof(CDateTime), asOBJ_VALUE | asOBJ_POD | asGetTypeTraits<CDateTime>()); assert(r >= 0);
[[maybe_unused]] int r = engine->RegisterObjectType("datetime", sizeof(CDateTime), asOBJ_VALUE | asOBJ_POD | asGetTypeTraits<CDateTime>()); assert(r >= 0);
if(strstr(asGetLibraryOptions(), "AS_MAX_PORTABILITY")==0)
{

View File

@ -141,7 +141,7 @@ void RegisterScriptAny(asIScriptEngine *engine)
void RegisterScriptAny_Native(asIScriptEngine *engine)
{
int r;
[[maybe_unused]] int r;
r = engine->RegisterObjectType("any", sizeof(CScriptAny), asOBJ_REF | asOBJ_GC); assert( r >= 0 );
// We'll use the generic interface for the constructor as we need the engine pointer
@ -170,7 +170,7 @@ void RegisterScriptAny_Native(asIScriptEngine *engine)
void RegisterScriptAny_Generic(asIScriptEngine *engine)
{
int r;
[[maybe_unused]] int r;
r = engine->RegisterObjectType("any", sizeof(CScriptAny), asOBJ_REF | asOBJ_GC); assert( r >= 0 );
// We'll use the generic interface for the constructor as we need the engine pointer

View File

@ -1068,7 +1068,7 @@ void RegisterScriptDictionary(asIScriptEngine *engine)
void RegisterScriptDictionary_Native(asIScriptEngine *engine)
{
int r;
[[maybe_unused]] int r;
// The array<string> type must be available
assert( engine->GetTypeInfoByDecl("array<string>") );
@ -1147,7 +1147,7 @@ void RegisterScriptDictionary_Native(asIScriptEngine *engine)
void RegisterScriptDictionary_Generic(asIScriptEngine *engine)
{
int r;
[[maybe_unused]] int r;
// Register the cleanup callback for the object type cache
engine->SetEngineUserDataCleanupCallback(SDictionaryCache::Cleanup, DICTIONARY_CACHE);

View File

@ -168,7 +168,7 @@ void ScriptFile_MovePos_Generic(asIScriptGeneric *gen)
void RegisterScriptFile_Native(asIScriptEngine *engine)
{
int r;
[[maybe_unused]] int r;
r = engine->RegisterObjectType("file", 0, asOBJ_REF); assert( r >= 0 );
r = engine->RegisterObjectBehaviour("file", asBEHAVE_FACTORY, "file @f()", asFUNCTION(ScriptFile_Factory), asCALL_CDECL); assert( r >= 0 );
@ -201,7 +201,7 @@ void RegisterScriptFile_Native(asIScriptEngine *engine)
void RegisterScriptFile_Generic(asIScriptEngine *engine)
{
int r;
[[maybe_unused]] int r;
r = engine->RegisterObjectType("file", 0, asOBJ_REF); assert( r >= 0 );
r = engine->RegisterObjectBehaviour("file", asBEHAVE_FACTORY, "file @f()", asFUNCTION(ScriptFile_Factory_Generic), asCALL_GENERIC); assert( r >= 0 );

View File

@ -220,7 +220,7 @@ void RegisterScriptGrid(asIScriptEngine *engine)
static void RegisterScriptGrid_Native(asIScriptEngine *engine)
{
int r;
[[maybe_unused]] int r;
// Register the grid type as a template
r = engine->RegisterObjectType("grid<class T>", 0, asOBJ_REF | asOBJ_GC | asOBJ_TEMPLATE); assert( r >= 0 );

View File

@ -230,7 +230,7 @@ void CScriptHandle::ReleaseReferences(asIScriptEngine * /*inEngine*/)
void RegisterScriptHandle_Native(asIScriptEngine *engine)
{
int r;
[[maybe_unused]] int r;
#if AS_CAN_USE_CPP11
// With C++11 it is possible to use asGetTypeTraits to automatically determine the flags that represent the C++ class
@ -332,7 +332,7 @@ void CScriptHandle_ReleaseReferences_Generic(asIScriptGeneric *gen)
void RegisterScriptHandle_Generic(asIScriptEngine *engine)
{
int r;
[[maybe_unused]] int r = 0;
r = engine->RegisterObjectType("ref", sizeof(CScriptHandle), asOBJ_VALUE | asOBJ_ASHANDLE | asOBJ_GC | asOBJ_APP_CLASS_CDAK); assert( r >= 0 );
r = engine->RegisterObjectBehaviour("ref", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(CScriptHandle_Construct_Generic), asCALL_GENERIC); assert( r >= 0 );

View File

@ -976,7 +976,7 @@ string ScriptGetExceptionInfo()
void RegisterExceptionRoutines(asIScriptEngine *engine)
{
int r;
[[maybe_unused]] int r;
// The string type must be available
assert(engine->GetTypeInfoByDecl("string"));

View File

@ -132,7 +132,7 @@ bool closeTo(double a, double b, double epsilon)
void RegisterScriptMath_Native(asIScriptEngine *engine)
{
int r;
[[maybe_unused]] int r;
// Conversion between floating point and IEEE bits representations
r = engine->RegisterGlobalFunction("float fpFromIEEE(uint)", asFUNCTIONPR(fpFromIEEE, (asUINT), float), asCALL_CDECL); assert( r >= 0 );
@ -278,7 +278,7 @@ void atan2_generic(asIScriptGeneric *gen)
#endif
void RegisterScriptMath_Generic(asIScriptEngine *engine)
{
int r;
[[maybe_unused]] int r;
#if AS_USE_FLOAT
// Trigonometric functions

View File

@ -220,7 +220,7 @@ bool CScriptWeakRef::Equals(void *ref) const
void RegisterScriptWeakRef_Native(asIScriptEngine *engine)
{
int r;
[[maybe_unused]] int r;
// Register a type for non-const handles
r = engine->RegisterObjectType("weakref<class T>", sizeof(CScriptWeakRef), asOBJ_VALUE | asOBJ_ASHANDLE | asOBJ_TEMPLATE | asOBJ_APP_CLASS_DAK); assert( r >= 0 );
@ -326,7 +326,7 @@ static void ScriptWeakRefTemplateCallback_Generic(asIScriptGeneric *gen)
void RegisterScriptWeakRef_Generic(asIScriptEngine *engine)
{
int r;
[[maybe_unused]] int r;
// Register a type for non-const handles
r = engine->RegisterObjectType("weakref<class T>", sizeof(CScriptWeakRef), asOBJ_VALUE | asOBJ_ASHANDLE | asOBJ_TEMPLATE | asOBJ_APP_CLASS_DAK); assert( r >= 0 );